Skip to content

Commit f63ed08

Browse files
committed
Merge branch 'es/rebase-i-count-todo' into maint
"git rebase -i" recently started to include the number of commits in the insn sheet to be processed, but on a platform that prepends leading whitespaces to "wc -l" output, the numbers are shown with extra whitespaces that aren't necessary. * es/rebase-i-count-todo: rebase-interactive: re-word "item count" comment rebase-interactive: suppress whitespace preceding item count
2 parents 8c2ea51 + 2185d3b commit f63ed08

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,10 +1030,11 @@ test -n "$autosquash" && rearrange_squash "$todo"
10301030
test -n "$cmd" && add_exec_commands "$todo"
10311031

10321032
todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
1033+
todocount=${todocount##* }
10331034

10341035
cat >>"$todo" <<EOF
10351036
1036-
$comment_char Rebase $shortrevisions onto $shortonto ($todocount TODO item(s))
1037+
$comment_char Rebase $shortrevisions onto $shortonto ($todocount command(s))
10371038
EOF
10381039
append_todo_help
10391040
git stripspace --comment-lines >>"$todo" <<\EOF

t/t3404-rebase-interactive.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,4 +1046,13 @@ test_expect_success 'respect core.abbrev' '
10461046
test 4 = $(grep -c "pick [0-9a-f]\{12,\}" todo-list)
10471047
'
10481048

1049+
test_expect_success 'todo count' '
1050+
write_script dump-raw.sh <<-\EOF &&
1051+
cat "$1"
1052+
EOF
1053+
test_set_editor "$(pwd)/dump-raw.sh" &&
1054+
git rebase -i HEAD~4 >actual &&
1055+
grep "^# Rebase ..* onto ..* ([0-9]" actual
1056+
'
1057+
10491058
test_done

0 commit comments

Comments
 (0)