public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Johannes Schindelin <johannes.schindelin@gmx•de>
Cc: git@vger•kernel.org, Matthieu Moy <Matthieu.Moy@imag•fr>,
	Chad Boles <chadbo@microsoft•com>,
	"brian m. carlson" <sandals@crustytoothpaste•net>,
	Philip Oakley <philipoakley@iee•org>
Subject: Re: [PATCH v2 0/2] Fix interactive rebase when the editor saves with CR/LF
Date: Sun, 25 Oct 2015 12:12:56 -0700	[thread overview]
Message-ID: <xmqqpp02kbif.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <cover.1445782122.git.johannes.schindelin@gmx.de> (Johannes Schindelin's message of "Sun, 25 Oct 2015 15:10:11 +0100 (CET)")

Johannes Schindelin <johannes.schindelin@gmx•de> writes:

> 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.

Two questions.

 * What does the DOS editor do to a file with ^M in the middle of a
   line, e.g. "A^MB^M^J"?

 * Is your shell ported correctly to the platform?

The latter may need a bit of elaboration.  "read a b c" is supposed
to read one line of text (where the definition of line is platform
dependent, your platform may use CRLF to signal the end of an line),
split the characters on the line (i.e. LF vs CRLF no longer matters
at this point) at $IFS characters and give them to $a $b and $c. If
the platform accepts CRLF as the EOL signal, should the program still
see CR at the end of $c?

A solution that mucks with IFS smells like fixing a wrong problem
without addressing the real cause.

Also IFS is used not only by "read", so munging it globally doubly
feels wrong.

In addition, you do not want to split at CR; what you want is to
treat CRLF (i.e. not a lone CR) as the end-of-line separator.
Adding CR to IFS feels triply wrong.

By the way, saying "This is right, really" makes you sound as if you
do not have a real argument.

  parent reply	other threads:[~2015-10-25 19:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 12:49 [PATCH 0/2] Fix interactive rebase when the editor saves with CR/LF Johannes Schindelin
2015-10-25 12:50 ` [PATCH 1/2] Demonstrate rebase fails " Johannes Schindelin
2015-10-25 12:50 ` [PATCH 2/2] sh-setup: explicitly mark CR as a field separator Johannes Schindelin
2015-10-25 13:16   ` Philip Oakley
2015-10-25 13:26     ` Johannes Schindelin
     [not found]   ` <20151025131059.GA370025@vauxhall.crustytoothpaste.net>
2015-10-25 13:25     ` Johannes Schindelin
2015-10-25 13:56       ` shell scripting woes, was " Johannes Schindelin
2015-10-25 14:10 ` [PATCH v2 0/2] Fix interactive rebase when the editor saves with CR/LF Johannes Schindelin
2015-10-25 14:10   ` [PATCH v2 1/2] Demonstrate rebase fails " Johannes Schindelin
2015-10-25 14:10   ` [PATCH v2 2/2] sh-setup: explicitly mark CR as a field separator Johannes Schindelin
2015-10-26  9:34     ` Matthieu Moy
2015-10-26 18:31       ` Junio C Hamano
2015-10-26 20:07         ` Junio C Hamano
2015-10-27  9:46           ` Johannes Schindelin
2015-10-27  9:19         ` Johannes Schindelin
2015-10-27 17:46           ` Junio C Hamano
2015-10-27 10:01         ` Matthieu Moy
2015-10-25 19:12   ` Junio C Hamano [this message]
2015-10-26 10:43     ` [PATCH v2 0/2] Fix interactive rebase when the editor saves with CR/LF Johannes Schindelin
2015-10-26 19:13       ` Junio C Hamano
2015-10-27  9:34         ` Johannes Schindelin
2015-10-27  9:47   ` [PATCH v3 " Johannes Schindelin
2015-10-27  9:47     ` [PATCH v3 1/2] Demonstrate rebase fails " Johannes Schindelin
2015-10-27  9:47     ` [PATCH v3 2/2] rebase-i: work around Windows CRLF line endings Johannes Schindelin
2015-10-27  9:55       ` Johannes Schindelin
2015-10-27 17:25         ` Junio C Hamano
2015-10-28 14:56           ` Johannes Schindelin
2015-10-28 14:54     ` [PATCH v4 0/2] Fix interactive rebase when the editor saves with CR/LF Johannes Schindelin
2015-10-28 14:54       ` [PATCH v4 1/2] Demonstrate rebase fails " Johannes Schindelin
2015-10-28 14:54       ` [PATCH v4 2/2] rebase-i: work around Windows CRLF line endings Johannes Schindelin
2015-10-28 17:12       ` [PATCH v4 0/2] Fix interactive rebase when the editor saves with CR/LF Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqpp02kbif.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=Matthieu.Moy@imag$(echo .)fr \
    --cc=chadbo@microsoft$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=johannes.schindelin@gmx$(echo .)de \
    --cc=philipoakley@iee$(echo .)org \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox