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

Re: [PATCH 4/5] Documentation: document AUTO_MERGE

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Apr 15, 2023, 15:36 UTC
Message-ID
<5cd89e46-f099-24bb-ebe4-fabdd6f94aef@gmail.com>
In-Reply-To
<CABPp-BHyvVhVKa+M-GYTG3OEmgmoaEij15BFXQ6oyDDsboxS9g@mail.gmail.com>
Hi Elijah,
Le 2023-04-15 à 03:03, Elijah Newren a écrit :
> On Fri, Apr 14, 2023 at 10:58 AM Philippe Blain via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
Thanks for pointing out my typos, those are fixed.
Show 27 quoted lines
>> diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
>> index dc9c6a663a9..99e5f652e92 100644
>> --- a/Documentation/user-manual.txt
>> +++ b/Documentation/user-manual.txt
>> @@ -1343,6 +1343,33 @@ $ git diff -3 file.txt           # diff against stage 3
>>  $ git diff --theirs file.txt   # same as the above.
>>  -------------------------------------------------
>>
>> +When using the 'ort' merge strategy (the default), before updating the working
>> +tree with the result of the merge, Git writes a special ref named AUTO_MERGE
>> +reflecting the state of the tree it is about to write. Conflicted paths that
>> +could not be automatically merged are written to this tree with conflict
>> +markers, just as in the working tree. AUTO_MERGE can thus be used with
>> +linkgit:git-diff[1] to show the changes you've made so far to resolve
>> +conflicts. Using the same example as above, after resolving the conflict we
>> +get:
> 
> Mostly...  To clarify, conflicted paths *with a textual conflict* are
> written with conflict markers.  Conflicted paths with non-textual
> conflicts are not.  There are several conflict types that fall into
> the non-textual conflict umbrella: binary files, file/directory,
> symlink/directory, symlink/file, modify/delete, rename/add,
> rename/delete, rename/rename (1to2), and various submodule and
> directory rename conflict types as well.
> 
> The AUTO_MERGE stuff will only help with seeing how textual conflicts
> were resolved, it's not much help with the non-textual conflicts.

That's true. I think that it might be a good idea to be explicit about "textual conflicts". Although, I think that precision should also be made in the other parts of the doc, not just the user manual, so I'll do that.

Thanks,
Philippe.
> (By contrast, the closely related --remerge-diff option to `git log`
> or `git show` does help see the resolution of *both* the textual and
> non-textual conflicts, but of course one can't use that option on the
> current merge until after first commiting the existing changes.)

That's true. And, remerge-diff only helps when actually looking at two-way merge commit, not with conflicts hit during a rebase, cherry-pick or revert.

A semi-related trick I use to check conflict resolution during a rebase (after resolving the conflicts but before 'git rebase --continue') is to manually construct a commit from the index and use 'git range-diff' to compare it to REBASE_HEAD. Thinking out loud, maybe a '--check-resolution' flag to the sequencer would make sense to do that automatically...

Previous: Elijah NewrenNext: Elijah Newren
Message 20 of 35 in “Document 'AUTO_MERGE' and more special refs”
  1. 0/5 Document 'AUTO_MERGE' and more special refsPhilippe Blain via GitGitGadget, Apr 14, 2023
  2. 1/5 revisions.txt: document more special refsPhilippe Blain via GitGitGadget, Apr 14, 2023
  3. Junio C HamanoApr 14, 2023
  4. Felipe ContrerasApr 15, 2023
  5. Victoria DyeApr 14, 2023
  6. Taylor BlauApr 14, 2023
  7. Felipe ContrerasApr 15, 2023
  8. 3/5 git-merge.txt: modernize word choice in "True merge" sectionPhilippe Blain via GitGitGadget, Apr 14, 2023
  9. Junio C HamanoApr 14, 2023
  10. 2/5 completion: complete REVERT_HEAD and BISECT_HEADPhilippe Blain via GitGitGadget, Apr 14, 2023
  11. Junio C HamanoApr 14, 2023
  12. 5/5 completion: complete AUTO_MERGEPhilippe Blain via GitGitGadget, Apr 14, 2023
  13. 4/5 Documentation: document AUTO_MERGEPhilippe Blain via GitGitGadget, Apr 14, 2023
  14. Taylor BlauApr 14, 2023
  15. Eric SunshineApr 15, 2023
  16. Elijah NewrenApr 15, 2023
  17. Eric SunshineApr 15, 2023
  18. Elijah NewrenApr 16, 2023
  19. Elijah NewrenApr 15, 2023
  20. Philippe BlainApr 15, 2023
  21. Elijah NewrenApr 15, 2023
  22. Junio C HamanoApr 14, 2023
  23. Victoria DyeApr 14, 2023
  24. Elijah NewrenApr 15, 2023
  25. Chris TorekApr 16, 2023
  26. 0/6 Document 'AUTO_MERGE' and more special refsPhilippe Blain via GitGitGadget, May 22, 2023
  27. 1/6 revisions.txt: use description list for special refsPhilippe Blain via GitGitGadget, May 22, 2023
  28. 2/6 revisions.txt: document more special refsPhilippe Blain via GitGitGadget, May 22, 2023
  29. 4/6 git-merge.txt: modernize word choice in "True merge" sectionPhilippe Blain via GitGitGadget, May 22, 2023
  30. 3/6 completion: complete REVERT_HEAD and BISECT_HEADPhilippe Blain via GitGitGadget, May 22, 2023
  31. 5/6 Documentation: document AUTO_MERGEPhilippe Blain via GitGitGadget, May 22, 2023
  32. 6/6 completion: complete AUTO_MERGEPhilippe Blain via GitGitGadget, May 22, 2023
  33. Elijah NewrenJun 1, 2023
  34. Junio C HamanoJun 1, 2023
  35. Junio C HamanoJun 1, 2023

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.