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>
This commit is contained in:
Onno Kortmann 2014-12-10 19:16:44 +01:00 committed by Junio C Hamano
parent c18b867341
commit 97f05f43dc

View file

@ -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