diff options
author | Onno Kortmann <onno@gmx.net> | 2014-12-10 19:16:44 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-12-10 13:17:38 -0800 |
commit | 97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce (patch) | |
tree | edd98942e886a8d4c4a5be445cd9560f09a25d90 /git-rebase--interactive.sh | |
parent | c18b86734113ee2aeb0e140c922c8fbd4accc860 (diff) | |
download | git-97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce.tar.gz git-97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce.tar.xz |
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>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index b64dd28ac..c6a4629cb 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 |