From: Andrew Wong <andrew.w@sohovfx.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
Andrew Wong <andrew.kw.w@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Jay Soffian <jaysoffian@gmail.com>
Subject: Re: [PATCH] rebase -i: remove CHERRY_PICK_HEAD when cherry-pick failed
Date: Tue, 03 Apr 2012 17:01:00 -0400 [thread overview]
Message-ID: <4F7B650C.9060800@sohovfx.com> (raw)
In-Reply-To: <20120403144505.GE15589@burratino>
On 04/03/2012 10:45 AM, Jonathan Nieder wrote:
> Ok. Now the user (sensibly) ignores the message from cherry-pick and
> just runs "git rebase --continue". The rebase finishes but nobody
> feels it's his responsibility to remove the .git/CHERRY_PICK_HEAD file
> and it gets left behind.
>
Yes, that's exactly what's happening. That particular rebase will leave
behind CHERRY_PICK_HEAD, which have bad consequences such as:
1. Confuses __git_ps1 (from git-completion.bash) into thinking a
cherry-pick is still in progress. (which is what started this discussion)
2. Cause "cherry-pick --continue" to think a cherry-pick is still in
progress.
3. Similarly, if a user then continue on to modifying their files, and
do a "add" and "commit", "commit" would reuse the message from the
CHERRY_PICK_HEAD.
> I suspect a more appropriate long-term fix would involve "git
> cherry-pick" noticing when a patch has resolved to nothing instead of
> leaving it to "git commit" to detect that.
>
I actually tried implementing a fix like that too. But then I thought
there might be other scenarios where "commit" could fail, and it doesn't
seem to make sense for "cherry-pick" to have to detect all possible
"commit" failures. Though it also feels like the question of whether or
not "cherry-pick" should detects the "empty commit" is a separate issue
altogether.
Besides the "empty commit" failure, "cherry-pick" can still run into
various errors, such as merge conflict. So it will have to keep a state
somehow. And instead of having "cherry-pick" make special cases for
"rebase -i" to remove the state, it makes more sense to teach "rebase
-i" that "cherry-pick" now keeps a state on failure. So if "cherry-pick"
fails, "rebase -i" is responsible for clearing that state. And that's
what this patch is supposed to do.
Perhaps I should rephrase my description to reflect this better?
Something along the line of: "cherry-pick" now keeps a state on failure.
Instead of having a special case inside the sequencer to remove the
state, we teach "rebase -i" that we need to clear the state.
next prev parent reply other threads:[~2012-04-03 21:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 22:56 Rebase regression in v1.7.9? Felipe Contreras
2012-02-01 17:27 ` Andrew Wong
2012-02-01 19:30 ` Felipe Contreras
2012-03-18 21:37 ` [PATCH] rebase -i: remove CHERRY_PICK_HEAD when cherry-pick failed Andrew Wong
2012-03-19 16:51 ` Junio C Hamano
2012-03-19 21:00 ` Andrew Wong
2012-03-24 20:03 ` Andrew Wong
2012-04-02 22:38 ` Andrew Wong
2012-04-02 23:08 ` Junio C Hamano
2012-04-03 5:15 ` Junio C Hamano
2012-04-03 6:32 ` Ramkumar Ramachandra
2012-04-03 14:45 ` Jonathan Nieder
2012-04-03 21:01 ` Andrew Wong [this message]
2012-04-03 21:08 ` Jonathan Nieder
2012-04-03 21:12 ` Jonathan Nieder
2012-04-03 21:22 ` Andrew Wong
2012-04-03 21:26 ` Jonathan Nieder
2012-04-03 23:11 ` Andrew Wong
2012-04-04 18:11 ` Jonathan Nieder
2012-04-04 19:23 ` Andrew Wong
2012-04-04 20:16 ` Jonathan Nieder
2012-04-04 20:20 ` Jonathan Nieder
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F7B650C.9060800@sohovfx.com \
--to=andrew.w@sohovfx.com \
--cc=andrew.kw.w@gmail.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaysoffian@gmail.com \
--cc=jrnieder@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).