git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/9] merge tests: expect improved directory/file conflict handling in ort
Date: Fri, 23 Oct 2020 10:40:28 -0700	[thread overview]
Message-ID: <CABPp-BEhjecB7_juP3cSuF7MUHKbPXqAxKgKstPZw2ezHXputw@mail.gmail.com> (raw)
In-Reply-To: <9394d526f1425fcf6b8865b53b737ba81c11dd80.1603468885.git.gitgitgadget@gmail.com>

On Fri, Oct 23, 2020 at 9:01 AM Elijah Newren via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Elijah Newren <newren@gmail.com>
>
> merge-recursive.c is built on the idea of running unpack_trees() and
> then "doing minor touch-ups" to get the result.  Unfortunately,
> unpack_trees() was run in an update-as-it-goes mode, leading
> merge-recursive.c to follow suit and end up with an immediate evaluation
> and fix-it-up-as-you-go design.  Some things like directory/file
> conflicts are not well representable in the index data structure, and
> required special extra code to handle.  But then when it was discovered
> that rename/delete conflicts could also be involved in directory/file
> conflicts, the special directory/file conflict handling code had to be
> copied to the rename/delete codepath.  ...and then it had to be copied
> for modify/delete, and for rename/rename(1to2) conflicts, ...and yet it
> still missed some.  Further, when it was discovered that there were also
> file/submodule conflicts and submodule/directory conflicts, we needed to
> copy the special submodule handling code to all the special cases
> throughout the codebase.
>
> And then it was discovered that our handling of directory/file conflicts
> was suboptimal because it would create untracked files to store the
> contents of the conflicting file, which would not be cleaned up if
> someone were to run a 'git merge --abort' or 'git rebase --abort'.  It
> was also difficult or scary to try to add or remove the index entries
> corresponding to these files given the directory/file conflict in the
> index.  But changing merge-recursive.c to handle these correctly was a
> royal pain because there were so many sites in the code with similar but
> not identical code for handling directory/file/submodule conflicts that
> would all need to be updated.
>
> I have worked hard to push all directory/file/submodule conflict
> handling in merge-ort through a single codepath, and avoid creating
> untracked files for storing tracked content (it does record things at
> alternate paths, but makes sure they have higher-order stages in the
> index).
>
> Since updating merge-recursive is too much work and we don't want to
> destabilize it, instead update the testsuite to have different
> expectations for relevant directory/file/submodule conflict tests.
>
> Signed-off-by: Elijah Newren <newren@gmail.com>

Perhaps I should also mention that these changes to directory/file
conflict handling were discussed previously in the thread at
https://lore.kernel.org/git/xmqqbmabcuhf.fsf@gitster-ct.c.googlers.com/.
I just never got around to a complete implementation within
merge-recursive.c, but did implement it in merge-ort.c

I still haven't gotten around to fixing up git-mv and git-rm as
suggested by Junio in that thread; but at least I've finally gotten
the merge machinery side written...

  reply	other threads:[~2020-10-23 17:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 16:01 [PATCH 0/9] Support both merge backends in the testsuite, via environment variable Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 1/9] t/: new helper for tests that pass with ort but fail with recursive Elijah Newren via GitGitGadget
2020-10-23 16:48   ` Junio C Hamano
2020-10-23 17:25     ` Elijah Newren
2020-10-23 18:27       ` Elijah Newren
2020-10-24 10:49   ` Đoàn Trần Công Danh
2020-10-24 16:53     ` Elijah Newren
2020-10-25 13:49       ` Đoàn Trần Công Danh
2020-10-26 14:56         ` Elijah Newren
2020-10-26 17:43           ` Junio C Hamano
2020-10-23 16:01 ` [PATCH 2/9] merge tests: expect improved directory/file conflict handling in ort Elijah Newren via GitGitGadget
2020-10-23 17:40   ` Elijah Newren [this message]
2020-10-23 16:01 ` [PATCH 3/9] t6416: correct expectation for rename/rename(1to2) + directory/file Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 4/9] t6404, t6423: expect improved rename/delete handling in ort backend Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 5/9] t6423: expect improved conflict markers labels in the " Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 6/9] merge tests: expect slight differences in output for recursive vs. ort Elijah Newren via GitGitGadget
2020-10-24 16:06   ` Elijah Newren
2020-10-23 16:01 ` [PATCH 7/9] t6423, t6436: note improved ort handling with dirty files Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 8/9] t6423: note improved ort handling with untracked files Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 9/9] t6423: add more details about direct resolution of directories Elijah Newren via GitGitGadget
2020-10-23 20:12   ` Elijah Newren
2020-10-26 17:01 ` [PATCH v2 0/9] Support both merge backends in the testsuite, via environment variable Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 1/9] t/: new helper for tests that pass with ort but fail with recursive Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 2/9] merge tests: expect improved directory/file conflict handling in ort Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 3/9] t6416: correct expectation for rename/rename(1to2) + directory/file Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 4/9] t6404, t6423: expect improved rename/delete handling in ort backend Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 5/9] t6423: expect improved conflict markers labels in the " Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 6/9] merge tests: expect slight differences in output for recursive vs. ort Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 7/9] t6423, t6436: note improved ort handling with dirty files Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 8/9] t6423: note improved ort handling with untracked files Elijah Newren via GitGitGadget
2020-10-26 17:01   ` [PATCH v2 9/9] t6423: add more details about direct resolution of directories Elijah Newren via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BEhjecB7_juP3cSuF7MUHKbPXqAxKgKstPZw2ezHXputw@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --subject='Re: [PATCH 2/9] merge tests: expect improved directory/file conflict handling in ort' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).