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

Re: [PATCH v2 0/4] git add --resolved

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 30, 2026, 08:41 UTC
Message-ID
<xmqqfr10lvhx.fsf@gitster.g>
In-Reply-To
<CAC2QwmKD1d=-mz4WrkA7CHwi-ko75MP2LDFPWx+1FGLQtf4QtA@mail.gmail.com>
Michael Montalbo <mmontalbo@gmail.com> writes:
Show 14 quoted lines
> For example, could the user-facing option be something like:
>
>     git add --unmerged
>
> with the same default behavior being proposed: select only unmerged
> index entries, and refuse the operation if any selected regular file
> contains standard Git conflict markers.
>
> That would also potentially leave room for explicit policy escape
> hatches later, such as:
>
>     git add --unmerged --allow-conflict-markers
>
> for cases where marker-looking content is intentional; or

Sure, but I do not think of a reason why the posted patches cannot later be extended in that direction if somebody wanted to (but because the option is called "--resolved", the command line would need to become "add --resolved --allow-conflict-markers"). I just did not feel the need for it myself, and because --allow would be a rare case, I would likely do "git add --resolved", see it fail due to conflict marker looking strings that are deliberately left in, and then do "git add $path" to cover these small exceptions, i.e., I do not think anybody would need "--allow-conflict-markers" option.

Show 6 quoted lines
> something like:
>
>     git add --unmerged --skip-conflict-markers
>
> for a mode that stages marker-free unmerged paths while leaving
> marker-containing paths unmerged and returning non-zero.

Have no idea how the user recovers after performing an operation like that.

The naming is very much deliberate. "git am --resolved" tells the command "I am done with them, so please continue". It is not like I want to add anything that are unmerged. I dealt with unmerged stuff and turned them into the resolved state, and the command is a request to record that fact. It is a regression to call it "--unmerged".

Previous: Michael MontalboNext: Michael Montalbo
Message 21 of 30 in “git add --resolved”
  1. 0/4 git add --resolvedJunio C Hamano, Jul 28, 2026
  2. 1/4 merge-ll: consolidate conflict marker scanning logicJunio C Hamano, Jul 28, 2026
  3. 2/4 read-cache: add remove_file_from_index_with_flags()Junio C Hamano, Jul 28, 2026
  4. 3/4 add: introduce '--resolved' optionJunio C Hamano, Jul 28, 2026
  5. Michael MontalboJul 29, 2026
  6. Junio C HamanoJul 29, 2026
  7. Junio C HamanoJul 29, 2026
  8. Junio C HamanoAug 2, 2026
  9. Junio C HamanoJul 29, 2026
  10. Michael MontalboAug 2, 2026
  11. Junio C HamanoAug 2, 2026
  12. Michael MontalboAug 3, 2026
  13. 4/4 read-cache: reindentJunio C Hamano, Jul 28, 2026
  14. 0/4 git add --resolvedJunio C Hamano, Jul 29, 2026
  15. 1/4 read-cache: reindentJunio C Hamano, Jul 29, 2026
  16. 2/4 merge-ll: consolidate conflict marker scanning logicJunio C Hamano, Jul 29, 2026
  17. 3/4 read-cache: add remove_file_from_index_with_flags()Junio C Hamano, Jul 29, 2026
  18. 4/4 add: introduce '--resolved' optionJunio C Hamano, Jul 29, 2026
  19. Junio C HamanoJul 29, 2026
  20. Michael MontalboJul 29, 2026
  21. Junio C HamanoJul 30, 2026
  22. Michael MontalboAug 2, 2026
  23. 0/4 git add --resolvedJunio C Hamano, Jul 31, 2026
  24. 1/4 read-cache: reindentJunio C Hamano, Jul 31, 2026
  25. 2/4 merge-ll: consolidate conflict marker scanning logicJunio C Hamano, Jul 31, 2026
  26. 3/4 read-cache: add remove_file_from_index_with_flags()Junio C Hamano, Jul 31, 2026
  27. 4/4 add: introduce '--resolved' optionJunio C Hamano, Jul 31, 2026
  28. Jeff KingAug 1, 2026
  29. Junio C HamanoAug 1, 2026
  30. Junio C HamanoAug 1, 2026

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.