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

Re: [PATCH 2/2 - RFH/WIP] xdiff-merge: optionally show conflicts in "diff3 -m" style

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 29, 2008, 00:34 UTC
Message-ID
<alpine.LFD.1.10.0808281727490.3300@nehalem.linux-foundation.org>
In-Reply-To
<7vsksobrn9.fsf@gitster.siamese.dyndns.org>
On Thu, 28 Aug 2008, Junio C Hamano wrote:
Show 15 quoted lines
> 
> Some poeple find it easier to be able to understand what is going on when
> they can view the common ancestor's version, which is used by "diff3 -m",
> which shows:
> 
>  <<<<<<<
>  postimage from one side;
>  |||||||
>  shared preimage;
>  =======
>  postimage of the other side; and
>  >>>>>>>
> 
> This is an initial step to bring that as an optional feature to git.
> Only "git merge-file" has been converted, with "--diff3" option.

If you have the common ancestor, why would you ever want this format, and not a nice conflict entry in the index?

Anyway, that's irrelevant for my real question, which is:
Show 24 quoted lines
>  /*
> - * level == 0: mark all overlapping changes as conflict
> - * level == 1: mark overlapping changes as conflict only if not identical
> - * level == 2: analyze non-identical changes for minimal conflict set
> - * level == 3: analyze non-identical changes for minimal conflict set, but
> - *             treat hunks not containing any letter or number as conflicting
> + * "Level" parameter can be:
> + *
> + * (MINIMAL):
> + * Mark all overlapping changes as conflict
> + *
> + * (EAGER):
> + * Mark overlapping changes as conflict only if not identical
> + *
> + * (DIFF3):
> + * Same as EAGER but show the shared preimage in the output as well
> + *
> + * (ZEALOUS):
> + * Analyze non-identical changes for minimal conflict set
> + *
> + * (ZEALOUS_ALNUM):
> + * Analyze non-identical changes for minimal conflict set, but
> + * treat hunks not containing any letter or number as conflicting
>   *

Wouldn't it be much nicer to make this a bitflag, than an enumeration of different models?

In particular, why would it be wrong to want to be ZEALOUS (possibly _ALNUM) and still want DIFF3 output?

IOW, I don't think these are at all disjoint sets. In fact, I think DIFF3 sounds not at all like a "level" to me, but like an output format thing, so it's in a totally different "address space".

Hmm?
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “xdl_fill_merge_buffer(): separate out a too deeply nested function”
  1. 1/2 xdl_fill_merge_buffer(): separate out a too deeply nested functionJunio C Hamano, Aug 29, 2008
  2. 2/2 xdiff-merge: optionally show conflicts in "diff3 -m" styleJunio C Hamano, Aug 29, 2008
  3. Linus TorvaldsAug 29, 2008
  4. Junio C HamanoAug 29, 2008
  5. Junio C HamanoAug 31, 2008
  6. Linus TorvaldsAug 31, 2008
  7. Junio C HamanoAug 31, 2008
  8. Junio C HamanoAug 29, 2008
  9. Junio C HamanoAug 29, 2008

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.