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

Re: problem with BOINC repository and CR/LF

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 22, 2012, 19:17 UTC
Message-ID
<7vhandrj5m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<50D5A81B.1000306@gmx.de>
Toralf Förster <toralf.foerster@gmx.de> writes:
Show 11 quoted lines
> On 12/18/2012 05:41 PM, Jeff King wrote:
>> 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.
>
> /me still wonders whether this race condition is a feature or an issue
> in GIT - b/c it means that 2 different people cloning the same
> repository get different results.

The primary point of Peff's demonstration was to show that you told your repository to lie to Git, I think. It promised that the contents in the repository was with certain line endings when they are not. At that point Git can do whatever happens when it trusts its behaviour on that broken promise.

When the timestamp is set one way, Git happened to be extra careful for other reasons---Git is not in the business of suspecting that the user lied and double checking by wasting cycles [*1*]---and that extra check that does not have anything to do with the end-of-line conversion found that it was lied and noticed differences.

That is neither a feature nor a bug.
[Footnote]

*1* This extra carefulness is to handle the case where *filesystems* lie to Git. The user cannot do anything to make the filesystem not to lie, so we try to be extra careful and examine the contents even when the stat information (incorrectly) says that the file is not modified. Also luckily this happens only to minority of the paths (i.e. you do "git add" and then replace the file with different contents of the same length within the same timestamp granularity, or something like that), so we can afford to.

Previous: Dmitry PotapovNext: Toralf Förster
Message 12 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.