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

Re: Some information that git diff saves and that git status does not

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Mar 9, 2010, 08:20 UTC
Message-ID
<20100309082029.GG31105@dpotapov.dyndns.org>
In-Reply-To
<4B95F183.7000708@gmail.com>
On Tue, Mar 09, 2010 at 07:58:11AM +0100, Sergio Callegari wrote:
> 
> I actually did not know about the
> 
> update-index --refresh

This is a plumbing commmand, which normally users should not use directly, but when you copy your repo by hands or do something like that, you may need it (or use "git diff").

Show 5 quoted lines
> 
> but now I have the relevant information its name sounds obvious.
> And I suspected something like inode data entering the game.
> 
> As a matter of fact, I was obtaining the same effect with git diff.

Because "git diff" refreshes the cached stat information internally, in the same way as "update-index --refresh". Junio wrote about this recently: http://article.gmane.org/gmane.comp.version-control.git/141708

Show 9 quoted lines
> 
> What was appearing to me as a quirk is that:
> 
> 1) If you do not refresh the index, git works perfectly all the
> same.  For instance, git status shows the right info. Only it is not
> that fast anymore, since everytime it needs to runs the filters on
> all the files.
> 2) git status does not refresh the index, while other commands like
> git diff do.

Historically, "git status" was just the dry-run mode of "git commit". I do not think that "git commit" should refresh the index. But in Git 1.7, "git status" is no longer the dry-run mode of "git commit", so I see no reason why it does not refresh the cached stat info internally...

Dmitry
Previous: Sergio CallegariNext: Jens Lehmann
Message 6 of 7 in “Some information that git diff saves and that git status does not”
  1. SergioMar 8, 2010
  2. Junio C HamanoMar 8, 2010
  3. Johannes SixtMar 9, 2010
  4. Junio C HamanoMar 9, 2010
  5. Sergio CallegariMar 9, 2010
  6. Dmitry PotapovMar 9, 2010
  7. Jens LehmannMar 8, 2010

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.