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

Re: [PATCH 0/2] Respecting core.autocrlf when showing objects

From
Marius Storm-Olsen <marius@trolltech.com>
Date
Jun 12, 2008, 20:16 UTC
Message-ID
<48518418.2010007@trolltech.com>
In-Reply-To
<7vtzfy8n4i.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 13 quoted lines
> Marius Storm-Olsen <marius@trolltech.com> writes:
>> Uhm, 'git checkout side file.txt' is not the same file content 
>> (ignoring EOLs please) as 'git show :3:file.txt'. Ref:
>> user-manual.html#conflict-resolution
> 
> Bruce, I think the comment in this quoted section is wrong.
> 
> True, the combined diff can show only the interesting differences
> between the three, but that is not because we munge stage #2 and #3.
> They contain verbatim copies from the HEAD and the MERGE_HEAD
> respectively, and the combining logic runs three-way diffs between
> the three stages to discard the hunks that the result comes solely
> from either stage #2 or stage #3.
...
Show 9 quoted lines
> -Since the stage 2 and stage 3 versions have already been updated
> with -nonconflicting changes, the only remaining differences between
> them are -the important ones; thus linkgit:git-diff[1] can use the
> information in -the index to show only those conflicts. +When you ask
> linkgit:git-diff[1] to show the conflicts, it runs a +three-way diff
> between the conflicted merge results in the work tree with +stages 2
> and 3 to show only hunks whose contents come from both sides, +mixed
> (in other words, when a hunk's merge results come only from stage 2, 
> +that part is not conflicting and is not shown.  Same for stage 3).
Aah, that certainly clears things up a bit. A good patch I'd say.

However, it doesn't change the fact that IMO "git show" should respect core.autocrlf, while "git cat-file" shouldn't.

I think many would consider
     git show MERGE_HEAD:file.txt > file.txt
before
     git checkout MERGE_HEAD file.txt
if only because they'd be scared to do a "checkout" in the middle of a 
merge conflict.

Personally I think the latter is nice, short and sweet, but that doesn't mean that it's less scary for people staring out on git. The fact that the two commands above are *not* identical in result, are the kind of things that we need to iron out, to make git more accessible to the general public.

-- .marius

Previous: Jon Loeliger
Message 26 of 26 in “Add testcase for merging in a CRLF repo, showing that conflict file is in LF only”
  1. Add testcase for merging in a CRLF repo, showing that conflict file is in LF onlyMarius Storm-Olsen, Jun 9, 2008
  2. Johannes SixtJun 9, 2008
  3. Marius Storm-OlsenJun 9, 2008
  4. Johannes SixtJun 9, 2008
  5. Marius Storm-OlsenJun 9, 2008
  6. 1/2 Add testcase for merging in a CRLF repoJohannes Schindelin, Jun 9, 2008
  7. 2/2 merge-recursive: respect core.autocrlfJohannes Schindelin, Jun 9, 2008
  8. Junio C HamanoJun 9, 2008
  9. merge-recursive: respect core.autocrlfJohannes Schindelin, Jun 9, 2008
  10. Junio C HamanoJun 9, 2008
  11. Johannes SchindelinJun 9, 2008
  12. 0/2 Respecting core.autocrlf when showing objectsMarius Storm-Olsen, Jun 10, 2008
  13. 1/2 Add testcases for verifying that staged files in a conflict are CRLF, when core.autocrlf = trueMarius Storm-Olsen, Jun 10, 2008
  14. 2/2 Ensure that objects shown in a core.autocrlf = true repo have CRLF EOLsMarius Storm-Olsen, Jun 10, 2008
  15. Johannes SchindelinJun 10, 2008
  16. Junio C HamanoJun 10, 2008
  17. Marius Storm-OlsenJun 11, 2008
  18. Jakub NarebskiJun 11, 2008
  19. Johannes SchindelinJun 11, 2008
  20. Marius Storm-OlsenJun 12, 2008
  21. Junio C HamanoJun 12, 2008
  22. J. Bruce FieldsJun 12, 2008
  23. Jakub NarebskiJun 12, 2008
  24. Junio C HamanoJun 12, 2008
  25. Jon LoeligerJun 12, 2008
  26. Marius Storm-OlsenJun 12, 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.