git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: "Jeff King" <peff@peff.net>,
	"Torsten Bögershausen" <tboegi@web.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: Sat, 22 Dec 2012 11:17:25 -0800	[thread overview]
Message-ID: <7vhandrj5m.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 50D5A81B.1000306@gmx.de

Toralf Förster <toralf.foerster@gmx.de> writes:

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

  parent reply	other threads:[~2012-12-22 19:22 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
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 [this message]
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=7vhandrj5m.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=andrew.ardill@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --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).