From: Chris Torek <chris.torek@gmail.com>
To: Martin <git@mfriebe.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Files modified, even after: git reset --hard
Date: Mon, 26 Jul 2021 15:03:24 -0700 [thread overview]
Message-ID: <CAPx1Gvey1uSr58Uf7VpC0c6J+R0tUP=VUP_dGmv_yVO-CwmvXg@mail.gmail.com> (raw)
In-Reply-To: <67f35be7-3317-6486-cdb6-62eb691eaf10@mfriebe.de>
On Mon, Jul 26, 2021 at 12:57 PM Martin <git@mfriebe.de> wrote:
> Is it possible that those cheats also look at the "replaced" (rather
> than the "replacement") commit(s)?
They look at `stat` system call (well, `lstat` *call*) data, not the
actual files. This works better on Unix systems, where `lstat` is
a real system call, than it does on Windows, where it's faked up
from whatever Windows really stores as information about files.
> I am pretty sure I have "git replace"d all blobs for some of the files,
> and yet they do get phantoms.
The stat data are stored in Git's index. It's the rebuilding of various
index entries that updates what Git uses to do a fast check of file
status. (Note that the stat data on the index itself count as part of
the cheating; this gets tricky. See [1].)
There is an article at [2] on how Windows implements `stat`. It's
probably out of date (says "VS2005"). It's interesting to me what's
wrong here: `st_dev` is made to mirror `st_rdev` but `st_dev` should
probably always just be zero, and they chose to attempt to store a
file *creation* time in `st_ctime`, when that is in `st_birthtime` in a
modern Unix-like system: the `ctime` field is the *inode change time*,
not a file creation time. (Fortunately Git uses neither field.)
Chris
[1]: https://git-scm.com/docs/racy-git/en
[2]: https://web.archive.org/web/20101214222704/http://msdn.microsoft.com/en-us/library/14h5k7ff(v=vs.80).aspx
next prev parent reply other threads:[~2021-07-26 22:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-25 15:04 Files modified, even after: git reset --hard Martin
2021-07-25 15:40 ` Martin
2021-07-25 17:48 ` Martin
2021-07-25 18:39 ` Martin
2021-07-26 0:33 ` Chris Torek
2021-07-26 1:34 ` Martin
2021-07-26 2:59 ` Chris Torek
2021-07-26 10:31 ` Martin
2021-07-26 11:11 ` Chris Torek
2021-07-26 13:57 ` Martin
2021-07-26 18:21 ` Philip Oakley
2021-07-26 19:57 ` Martin
2021-07-26 22:03 ` Chris Torek [this message]
2021-07-27 0:55 ` Martin
2021-07-26 10:39 ` Philip Oakley
2021-07-26 12:50 ` Martin
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='CAPx1Gvey1uSr58Uf7VpC0c6J+R0tUP=VUP_dGmv_yVO-CwmvXg@mail.gmail.com' \
--to=chris.torek@gmail.com \
--cc=git@mfriebe.de \
--cc=git@vger.kernel.org \
/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).