@@ -8,11 +8,11 @@ h,help Show the help
8
8
9
9
a,all Update all branches from which the commit is reachable
10
10
v,verbose Increase logging verbosity
11
- F,message-file= get message from file instead of stdin
11
+ F,message-file= Get commit message from file
12
+ s,stdin Get commit message from stdin
12
13
"
13
14
14
15
all_branches=0
15
- message_file=
16
16
17
17
eval " $( git rev-parse --parseopt -- " $@ " <<< $OPTS_SPEC || echo exit $? ) "
18
18
@@ -30,6 +30,10 @@ while (( $# > 0 )); do
30
30
shift 2
31
31
;;
32
32
33
+ (-s) message_file=
34
+ shift
35
+ ;;
36
+
33
37
(--) shift
34
38
break
35
39
;;
@@ -69,6 +73,12 @@ for branch in "${branch_list[@]}"; do
69
73
DIE " history contains one or more merge commits"
70
74
done
71
75
76
+ if [[ -z ${message_file+UNSET} ]]; then
77
+ message_file=" $( git rev-parse --git-dir) /COMMIT_EDITMSG"
78
+ git cat-file -p $oldref | sed ' 1,/^$/d' > $message_file
79
+ ${VISUAL:- ${EDITOR:- vi} } $message_file || DIE " failed to edit message"
80
+ fi
81
+
72
82
# generate a replacement commit object, reading the new commit message
73
83
# from stdin.
74
84
newref=$(
0 commit comments