Teach rebase an interactive mode
[gitweb.git] / git-rebase.sh
index 61770b5a2837b9d69ffb1db455f39ffdb3c8ea00..388752661fd5439633f9d2c140d058a8772382ee 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Junio C Hamano.
 #
 
-USAGE='[-v] [--onto <newbase>] <upstream> [<branch>]'
+USAGE='[--interactive | -i] [-v] [--onto <newbase>] <upstream> [<branch>]'
 LONG_USAGE='git-rebase replaces <branch> with a new branch of the
 same name.  When the --onto option is provided the new branch starts
 out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
@@ -55,7 +55,7 @@ continue_merge () {
        if test -n "$unmerged"
        then
                echo "You still have unmerged paths in your index"
-               echo "did you forget update-index?"
+               echo "did you forget to use git add?"
                die "$RESOLVEMSG"
        fi
 
@@ -120,13 +120,23 @@ finish_rb_merge () {
        echo "All done."
 }
 
+is_interactive () {
+       test -f "$dotest"/interactive ||
+       while case $#,"$1" in 0,|*,-i|*,--interactive) break ;; esac
+       do
+               shift
+       done && test -n "$1"
+}
+
+is_interactive "$@" && exec git-rebase--interactive "$@"
+
 while case "$#" in 0) break ;; esac
 do
        case "$1" in
        --continue)
                git-diff-files --quiet || {
                        echo "You must edit all merge conflicts and then"
-                       echo "mark them as resolved using git update-index"
+                       echo "mark them as resolved using git add"
                        exit 1
                }
                if test -d "$dotest"