Skip to content

Commit

Permalink
cherry-pick: Bug fix 'cherry picked from' message.
Browse files Browse the repository at this point in the history
Somewhere along the line (in abd6970) 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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Mar 6, 2007
1 parent f52463a commit 0e62404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 0e62404

Please sign in to comment.