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

Re: [PATCH 1/2] sequencer: clear CHERRY_PICK_HEAD upon dropping a become-empty commit

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Mar 11, 2020, 10:30 UTC
Message-ID
<94eec36b-581a-17eb-7aeb-2d24c90b8e73@gmail.com>
In-Reply-To
<132f769adb0a34e74b6c237ff84bf8b624ea0d9f.1583903621.git.gitgitgadget@gmail.com>
Hi Elijah
On 11/03/2020 05:13, Elijah Newren via GitGitGadget wrote:
Show 13 quoted lines
> From: Elijah Newren <newren@gmail.com>
> 
> In commit e98c4269c8 ("rebase (interactive-backend): fix handling of
> commits that become empty", 2020-02-15), the merge backend was changed
> to drop commits that did not start empty but became so after being
> applied (because their changes were a subset of what was already
> 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.
Thanks for fixing this, it needs to clean up MERGE_MSG as well though
Best Wishes
Phillip
Show 18 quoted lines
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
>   sequencer.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/sequencer.c b/sequencer.c
> index 7477b15422a..8b4e0200c5f 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -1957,6 +1957,7 @@ static int do_pick_commit(struct repository *r,
>   		flags |= ALLOW_EMPTY;
>   	} else if (allow == 2) {
>   		drop_commit = 1;
> +		unlink(git_path_cherry_pick_head(r));
>   		fprintf(stderr,
>   			_("dropping %s %s -- patch contents already upstream\n"),
>   			oid_to_hex(&commit->object.oid), msg.subject);
> 
Previous: Elijah Newren via GitGitGadgetNext: Junio C Hamano
Message 3 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.