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

Re: [PATCH/v2] Remove filename from conflict markers

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 1, 2009, 20:57 UTC
Message-ID
<7vljn8f7e5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090701201804.GA16876@old.homeip.net>
Martin Renold <martinxyz@gmx.ch> writes:
> Put filenames into the conflict markers only when they are different.
> Otherwise they are redundant information clutter.
>
> Print the filename explicitely when warning about a binary conflict.
I think we are getting closer.
> -	grep "Cannot merge binary files: HEAD:binary-file vs. F:binary-file" \
> -		merge.err
> +	grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge.err

In the original code, if you are not in "merge renamed" situation, you would see something like this.

    "Cannot merge binary files: HEAD:porn.jpg vs F:porn.jpg"
And the patch changes it to
    "Cannot merge binary files: porn.jpg (HEAD vs F)"

which is an improvement. I have to wonder, if it even necessary to say HEAD vs F when no rename is involved, though. Probably it is, as this is about binary files, and the user may need to extract the contents with something like "git cat-file blob HEAD:porn.jpg >tmp1.jpg".

When you are indeed in "merge renamed" situation, it gets a bit more interesting. The original said

    "Cannot merge binary files: HEAD:porn.jpg vs F:porn112.jpg"

which makes it clear that what is merged with what, but did not say where the resulting merge will go. The updated output would say something like this

    "Cannot merge binary files: porn.jpg (HEAD:porn.jpg vs F:porn112.jpg)"
which adds information and is probably better.

So overall, I like what the change does, but I'd probably wait for a few more days just in case there are objections from different corners, primarily because I am somewhat concerned that this change might affect users of mergetool (which I do not use myself) in some negative way.

Previous: Martin Renold
Message 8 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.