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

[PATCH v2 0/2] Fix 2.26.0 rebase regression and documentation shortcoming

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 11, 2020, 15:30 UTC
Message-ID
<pull.722.v2.git.git.1583940623.gitgitgadget@gmail.com>
In-Reply-To
<pull.722.git.git.1583903621.gitgitgadget@gmail.com>

This two commit series addresses two points raised by Peff about rebase backend issues. The first is a two-line fix to a regression in 2.26.0 (when "the eighth batch for 2.26.0" added the dropping of commits which become empty, if the last commit in the series was the one that became empty the rebase would complete without cleaning out state files), and the other is just a documentation update about a backend difference that we were previously unaware of.

Changes since v1:
 * Clean out any MERGE_MSG file in addition to CHERRY_PICK_HEAD, and add a
   test
Elijah Newren (2):
  sequencer: clear state upon dropping a become-empty commit
  git-rebase.txt: highlight backend differences with commit rewording
 Documentation/git-rebase.txt | 10 ++++++++++
 sequencer.c                  |  2 ++
 t/t3424-rebase-empty.sh      |  8 ++++++++
 3 files changed, 20 insertions(+)
base-commit: b4374e96c84ed9394fed363973eb540da308ed4f
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-722%2Fnewren%2Frebase-fixups-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-722/newren/rebase-fixups-v2
Pull-Request: https://github.com/git/git/pull/722
Range-diff vs v1:
 1:  132f769adb0 ! 1:  84b89d78435 sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commit
     @@ -1,6 +1,6 @@
      Author: Elijah Newren <newren@gmail.com>
      
     -    sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commit
     +    sequencer: clear state upon dropping a become-empty commit
      
          In commit e98c4269c8 ("rebase (interactive-backend): fix handling of
          commits that become empty", 2020-02-15), the merge backend was changed
     @@ -9,10 +9,10 @@
          upstream).  This new code path did not need to go through the process of
          creating a commit, since we were dropping the commit instead.
          Unfortunately, this also means we bypassed the clearing of the
     -    CHERRY_PICK_HEAD file, which if there were no further commits to
     -    cherry-pick would mean that the rebase would end but assume there was
     -    still an operation in progress.  Ensure that we clear CHERRY_PICK_HEAD
     -    when we decide to drop the commit.
     +    CHERRY_PICK_HEAD and MERGE_MSG files, which if there were no further
     +    commits to cherry-pick would mean that the rebase would end but assume
     +    there was still an operation in progress.  Ensure that we clear such
     +    state files when we decide to drop the commit.
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
      
     @@ -24,6 +24,24 @@
       	} else if (allow == 2) {
       		drop_commit = 1;
      +		unlink(git_path_cherry_pick_head(r));
     ++		unlink(git_path_merge_msg(r));
       		fprintf(stderr,
       			_("dropping %s %s -- patch contents already upstream\n"),
       			oid_to_hex(&commit->object.oid), msg.subject);
     +
     + diff --git a/t/t3424-rebase-empty.sh b/t/t3424-rebase-empty.sh
     + --- a/t/t3424-rebase-empty.sh
     + +++ b/t/t3424-rebase-empty.sh
     +@@
     + 	test_cmp expect actual
     + '
     + 
     ++test_expect_success 'rebase --merge does not leave state laying around' '
     ++	git checkout -B testing localmods~2 &&
     ++	git rebase --merge upstream &&
     ++
     ++	test_path_is_missing .git/CHERRY_PICK_HEAD &&
     ++	test_path_is_missing .git/MERGE_MSG
     ++'
     ++
     + test_done
 2:  12932b847ef = 2:  6d51cff41d9 git-rebase.txt: highlight backend differences with commit rewording
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren via GitGitGadget
Message 8 of 15 in “Fix 2.26.0 rebase regression and documentation shortcoming”
  1. 0/2 Fix 2.26.0 rebase regression and documentation shortcomingElijah Newren via GitGitGadget, Mar 11, 2020
  2. 1/2 sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commitElijah Newren via GitGitGadget, Mar 11, 2020
  3. Phillip WoodMar 11, 2020
  4. Junio C HamanoMar 11, 2020
  5. Jeff KingMar 11, 2020
  6. Junio C HamanoMar 11, 2020
  7. 2/2 git-rebase.txt: highlight backend differences with commit rewordingElijah Newren via GitGitGadget, Mar 11, 2020
  8. 0/2 Fix 2.26.0 rebase regression and documentation shortcomingElijah Newren via GitGitGadget, Mar 11, 2020
  9. 1/2 sequencer: clear state upon dropping a become-empty commitElijah Newren via GitGitGadget, Mar 11, 2020
  10. Jeff KingMar 11, 2020
  11. Elijah NewrenMar 11, 2020
  12. Jeff KingMar 11, 2020
  13. 2/2 git-rebase.txt: highlight backend differences with commit rewordingElijah Newren via GitGitGadget, Mar 11, 2020
  14. Jeff KingMar 11, 2020
  15. Junio C HamanoMar 11, 2020

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.