git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Stefan Norgren <stefan.norgren@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: Bug in EOL conversion?
Date: Wed, 23 Jan 2013 23:46:55 +0100	[thread overview]
Message-ID: <87ehhb5xgg.fsf@pctrast.inf.ethz.ch> (raw)
In-Reply-To: <CANrZfmGXtKcB+i_xhNJELftRc1pC2TJKKhOieHm=5Qkni9OKrA@mail.gmail.com> (Stefan Norgren's message of "Wed, 23 Jan 2013 03:44:23 +0100")

Stefan Norgren <stefan.norgren@gmail.com> writes:

> $ git add *
> warning: LF will be replaced by CRLF in withlf.txt.
> The file will have its original line endings in your working directory.
[...]
> $ ls -la
> total 10
> d---------+ 1 Stefan None 0 Jan 23 02:12 .
> d---------+ 1 Stefan None 0 Jan 23 02:10 ..
> d---------+ 1 Stefan None 0 Jan 23 02:22 .git
> ----------+ 1 Stefan None 3 Jan 23 01:55 withcrlf.txt
> ----------+ 1 Stefan None 2 Jan 23 01:55 withlf.txt
[...]
> $ git ls-tree -l HEAD withcrlf.txt
> 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d       2    withcrlf.txt
> $ git ls-tree -l HEAD withlf.txt
> 100644 blob d00491fd7e5bb6fa28c517a0bb32b8b506539d4d       2    withlf.txt

Isn't that what would be expected?  It's a combination of

- the canonical representation of a newline is LF, so the repository
  stores LF

- with safecrlf, checkout converts LF->CRLF and add converts CRLF->LF

So from the user's POV, running

  git add withlf.txt
  rm withlf.txt
  git checkout -- withlf.txt

would appear to replace LF with CRLF in the worktree.  That's what the
message says.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

      parent reply	other threads:[~2013-01-23 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23  2:44 Bug in EOL conversion? Stefan Norgren
2013-01-23 21:55 ` Philip Oakley
2013-01-23 22:36   ` Erik Faye-Lund
2013-01-23 23:32     ` Philip Oakley
2013-01-23 23:04   ` Pēteris Kļaviņš
2013-01-23 22:46 ` Thomas Rast [this message]

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=87ehhb5xgg.fsf@pctrast.inf.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=stefan.norgren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).