do_for_each_reflog(): use a strbuf to hold logfile name
[gitweb.git] / git-rebase--interactive.sh
index 863597c6190bc4bd3f753676595861e80d7cd39b..2e1325824c5d1457a3a29fbf2b80661c05f035e6 100644 (file)
@@ -176,6 +176,19 @@ do_with_author () {
        )
 }
 
+git_sequence_editor () {
+       if test -z "$GIT_SEQUENCE_EDITOR"
+       then
+               GIT_SEQUENCE_EDITOR="$(git config sequence.editor)"
+               if [ -z "$GIT_SEQUENCE_EDITOR" ]
+               then
+                       GIT_SEQUENCE_EDITOR="$(git var GIT_EDITOR)" || return $?
+               fi
+       fi
+
+       eval "$GIT_SEQUENCE_EDITOR" '"$@"'
+}
+
 pick_one () {
        ff=--ff
        case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac
@@ -659,7 +672,7 @@ rearrange_squash () {
 case "$action" in
 continue)
        # do we have anything to commit?
-       if git diff-index --cached --quiet --ignore-submodules HEAD --
+       if git diff-index --cached --quiet HEAD --
        then
                : Nothing to commit -- skip this
        else
@@ -833,6 +846,8 @@ cat >> "$todo" << EOF
 #  f, fixup = like "squash", but discard this commit's log message
 #  x, exec = run command (the rest of the line) using shell
 #
+# These lines can be re-ordered; they are executed from top to bottom.
+#
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
 #
@@ -842,7 +857,7 @@ has_action "$todo" ||
        die_abort "Nothing to do"
 
 cp "$todo" "$todo".backup
-git_editor "$todo" ||
+git_sequence_editor "$todo" ||
        die_abort "Could not execute editor"
 
 has_action "$todo" ||