git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: "Toralf Förster" <toralf.foerster@gmx.de>,
	"Andrew Ardill" <andrew.ardill@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: problem with BOINC repository and CR/LF
Date: Tue, 18 Dec 2012 11:41:32 -0500	[thread overview]
Message-ID: <20121218164132.GC20122@sigill.intra.peff.net> (raw)
In-Reply-To: <50D05E62.7090605@web.de>

On Tue, Dec 18, 2012 at 01:15:30PM +0100, Torsten Bögershausen wrote:

> I could re-produce the problem here:
> git version 1.8.0.197.g5a90748
> Mac OS X (that what I had at hands fastest)

I could reproduce it, too, on Linux.

The reason it does not always happen is that git will not re-examine the
file content unless the timestamp on the file is older than what's in
the index. So it is a race condition for git to see whether the file is
stat-dirty.

But you can make sure all files are stat-dirty by just resetting the
index:

  $ git clone git://boinc.berkeley.edu/boinc.git
  $ rm .git/index
  $ git reset

which shows the complete list of files with LF/CRLF normalization
issues.

> So my conclusion is:
> The file has CRLF in the repo, but should have LF.
> This is not a good thing, and the files need to be normalized.

Yes, exactly. The project has told git via .gitattributes that certain
files should have particular line endings in the repository, but that is
not the case with the current versions. Doing:

  $ git commit -a -m 'normalize line endings according to gitattributes'

on top of the commands above would fix it (for that commit and onwards,
anyway).

-Peff

  reply	other threads:[~2012-12-18 16:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 10:23 problem with BOINC repository and CR/LF Toralf Förster
2012-12-17 11:38 ` Andrew Ardill
2012-12-17 16:01   ` Toralf Förster
2012-12-18  1:56     ` Andrew Ardill
2012-12-18  9:55       ` Toralf Förster
2012-12-18  9:58         ` Toralf Förster
2012-12-18 12:15         ` Torsten Bögershausen
2012-12-18 16:41           ` Jeff King [this message]
2012-12-19 10:44             ` Toralf Förster
2012-12-22 12:31             ` Toralf Förster
2012-12-22 18:54               ` Dmitry Potapov
2012-12-22 19:17               ` Junio C Hamano
2012-12-19 10:43           ` Toralf Förster

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20121218164132.GC20122@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=andrew.ardill@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    --cc=toralf.foerster@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).