git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] (reverse) combined diff conflict style

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Feb 19, 2010, 07:15 UTC
Message-ID
<36ca99e91002182315i25ad527dt553d79628734b02f@mail.gmail.com>
In-Reply-To
<7vocjlx056.fsf@alter.siamese.dyndns.org>
[ 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
Previous: Junio C Hamano
Message 3 of 3 in “[RFC] (reverse) combined diff conflict style”
  1. Bert WesargFeb 18, 2010
  2. Junio C HamanoFeb 18, 2010
  3. Bert WesargFeb 19, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.