diff options
author | Elijah Newren <newren@gmail.com> | 2021-03-20 00:03:52 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-20 12:35:40 -0700 |
commit | 5291828df8386ebeb01039d1403d9f845d2f6e20 (patch) | |
tree | f985782d6c7b88a7e64c73ebbf1d5383fd41a30d /builtin/rebase.c | |
parent | t: mark several submodule merging tests as fixed under merge-ort (diff) | |
download | tgif-5291828df8386ebeb01039d1403d9f845d2f6e20.tar.xz |
merge-ort: write $GIT_DIR/AUTO_MERGE whenever we hit a conflict
There are a variety of questions users might ask while resolving
conflicts:
* What changes have been made since the previous (first) parent?
* What changes are staged?
* What is still unstaged? (or what is still conflicted?)
* What changes did I make to resolve conflicts so far?
The first three of these have simple answers:
* git diff HEAD
* git diff --cached
* git diff
There was no way to answer the final question previously. Adding one
is trivial in merge-ort, since it works by creating a tree representing
what should be written to the working copy complete with conflict
markers. Simply write that tree to .git/AUTO_MERGE, allowing users to
answer the fourth question with
* git diff AUTO_MERGE
I avoided using a name like "MERGE_AUTO", because that would be
merge-specific (much like MERGE_HEAD, REBASE_HEAD, REVERT_HEAD,
CHERRY_PICK_HEAD) and I wanted a name that didn't change depending on
which type of operation the merge was part of.
Ensure that paths which clean out other temporary operation-specific
files (e.g. CHERRY_PICK_HEAD, MERGE_MSG, rebase-merge/ state directory)
also clean out this AUTO_MERGE file.
Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r-- | builtin/rebase.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index 840dbd7eb7..6c252d6275 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -737,6 +737,7 @@ static int finish_rebase(struct rebase_options *opts) int ret = 0; delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF); + unlink(git_path_auto_merge(the_repository)); apply_autostash(state_dir_path("autostash", opts)); close_object_store(the_repository->objects); /* |