git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Andrew Wong <andrew.w@sohovfx.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: Wed, 4 Apr 2012 15:16:10 -0500	[thread overview]
Message-ID: <20120404201610.GB17544@burratino> (raw)
In-Reply-To: <4F7C9FAE.5050806@sohovfx.com>

Andrew Wong wrote:

>                            Since there could be other scenarios where
> "commit" could fail

As far as I can tell, there just aren't any such other scenarios,
unless you mean like running out of memory or disk space.  "git
cherry-pick" disables hooks when running "git commit" so the
pre-commit hook can't block the commit.

So the scenarios fall into three or so categories.

 - when "git cherry-pick" performs a merge and encounters conflicts,
   it prints a message and exits, writing CHERRY_PICK_HEAD to tell
   the operator what command to use (instead of "git commit" or
   "git cherry-pick --continue") when the problem is resolved.

   If my script sets GIT_CHERRY_PICK_HELP, it will print a different
   message and does not write CHERRY_PICK_HEAD because the operator
   is going to run "myscript --resume" and not "git commit" or "git
   cherry-pick --continue" when the problem is resolved.

 - when "git cherry-pick" performs a clean merge that produces no
   change, "git commit" prints a message about a missing --allow-empty
   argument and exits.

   My GIT_CHERRY_PICK_HELP setting is not respected, so the user is
   likely to run "git commit" or "git cherry-pick --continue" instead
   of the command I wanted.

 - when "git cherry-pick" performs a clean merge that produces a
   change but "git commit" fails to record it due to a stray signal or
   running out of disk space, git does not print any advice for the
   operator.

   In particular, my GIT_CHERRY_PICK_HELP setting is not respected.
   Also, CHERRY_PICK_HEAD is written even though my wrapper script
   that sets GIT_CHERRY_PICK_HELP didn't expect that.

   The operator can return to a familar state with "git reset --hard"
   followed by "git checkout" of some familiar branch, except that my
   script may be keeping some state of its own that lingers until the
   operator tries to use it again...

I was focusing on the second category.  Using a stock message instead
of the custom message from GIT_CHERRY_PICK_HELP certainly seems to me
like a bug or incomplete feature.

When you say that there are other ways for "git commit" to fail and
Junio says that in some cases "git cherry-pick" should not write
CHERRY_PICK_HEAD at all, you are probably thinking of the third
category.

Hope that helps,
Jonathan

  reply	other threads:[~2012-04-04 20:16 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120404201610.GB17544@burratino \
    --to=jrnieder@gmail.com \
    --cc=andrew.kw.w@gmail.com \
    --cc=andrew.w@sohovfx.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jaysoffian@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.
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 NNTP newsgroup(s).