summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorOnno Kortmann <onno@gmx.net>2014-12-10 19:16:44 +0100
committerJunio C Hamano <gitster@pobox.com>2014-12-10 13:17:38 -0800
commit97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce (patch)
treeedd98942e886a8d4c4a5be445cd9560f09a25d90 /git-rebase--interactive.sh
parentc18b86734113ee2aeb0e140c922c8fbd4accc860 (diff)
downloadgit-97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce.tar.gz
Show number of TODO items for interactive rebaseok/rebase-i-count-todo
During 'rebase -i', one wrong edit in a long rebase session might inadvertently drop commits/items. This change shows the total number of TODO items in the comments after the list. After performing the rebase edit, total item counts can be compared to make sure that no changes have been lost in the edit. Signed-off-by: Onno Kortmann <onno@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index b64dd28acf..c6a4629cbc 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -1031,9 +1031,11 @@ test -s "$todo" || echo noop >> "$todo"
test -n "$autosquash" && rearrange_squash "$todo"
test -n "$cmd" && add_exec_commands "$todo"
+todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
+
cat >>"$todo" <<EOF
-$comment_char Rebase $shortrevisions onto $shortonto
+$comment_char Rebase $shortrevisions onto $shortonto ($todocount TODO item(s))
EOF
append_todo_help
git stripspace --comment-lines >>"$todo" <<\EOF