rebase -i: move help to end of todo file
[PATCH] rebase -i: move help to end of todo file Many editors start in the first line, so the 9-line help text was an annoyance. So move it to the end. Requested by Junio. While at it, add a hint how to abort the rebase. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 22, 2007 at 12:30 UTC
6047a234c5a6aef58c72a35feba326484f07660d
2 files changed
+10
-7
git-rebase--interactive.sh
+8
-6
@@ -485,8 +485,13 @@ do
485
SHORTUPSTREAM=$(git rev-parse --short $UPSTREAM)
486
SHORTHEAD=$(git rev-parse --short $HEAD)
487
SHORTONTO=$(git rev-parse --short $ONTO)
488
- cat > "$TODO" << EOF
489
-# Rebasing $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO
488
+ git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
489
+ --abbrev=7 --reverse --left-right --cherry-pick \
490
+ $UPSTREAM...$HEAD | \
491
+ sed -n "s/^>/pick /p" > "$TODO"
492
+ cat >> "$TODO" << EOF
493
+
494
+# Rebase $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO
495
#
496
# Commands:
497
# pick = use commit
@@ -494,12 +499,9 @@ do
499
# squash = use commit, but meld into previous commit
500
#
501
# If you remove a line here THAT COMMIT WILL BE LOST.
502
+# However, if you remove everything, the rebase will be aborted.
503
#
504
EOF
499
- git rev-list $MERGES_OPTION --pretty=oneline --abbrev-commit \
500
- --abbrev=7 --reverse --left-right --cherry-pick \
501
- $UPSTREAM...$HEAD | \
502
- sed -n "s/^>/pick /p" >> "$TODO"
505
506
has_action "$TODO" ||
507
die_abort "Nothing to do"
t/t3404-rebase-interactive.sh
+2
-1
@@ -149,7 +149,8 @@ test_expect_success 'stop on conflicting pick' '
149
diff -u expect .git/.dotest-merge/patch &&
150
diff -u expect2 file1 &&
151
test 4 = $(grep -v "^#" < .git/.dotest-merge/done | wc -l) &&
152
- test 0 = $(grep -v "^#" < .git/.dotest-merge/git-rebase-todo | wc -l)
152
+ test 0 = $(grep -ve "^#" -e "^$" < .git/.dotest-merge/git-rebase-todo |
153
+ wc -l)
154
'
155
156
test_expect_success 'abort' '