From: Onno Kortmann Date: Wed, 10 Dec 2014 18:16:44 +0000 (+0100) Subject: Show number of TODO items for interactive rebase X-Git-Tag: v2.3.0-rc0~43^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/97f05f43?ds=sidebyside 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 --- 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