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

Re: first-class conflicts?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 11, 2023, 01:31 UTC
Message-ID
<xmqqh6ltrs6t.fsf@gitster.g>
In-Reply-To
<ZUmJyFs7z7wdmLVK@mit.edu>
"Theodore Ts'o" <tytso@mit.edu> writes:
Show 10 quoted lines
> And if you attempt to commit the merge without resolving the
> conflicts, git won't let you:
>
>    error: Committing is not possible because you have unmerged files.
>    hint: Fix them up in the work tree, and then use 'git add/rm <file>'
>    hint: as appropriate to mark resolution and make a commit.
>
> So it's hard to miss the indications of the content conflict, because
> if you try to commit without resolving them, it's not a warning, it's
> an outright error.

Correct but with a caveat: it is too easy for lazy folks to circumvent the safety by mistake with "commit -a".

I wonder if it would help users to add a new configuration option for those who want to live safer that tells "commit -a" to leave unmerged paths alone and require the unmerged paths to be added explicitly (which may have to extend to cover things like "add -u" and "add .").

Perhaps not. I often find myself doing "git add -u" after resolving conflicts and re-reading the result, without an explicit pathspec.

Previous: Theodore Ts'oNext: Sandra Snan
Message 9 of 25 in “first-class conflicts?”
  1. Sandra SnanNov 6, 2023
  2. Dragan SimicNov 6, 2023
  3. Sandra SnanNov 6, 2023
  4. rsbecker@nexbridge.comNov 6, 2023
  5. Sandra SnanNov 6, 2023
  6. Phillip WoodNov 7, 2023
  7. Sandra SnanNov 7, 2023
  8. Theodore Ts'oNov 7, 2023
  9. Junio C HamanoNov 11, 2023
  10. Sandra SnanNov 11, 2023
  11. Theodore Ts'oNov 12, 2023
  12. Junio C HamanoNov 12, 2023
  13. Elijah NewrenNov 7, 2023
  14. Dragan SimicNov 7, 2023
  15. Sandra SnanNov 7, 2023
  16. Phillip WoodNov 7, 2023
  17. Martin von ZweigbergkNov 7, 2023
  18. Elijah NewrenNov 8, 2023
  19. Martin von ZweigbergkNov 8, 2023
  20. Elijah NewrenNov 10, 2023
  21. Martin von ZweigbergkNov 12, 2023
  22. phillip.wood123@gmail.comNov 9, 2023
  23. Elijah NewrenNov 8, 2023
  24. Phillip WoodNov 9, 2023
  25. Elijah NewrenNov 10, 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.