Show number of TODO items for interactive rebase

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>

Onno Kortmann committed Dec 10, 2014 at 19:16 UTC 97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce
1 file changed +3 -1
git-rebase--interactive.sh
+3 -1
@@ -1031,9 +1031,11 @@ test -s "$todo" || echo noop >> "$todo"
1031 test -n "$autosquash" && rearrange_squash "$todo"
1032 test -n "$cmd" && add_exec_commands "$todo"
1033
1034 +todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
1035 +
1036 cat >>"$todo" <<EOF
1037
1036 -$comment_char Rebase $shortrevisions onto $shortonto
1038 +$comment_char Rebase $shortrevisions onto $shortonto ($todocount TODO item(s))
1039 EOF
1040 append_todo_help
1041 git stripspace --comment-lines >>"$todo" <<\EOF