Re: [RFC] (reverse) combined diff conflict style
[ Sorry, I removed the list by mistake. CC'ed again ]
On Fri, Feb 19, 2010 at 06:30, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>> I use two programmed short-cuts in my editor for this. The first
>> 'applies' the diff, i.e. it keeps all lines prefixed with ' ' or '+'
>> and deletes lines with '-', and then removes the first column. The
>> second 'reverses' a diff, i.e. exchanges '+' with '-' and vice versa.
>> With these two operations I find it easier to resolve the conflict
>> than with the mege/diff3 presentation.
>>
>> I'm also convinced, that it is currently impossible to implement this
>> conflict style in the xdiff library. So it will probably be forever
>> some 'external solution'.
>
> Why not?
>
> IIUC, your approach is to postprocess output diff3 style merge.
>
> - First define your style as a new "conflict style" and store it in
> git_xmerge_style to pass it around. "checkout --conflict=bert" would
> learn this style automatically.
>
> - In ll_xdl_merge(), we usually call xdl_merge() and return directly its
> return value. When style is "bert", instead of doing that, you pass
> "diff3 style" and drive xdl_merge(), _but_ you do not return. Instead,
> you do your postprocessing right there and then return the result.
Thanks for this pointer. That looks really doable. Will report back later.
Bert