summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f52463a)
raw | patch | inline | side by side (parent: f52463a)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 6 Mar 2007 05:46:00 +0000 (00:46 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 6 Mar 2007 05:55:31 +0000 (21:55 -0800) |
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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>
builtin-revert.c | patch | blob | history |
diff --git a/builtin-revert.c b/builtin-revert.c
index 382fe0c6a14e01664aefae846d7a7b51beead7fd..2f2dc1bbaa564d07d38565d4a289157138c5c8b0 100644 (file)
--- a/builtin-revert.c
+++ b/builtin-revert.c
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");
}