From: Linus Torvalds <torvalds@linux-foundation.org>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Junio C Hamano <gitster@pobox.com>,
Johannes Sixt <j.sixt@viscovery.net>,
git@vger.kernel.org
Subject: Re: [PATCH] Build configuration to skip ctime for modification test
Date: Thu, 24 Jul 2008 19:00:29 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0807241854580.5249@nehalem.linux-foundation.org> (raw)
In-Reply-To: <20080723191647.GF5283@blimp.local>
On Wed, 23 Jul 2008, Alex Riesen wrote:
>
> It is not that it is broken. We just don't need it, because the st_mode
> is not used, and the rest of inode information is not used anyway.
That is NOT why git checks the ctime.
Git checks the ctime not because it cares about the inode state being
modified per se: since it can see that _directly_ - so why should it care
about inode state like st_mode?
No, git checks ctime because it in general tries to make it VERY VERY hard
for people to try to "fake out" git and replace files from underneath it
without git noticing.
It's much easier and much more common for tools to restore 'mtime' when
they do some operation on a file than it is for them to restore 'ctime'.
For example, if you rsync files between two hosts, the '-t' flag will make
rsync try to keep the mtimes in sync (and it's part of '-a', which is the
common form that you'd use for rsync). So if you only look at mtime and
size, you often miss the fact that the file has actually been messed with!
Looking at ctime gets around a number of those things. Of course, it can
cause git to be _too_ eager in thinking that a file is modified, and an
example of that is the insane indexing that 'beagle' does, which actually
modifies the files by adding inode extended attributes to them and thus
changes ctime due to the indexing. But in general it's a lot better to be
too careful than to miss the fact that somebody changed the file.
Linus
next prev parent reply other threads:[~2008-07-25 2:04 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-21 17:35 [PATCH] Fix update-index --refresh for submodules if stat(2) returns st_size 0 Alex Riesen
2008-07-21 18:20 ` Johannes Schindelin
2008-07-21 19:43 ` Alex Riesen
2008-07-21 23:26 ` Johannes Schindelin
2008-07-22 8:07 ` Junio C Hamano
2008-07-22 16:49 ` Alex Riesen
2008-07-22 7:17 ` Johannes Sixt
2008-07-22 16:46 ` Alex Riesen
2008-07-22 16:59 ` Johannes Sixt
2008-07-22 17:28 ` Junio C Hamano
2008-07-22 19:39 ` [PATCH] Build configuration to skip ctime for modification test Alex Riesen
2008-07-22 20:17 ` Johannes Schindelin
2008-07-22 20:31 ` Alex Riesen
2008-07-23 0:12 ` Junio C Hamano
2008-07-23 16:46 ` Alex Riesen
2008-07-23 16:59 ` Johannes Schindelin
2008-07-23 19:16 ` Alex Riesen
2008-07-25 2:00 ` Linus Torvalds [this message]
2008-07-25 5:55 ` Alex Riesen
2008-07-26 0:57 ` Johannes Schindelin
2008-07-26 15:38 ` [PATCH] Make use of stat.ctime configurable Alex Riesen
2008-07-27 19:46 ` Junio C Hamano
2008-07-27 19:46 ` Junio C Hamano
2008-07-28 6:31 ` Alex Riesen
2008-07-28 16:04 ` David Brown
2008-07-28 16:09 ` Linus Torvalds
2008-07-28 21:49 ` Alex Riesen
2008-07-29 1:16 ` Junio C Hamano
2008-07-29 1:23 ` Linus Torvalds
2008-07-29 1:31 ` Junio C Hamano
2008-07-29 1:41 ` David Brown
2008-07-29 2:49 ` Junio C Hamano
2008-07-29 10:45 ` Johannes Schindelin
2008-07-29 1:55 ` Linus Torvalds
2008-07-29 2:01 ` Linus Torvalds
2008-07-29 10:49 ` Johannes Schindelin
2008-07-28 16:20 ` Petr Baudis
2008-07-28 21:47 ` [PATCH] Improve the placement of core.trustctime in the documentation Alex Riesen
2008-07-29 6:23 ` Junio C Hamano
2008-07-24 19:00 ` [PATCH] Do not use ctime if file mode is not used Alex Riesen
2008-07-23 16:00 ` git svn throws locale related error when built from source Anton Mostovoy
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=alpine.LFD.1.10.0807241854580.5249@nehalem.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=raa.lkml@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).