From: Bert Wesarg Date: Fri, 19 Feb 2010 07:15:15 GMT Subject: Re: [RFC] (reverse) combined diff conflict style 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 wrote: > Bert Wesarg 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