git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Michael Cook <mcook@bbn.com>
Cc: git@vger.kernel.org
Subject: Re: How often does git calculate SHAs?
Date: Mon, 30 Jan 2012 06:59:55 -0800	[thread overview]
Message-ID: <CAJo=hJtEPTPTwdoFaoZH4OBpfnCR3VDUNGdNtCprmPf=13xrdQ@mail.gmail.com> (raw)
In-Reply-To: <4F26A864.1080702@bbn.com>

On Mon, Jan 30, 2012 at 06:25, Michael Cook <mcook@bbn.com> wrote:
> How often does git actually calculate a file's SHA?
>
> `strace git status` shows that git stat'ed many files, but opened only a
> few. So I assume git has some heuristicsbased on the stat infofor when to
> recalculate the SHAs.
>
> Any pointers to how I could have figured this out myself from looking at the
> source code would be appreciated. Google wasn't helpful.

During `git status` Git performs an lstat() of every file in the
working tree. If the file matches stat structure data with the cache
held in .git/index, Git assumes the file is unmodified.

Things Git are looking for is usually size, mtime, inode number,
creation time, etc.

      reply	other threads:[~2012-01-30 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 14:25 How often does git calculate SHAs? Michael Cook
2012-01-30 14:59 ` Shawn Pearce [this message]

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='CAJo=hJtEPTPTwdoFaoZH4OBpfnCR3VDUNGdNtCprmPf=13xrdQ@mail.gmail.com' \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=mcook@bbn.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).