summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 073dab1)
raw | patch | inline | side by side (parent: 073dab1)
author | Linus Torvalds <torvalds@osdl.org> | |
Wed, 23 Nov 2005 17:57:54 +0000 (09:57 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 24 Nov 2005 00:52:52 +0000 (16:52 -0800) |
I think all commit operations should allow editing of the message (ie we
should do this for merges too), but that's _particularly_ true of doing a
"git revert".
We should always explain why we needed to revert something.
This patch adds a "-e" or "--edit" flag to "git revert", although I
actually suspect it should be on by default (and we should have a
"--no-edit" flag to disable it, probably together with an automatic
disable if stdin isn't a terminal).
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
should do this for merges too), but that's _particularly_ true of doing a
"git revert".
We should always explain why we needed to revert something.
This patch adds a "-e" or "--edit" flag to "git revert", although I
actually suspect it should be on by default (and we should have a
"--no-edit" flag to disable it, probably together with an automatic
disable if stdin isn't a terminal).
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-revert.sh | patch | blob | history |
diff --git a/git-revert.sh b/git-revert.sh
index 4154fe0d15456697185115c70ac6df59eabd2869..05bd854f4b316a34020cd3a600be0518313f9319 100755 (executable)
--- a/git-revert.sh
+++ b/git-revert.sh
esac
}
-no_commit= replay=
+no_commit= replay= edit=
while case "$#" in 0) break ;; esac
do
case "$1" in
-r|--r|--re|--rep|--repl|--repla|--replay)
replay=t
;;
+ -e|--edit)
+ edit=t
+ ;;
-*)
usage
;;
# If we are revert, or if our cherry-pick results in a hand merge,
# we had better say that the current user is responsible for that.
+[ "$edit" ] && ${EDITOR:-${VISUAL:-vi}} .msg
case "$no_commit" in
'')
git-commit -n -F .msg