summaryrefslogtreecommitdiff
path: root/git-revert.sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-11-23 17:57:54 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-24 00:52:52 (GMT)
commit30c7bb249e9b2038dd05271e055d347f84336576 (patch)
tree9ae87b6e4db2e88f7ac84203d117cb97905e0b92 /git-revert.sh
parent073dab137a746a44606e8e11629e05ff8343346f (diff)
downloadgit-30c7bb249e9b2038dd05271e055d347f84336576.zip
git-30c7bb249e9b2038dd05271e055d347f84336576.tar.gz
git-30c7bb249e9b2038dd05271e055d347f84336576.tar.bz2
Allow editing of a revert-message
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>
Diffstat (limited to 'git-revert.sh')
-rwxr-xr-xgit-revert.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-revert.sh b/git-revert.sh
index 4154fe0..05bd854 100755
--- a/git-revert.sh
+++ b/git-revert.sh
@@ -25,7 +25,7 @@ usage () {
esac
}
-no_commit= replay=
+no_commit= replay= edit=
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -36,6 +36,9 @@ do
-r|--r|--re|--rep|--repl|--repla|--replay)
replay=t
;;
+ -e|--edit)
+ edit=t
+ ;;
-*)
usage
;;
@@ -161,6 +164,7 @@ echo >&2 "Finished one $me."
# 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