From: Johannes Schindelin Date: Sun, 09 Oct 2016 08:57:20 GMT Subject: Re: [PATCH v2 20/25] sequencer: left-trim lines read from the script Message-ID: In-Reply-To: <5ed8aaea-9fbe-11b0-49b7-1b42567d4918@kdbg.org> Hi Hannes, On Thu, 6 Oct 2016, Johannes Sixt wrote: > [PATCH] sequencer: strip CR from the end of exec insns > > It is not unheard of that editors on Windows write CRLF even if the file > originally had only LF. This is particularly awkward for exec lines of a > rebase -i todo sheet. Take for example the insn "exec echo": The shell > script parser (either of the sequencer or of the shell that is invoked, > I do not know) splits at the LF and leaves the CR attached to "echo", > which leads to the unknown command "echo\r". > > Work it around by stripping CR before the command specified with exec is > passed to the shell. > > This happens to fix t9903.14 and .15 in my environment: the insn sheet > constructed here contains CRLF thanks to MSYS1's bash cleverness. Good point. I decided to do it at a different level, though: parse_insn_line() should already receive the line without trailing end-of-line markers (this was already the case for LF-only todo scripts). I reused your commit message and touched it up a bit, hope you don't mind! Ciao, Dscho