git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: problem with BOINC repository and CR/LF

From
Jeff King <peff@peff.net>
Date
Dec 18, 2012, 16:41 UTC
Message-ID
<20121218164132.GC20122@sigill.intra.peff.net>
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
Previous: Torsten BögershausenNext: Toralf Förster
Message 8 of 13 in “problem with BOINC repository and CR/LF”
  1. Toralf FörsterDec 17, 2012
  2. Andrew ArdillDec 17, 2012
  3. Toralf FörsterDec 17, 2012
  4. Andrew ArdillDec 18, 2012
  5. Toralf FörsterDec 18, 2012
  6. Toralf FörsterDec 18, 2012
  7. Torsten BögershausenDec 18, 2012
  8. Jeff KingDec 18, 2012
  9. Toralf FörsterDec 19, 2012
  10. Toralf FörsterDec 22, 2012
  11. Dmitry PotapovDec 22, 2012
  12. Junio C HamanoDec 22, 2012
  13. Toralf FörsterDec 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.