Skip to content

Commit

Permalink
Show number of TODO items for interactive rebase
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
onnokort authored and gitster committed Dec 10, 2014
1 parent c18b867 commit 97f05f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-rebase--interactive.sh
Expand Up @@ -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
Expand Down

0 comments on commit 97f05f4

Please sign in to comment.