From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Andrew Wong <andrew.kw.w@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Andrew Wong <andrew.w-lists@sohovfx.com>,
Andrew Wong <andrew.w@sohovfx.com>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH] rebase -i: remove CHERRY_PICK_HEAD when cherry-pick failed
Date: Tue, 3 Apr 2012 12:02:29 +0530 [thread overview]
Message-ID: <CALkWK0nmNWaOKcyGH2N0s3B1AFD-+3vHz1BBc3U=RMEFLNuc7A@mail.gmail.com> (raw)
In-Reply-To: <1332106632-31882-1-git-send-email-andrew.kw.w@gmail.com>
Hi Andrew,
[+CC: Jonathan Nieder]
Andrew Wong wrote:
> Instead of having the sequencer catch errors and remove CHERRY_PICK_HEAD
> for its caller's sake, let its caller do the work. This way, the
> sequencer doesn't have to check all points of failures where its caller
> doesn't want CHERRY_PICK_HEAD.
This part makes sense.
> For example, the sequencer current doesn't clean up CHERRY_PICK_HEAD if
> 'commit' failed due to an empty commit. Letting 'rebase -i' deal with
> removing CHERRY_PICK_HEAD keeps the sequencer's logic a bit cleaner.
Yes, that's because git-commit is spawned. The sequencer has no way
to tell if the commit was actually successful. Incidentally, what is
your motivation for this patch? Did the "rebase -i" or the sequencer
misbehave in some scenario? Wouldn't it make sense to add a failing
test for that scenario first?
Also, note that in a previous iteration, we considered the possibility
of making git-commit remove CHERRY_PICK_HEAD, but decided that it
would be ugly subsequently.
> A possible condition would be checking the env var GIT_CHERRY_PICK_HELP,
> which is only set if 'cherry-pick' is called under 'rebase -i'. I never
> liked how we're passing in a help message using an env var, so I don't
> feel like introducing another dependency on this env var is a good idea.
True; this is ugly. It detracts us from the purpose of the patch
which is to shift the responsibility of cleaning up CHERRY_PICK_HEAD
to the caller.
> Another possible condition would be to add another flag to
> "cherry-pick". But a proper implementation would not only involve adding
> code to parse the flag in 'cherry-pick', but also adding code to
> save/restore the option in sequencer, even though 'rebase -i' only need
> it for single_pick. It's not that adding these codes are difficult, but
> it seems like we're adding a lot of code just to add a behavior that
> only 'rebase -i' needs.
Another ugly solution.
> Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
> [...]
Bonus: After this patch, the sequencer code is symmetric in
CHERY_PICK_HEAD and REVERT_HEAD. How do we convince ourselves that
we're not breaking some corner case though? I'd be more comfortable
with the patch if you can present a failing test first.
Thanks.
Ram
next prev parent reply other threads:[~2012-04-03 6:32 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 [this message]
2012-04-03 14:45 ` Jonathan Nieder
2012-04-03 21:01 ` Andrew Wong
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='CALkWK0nmNWaOKcyGH2N0s3B1AFD-+3vHz1BBc3U=RMEFLNuc7A@mail.gmail.com' \
--to=artagnon@gmail.com \
--cc=andrew.kw.w@gmail.com \
--cc=andrew.w-lists@sohovfx.com \
--cc=andrew.w@sohovfx.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).