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

Re: Opinions on changing add/add conflict resolution?

From
Elijah Newren <newren@gmail.com>
Date
Mar 13, 2018, 18:21 UTC
Message-ID
<CABPp-BF-LnGPx6vKzCNaFNi_fkxK-CpenatOVa2fvJRZHd0hZw@mail.gmail.com>
In-Reply-To
<CAPc5daVu8vv9RdGON8JiXEO3ycDVqQ38ySzZc-cpo+AQcAKXjA@mail.gmail.com>
On Mon, Mar 12, 2018 at 10:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
> While I do not think it is a bad idea to add an optional way to write the
> contents of conflicted stages out to separate files, I do not think it is a
> good idea to change what happens to add/add conflict by default.
<snip some other good arguments>
> If anything, if rename/rename behaves differently by always writing
> the result out to separate files, it is that codepath whose behaviour
> should be fixed to match how add/add conflicts are dealt with.

Cool, thanks for the context. I'm happy to go down this path, but there is one question I'd like your opinion on: what if the intermediate content merges have conflicts themselves? If that question isn't clear, let me be more precise...

Let's say A is renamed to C in HEAD, and both sides modified. We thus need to do a 3-way content merge of C from HEAD with the two A's. Let's call the result C1. Further, let's say that B is renamed to C in $MERGE_BRANCH, and both sides modified. Again we need a 3-way content merge for that other C; let's call the result C2. If neither C1 nor C2 have content conflicts, then making rename/rename(2to1) act like add/add is easy: just do a two-way merge of C1 and C2. But what if C1 or C2 have conflicts? Doing a two-way merge in that case could result in nested conflict markers. Is that okay, or would we want to continue the old behavior of writing C1 and C2 out to separate files for that special case only?

I'm inclined to special case content conflicts in the intermediate merges and handle them by writing out to separate files, but I was the one who suggested sometimes using separate files for add/add conflicts; I'm curious if perhaps my strong aversion to nested conflicts is also off base.

Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 22 in “Opinions on changing add/add conflict resolution?”
  1. Elijah NewrenMar 12, 2018
  2. Jonathan NiederMar 12, 2018
  3. Elijah NewrenMar 12, 2018
  4. Jonathan NiederMar 12, 2018
  5. Hilco WijbengaMar 12, 2018
  6. Jonathan NiederMar 12, 2018
  7. Elijah NewrenMar 13, 2018
  8. Elijah NewrenMar 13, 2018
  9. Junio C HamanoMar 13, 2018
  10. Elijah NewrenMar 13, 2018
  11. Junio C HamanoMar 13, 2018
  12. Elijah NewrenMar 13, 2018
  13. Junio C HamanoMar 13, 2018
  14. Elijah NewrenMar 13, 2018
  15. Jonathan NiederMar 13, 2018
  16. Elijah NewrenMar 13, 2018
  17. Junio C HamanoMar 13, 2018
  18. Ævar Arnfjörð BjarmasonMar 12, 2018
  19. Fwd: Opinions on changing add/add conflict resolution?Elijah Newren, Mar 13, 2018
  20. Junio C HamanoMar 13, 2018
  21. Ævar Arnfjörð BjarmasonMar 13, 2018
  22. Elijah NewrenMar 13, 2018

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.