From 97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce Mon Sep 17 00:00:00 2001 From: Onno Kortmann Date: Wed, 10 Dec 2014 19:16:44 +0100 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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" <>"$todo" <<\EOF