[PATCH 0/2] Fix interactive rebase when the editor saves with CR/LF
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 25, 2015, 12:49 UTC
- Message-ID
- <cover.1445777347.git.johannes.schindelin@gmx.de>
Chad Boles reported that `git rebase -I` recently started producing errors when the editor saves files with DOS line endings. The symptom is:
Warning: the command isn't recognized in the following line: -
You can fix this with 'git rebase --edit-todo'. Or you can abort the rebase with 'git rebase --abort'.
The real bummer is that simply calling `git rebase --continue` "fixes" it.
Turns out that we now check whether a single Carriage Return is a valid command. This new check was introduced recently (1db168ee9, ironically named "rebase-i: loosen over-eager check_bad_cmd check").
The proposed fix is to teach *all* shell scripts in Git to accept CR as a field separator. Since LF is already specified as such, it should be an uncontentious change.
Johannes Schindelin (2): Demonstrate rebase fails when the editor saves with CR/LF sh-setup: explicitly mark CR as a field separator
git-sh-setup.sh | 2 +- t/t3404-rebase-interactive.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
-- 2.1.4