summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad562a8)
raw | patch | inline | side by side (parent: ad562a8)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Mon, 25 Jun 2007 17:56:55 +0000 (18:56 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Jun 2007 01:58:45 +0000 (18:58 -0700) |
Support "--verbose" in addition to "-v", show short names in the list
comment, clean up if there is nothing to do, and add several "test_ticks"
in the test script.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
comment, clean up if there is nothing to do, and add several "test_ticks"
in the test script.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--interactive.sh | patch | blob | history | |
t/t3404-rebase-interactive.sh | patch | blob | history |
index ab3657250e9ffc6f090e9de989d89df7be22fa4a..a81432c0a5b9e5caca47d58665b47c75accacc74 100755 (executable)
die "$2"
}
+die_abort () {
+ rm -rf "$DOTEST"
+ die "$1"
+}
+
pick_one () {
case "$1" in -n) sha1=$2 ;; *) sha1=$1 ;; esac
git rev-parse --verify $sha1 || die "Invalid commit name: $sha1"
-C*)
die "Interactive rebase uses merge, so $1 does not make sense"
;;
- -v)
+ -v|--verbose)
VERBOSE=t
;;
-i|--interactive)
echo $ONTO > "$DOTEST"/onto
test t = "$VERBOSE" && : > "$DOTEST"/verbose
+ SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
+ SHORTHEAD=$(git rev-parse --short $HEAD)
+ SHORTONTO=$(git rev-parse --short $ONTO)
cat > "$TODO" << EOF
-# Rebasing $UPSTREAM..$HEAD onto $ONTO
+# Rebasing $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO
#
# Commands:
# pick = use commit
sed "s/^/pick /" >> "$TODO"
test -z "$(grep -ve '^$' -e '^#' < $TODO)" &&
- die "Nothing to do"
+ die_abort "Nothing to do"
cp "$TODO" "$TODO".backup
${VISUAL:-${EDITOR:-vi}} "$TODO" ||
die "Could not execute editor"
- git reset --hard $ONTO && do_rest
+ test -z "$(grep -ve '^$' -e '^#' < $TODO)" &&
+ die_abort "Nothing to do"
+
+ git checkout $ONTO && do_rest
esac
shift
done
index 48aa8ea814001afd06d4d80b15dad15cb9e17aca..19a3a8e813785fbb1a6cfc522bff212ec3a9e6fc 100755 (executable)
test_expect_success 'retain authorship' '
echo A > file7 &&
git add file7 &&
+ test_tick &&
GIT_AUTHOR_NAME="Twerp Snog" git commit -m "different author" &&
git tag twerp &&
git rebase -i --onto master HEAD^ &&
test_expect_success 'squash' '
git reset --hard twerp &&
echo B > file7 &&
+ test_tick &&
GIT_AUTHOR_NAME="Nitfol" git commit -m "nitfol" file7 &&
echo "******************************" &&
FAKE_LINES="1 squash 2" git rebase -i --onto master HEAD~2 &&