Since Pijul has very detailed information about conflicts, we could theoretically output almost anything, including conflict markers compatible with the language’s syntax (here, the choice of <
and >
can slow down my text editor quite a bit, for example).
Any idea for a way to make these customisable? My current plan is to have a section of the global config file with a syntax like:
[conflicts.rs]
begin_conflict_marker = "/**** BEGIN CONFLICT: %s %a"
conflict_separator = "**************** %s %a"
end_conflict_marker = "**** END CONFLICT */"
Where %s
could mean something like “short identifier of the patch for the conflict’s first side” and %a
is the author of that patch.
What do you think?
Zombie conflicts (like the one you had) are slightly trickier, since there could be context missing around them, and these markers are less useful.
I would like to differentiate between that. It might be a good idea to make them customisable, but that is not my problem… My problem is, that I
} else {
or such are just missing or misplaced.conflict resolution for the conflict above looks also a bit weird: #TFTQAJHCELIHDUOKHP6VN3I77GKFCXYA5IVSSCKZDOLKLILMR5UQC
In my understanding, the conflict representation in a file has some important properties:
Regarding 1 and 2: This linearisation limits reuse of partially common context. So, context may be repeated to make the effect of each contribution visible in the surrounding context. To emphasize, conflicts must never be represented as inside one another. Regarding 3: It is important to find a stable representation that captures (and outputs!) enough context in each piece, such that the piece and the surrounding common code can stand on their own. To clarify, it should be possible to arrive at the content a single change would have created at a conflict by just removing the pieces of the other conflicting changes (and the conflict markers).
Overall, the conflict representation must serve one particular purpose: The user must be able to judge, what each change contributes to the conflicting section. So, she can decide, which parts to delete, or merge, or rewrite, to make the code work again. It is not the purpose of conflict representation to be a faithful representation of the underlying conflict graph but of the influence the conflict has on the content of the file.
Example:
aaaaa
bbbbb
>>>>>>> [1:...]
ccccc
====== [2:...]
ccccc
====== [3:...]
<<<<<<
ddddd
So this shows that [1] and [2] are both contributing ccccc
, so dropping either or both (i.e., opting for [3]), or merging both may be the correct resolve.
Regarding zombie conflicts: I haven’t grasped their influence on the content of a file, yet. What does a zombie mean? What lines of text does it add or remove? Because of 1. and 3., representation of a zombie conflict should be changed so that the user can see what the zombie would make the file look like on its own.
I’m finally getting to this discussion! Zombie conflicts are insertions in a block of text deleted concurrently.
I just pushed #GA3P7FOMATKDOGCZDYWLZJHAUNOWMRIP3BXTYFEH7PNWTTYYVLIAC which implements nicer conflict markers.
I recently ran into a few conflicts, but currently the conflict markers are suboptimal, because it is almost impossible to know how to fix the conflict without looking at the original states without conflicts… e.g. (while trying to fix conflicts in discussion 488)
The lines inside the conflicts markers clearly come from ~somewhere~, but are as-is basically almost “garbage” to work with.