git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>
Subject: Re: [PATCH 2/2] Teach commit about CHERRY_PICK_HEAD
Date: Wed, 16 Feb 2011 13:07:00 -0800	[thread overview]
Message-ID: <7vpqqrit8r.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1297850903-65038-3-git-send-email-jaysoffian@gmail.com> (Jay Soffian's message of "Wed\, 16 Feb 2011 05\:08\:23 -0500")

Jay Soffian <jaysoffian@gmail.com> writes:

> If the user wishes to reset authorship, that must now be done explicitly
> via --reset-author.

This is not a new requirement, is it?  Even "commit -c $that_commit"
before the previous "commit -c CHERRY_PICK_HEAD" does use the original,
no?


I think the changed code is _MUCH_ easier to follow compared to the
previous round; the only thing the reader needs to keep in mind is that
the most of the change essentially is "s/in_merge/whence != FROM_COMMIT/"
and making that work.

> * We remove a unused import from revert.c

Micronit: s/import/include/.


> @@ -766,7 +802,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
>  
>  	fclose(fp);
>  
> -	if (!commitable && !in_merge && !allow_empty &&
> +	if (!commitable && whence != FROM_MERGE && !allow_empty &&
>  	    !(amend && is_a_merge(head_sha1))) {
>  		run_status(stdout, index_file, prefix, 0, s);
>  		if (amend)

The original says that we reject an attempt to record a no-change commit
when the user is making his own commit without an explicit --allow-empty
request.  Should cherry-pick change this?

"git cherry-pick $a_no_change_commit" does not cause conflicts but it does
fail with "nothing added to commit".  If you said "whence == FROM_COMMIT"
here, you would end up allowing "git commit" following such a failure to
commit without --allow-empty, and that inconsistency is to be avoided
(note that I didn't check if you leave CHERRY_PICK_HEAD behind to trigger
this codepath when this happens).

On the other hand, when the earlier cherry-pick did fail with conflict,
but the resolution ended up to be a no-change commit, you would not
blindly want to record the result as a no-change commit, either.

So I think the above is the right thing to do, but we probably need a bit
of in-code comment to describe why we say "whence != FROM_MERGE" here.

Thanks.

  reply	other threads:[~2011-02-16 21:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 10:08 [PATCH 0/2] CHERRY_PICK_HEAD Jay Soffian
2011-02-16 10:08 ` [PATCH 1/2] Introduce CHERRY_PICK_HEAD Jay Soffian
2011-02-16 11:13   ` Nguyen Thai Ngoc Duy
2011-02-16 16:50     ` Jay Soffian
2011-02-16 17:20   ` [PATCH v2] " Jay Soffian
2011-02-16 17:25     ` Jay Soffian
2011-02-16 21:42     ` Jonathan Nieder
2011-02-16 22:13       ` Jay Soffian
2011-02-16 23:02         ` Jonathan Nieder
2011-02-17 19:58           ` Junio C Hamano
2011-02-17 22:16             ` Jonathan Nieder
2011-02-16 10:08 ` [PATCH 2/2] Teach commit about CHERRY_PICK_HEAD Jay Soffian
2011-02-16 21:07   ` Junio C Hamano [this message]
2011-02-16 21:33     ` Jay Soffian
2011-02-16 21:55   ` [PATCH 1.5/2] bash: teach __git_ps1 " Jonathan Nieder
2011-02-16 22:49     ` Junio C Hamano
2011-02-16 22:43   ` [PATCH 2/2] Teach commit " Jonathan Nieder
2011-02-17  0:05     ` Jay Soffian

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=7vpqqrit8r.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --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).