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

Re: touching a file causes it to be listed using git diff-files

From
Jeff King <peff@peff.net>
Date
Jan 14, 2010, 05:26 UTC
Message-ID
<20100114052658.GA13973@coredump.intra.peff.net>
In-Reply-To
<p06240810c774498d4a2e@[63.138.152.134]>
On Thu, Jan 14, 2010 at 12:01:46AM -0500, Stephen Bannasch wrote:
Show 7 quoted lines
> Do you know if there is a plumbing command that will stat all of the
> files without listing the files that actually do need updating?
> 
> In the case where file1 has been only touched but file2 has been
> changed (and both are tracked) I'd like to stat both filesand then run
> diff-files as plumbing to see that only file2 has been changed in the
> working directory.

Judging from the scripts in git itself, I think the recommended practice is to simply "git update-index --refresh -q >/dev/null".

> 'git diff' also stats the files but strangely 'git diff --quiet' doesn't ???

I can't reproduce that behavior here on the current "master". Old versions of git used to not do the index refresh for "diff". What version of git are you using?

-Peff
Previous: Stephen BannaschNext: Stephen Bannasch
Message 4 of 6 in “touching a file causes it to be listed using git diff-files”
  1. Stephen BannaschJan 13, 2010
  2. Jeff KingJan 14, 2010
  3. Stephen BannaschJan 14, 2010
  4. Jeff KingJan 14, 2010
  5. Stephen BannaschJan 14, 2010
  6. Jeff KingJan 14, 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.