From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH] cherry-pick: Bug fix 'cherry picked from' message.
Date: Tue, 6 Mar 2007 00:46:00 -0500 [thread overview]
Message-ID: <20070306054600.GA24206@spearce.org> (raw)
Somewhere along the line (in abd6970a) git-revert.sh learned to
omit the private object name from the new commit message *unless*
-x was supplied on the command line by the user.
The way this was implemented is really non-obvious in the original
script. Setting replay=t (the default) means we don't include the
the private object name, while setting reply='' (the -x flag) means
we should include the private object name. These two settings now
relate to the replay=1 and replay=0 cases in the C version, so we
need to negate replay to test it is 0.
I also noticed the C version was adding an extra LF in the -x case,
where the older git-revert.sh was not.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
builtin-revert.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-revert.c b/builtin-revert.c
index 382fe0c..2f2dc1b 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -303,8 +303,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
next = commit;
set_author_ident_env(message);
add_message_to_msg(message);
- if (replay) {
- add_to_msg("\n(cherry picked from commit ");
+ if (!replay) {
+ add_to_msg("(cherry picked from commit ");
add_to_msg(sha1_to_hex(commit->object.sha1));
add_to_msg(")\n");
}
--
1.5.0.3.863.gf0989
next reply other threads:[~2007-03-06 5:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 5:46 Shawn O. Pearce [this message]
2007-03-06 6:53 ` [PATCH] cherry-pick: Bug fix 'cherry picked from' message Junio C Hamano
2007-03-06 11:03 ` Johannes Schindelin
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=20070306054600.GA24206@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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