Skip to content

Commit 97f05f4

Browse files
onnokortgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c18b867 commit 97f05f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-rebase--interactive.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,9 +1031,11 @@ test -s "$todo" || echo noop >> "$todo"
10311031
test -n "$autosquash" && rearrange_squash "$todo"
10321032
test -n "$cmd" && add_exec_commands "$todo"
10331033

1034+
todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
1035+
10341036
cat >>"$todo" <<EOF
10351037
1036-
$comment_char Rebase $shortrevisions onto $shortonto
1038+
$comment_char Rebase $shortrevisions onto $shortonto ($todocount TODO item(s))
10371039
EOF
10381040
append_todo_help
10391041
git stripspace --comment-lines >>"$todo" <<\EOF

0 commit comments

Comments
 (0)