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

Re: [PATCH] Remove filename from conflict markers

From
Martin Renold <martinxyz@gmx.ch>
Date
Jul 1, 2009, 16:16 UTC
Message-ID
<20090701161651.GA29393@old.homeip.net>
In-Reply-To
<7vljn8ls0c.fsf@alter.siamese.dyndns.org>
On Wed, Jul 01, 2009 at 01:36:03AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Martin Renold <martinxyz@gmx.ch> writes:
> >  git ls-files --stage > out
> >  cat > expect << EOF
> > -100644 da056ce14a2241509897fa68bb2b3b6e6194ef9e 1      a1
> > +100644 439cc46de773d8a83c77799b7cc9191c128bfcff 1      a1
> >  100644 cf84443e49e1b366fac938711ddf4be2d4d1d9e9 2      a1
> >  100644 fd7923529855d0b274795ae3349c5e0438333979 3      a1
> >  EOF
> 
> I think Nana's patch also had this, but what is this hunk about?  IOW, why
> does stage #1 (common ancestor's version) even change?
> 
> Is this a virtual ancestor in a criss-cross recursive merge?

The file contains conflict markers, which is why it changes. I don't understand why it has them. The merge looks pretty complex.

Show 6 quoted lines
> But more importantly, would this new output format really as informative
> as you claim, even when the file that cannot be automerged due to its
> binaryness is not named "binary-file" but simply say "X"?  The merge.err
> output shows that there were some file that failed to merge due to being
> binary, and merge.out output owuld show that "X" had conflict.  Would it
> be just as easy for the end user to connect these two as it used to be?

You are right. With both binary and textual conflicts at the same time, the user can not connect the two events, except by already knowing which files are binary.

I think ideally the different pieces of information (the filename, the fact that it has a merge conflict, and that it is binary) should be printed only once and together. But this goes beyond what I want to do right now.

>From an implementation point of view, the variables name1 and name2 seem to

be arbitrary, possibly user-defined conflict markers. I think it is wrong to print them in ll_xdl_merge() as if they were filenames. I will try to make a new patch that also addresses this issue.

> I for now am assuming no mechanical end user is parsing this output to
> figure out what to do, but that assumption might even be wrong.

In the rebase scenario, the mechanical end user has like 5 different places where he could pick the filename from. If I was writing a script I would not expect such an output to remain stable.

bye, Martin

Previous: Junio C HamanoNext: Martin Renold
Message 6 of 8 in “Remove filename from conflict markers”
  1. Remove filename from conflict markersMartin Renold, Jun 28, 2009
  2. Junio C HamanoJun 30, 2009
  3. Nanako ShiraishiJul 1, 2009
  4. Martin RenoldJul 1, 2009
  5. Junio C HamanoJul 1, 2009
  6. Martin RenoldJul 1, 2009
  7. Remove filename from conflict markersMartin Renold, Jul 1, 2009
  8. Junio C HamanoJul 1, 2009

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.