Skip to content

Commit 2b77029

Browse files
mhaggergitster
authored andcommitted
rebase--interactive: Ignore comments and blank lines in peek_next_command
Previously, blank lines and/or comments within a series of squash/fixup commands would confuse "git rebase -i" into thinking that the series was finished. It would therefore require the user to edit the commit message for the squash/fixup commits seen so far. Then, after continuing, it would ask the user to edit the commit message again. Ignore comments and blank lines within a group of squash/fixup commands, allowing them to be processed in one go. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8fb5d44 commit 2b77029

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ make_squash_message () {
322322
}
323323

324324
peek_next_command () {
325-
sed -n "1s/ .*$//p" < "$TODO"
325+
sed -n -e "/^#/d" -e "/^$/d" -e "s/ .*//p" -e "q" < "$TODO"
326326
}
327327

328328
do_next () {

0 commit comments

Comments
 (0)