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

Re: Possible timestamp problems with diff-files?

From
Marc Strapetz <marc.strapetz@syntevo.com>
Date
Sep 21, 2011, 12:58 UTC
Message-ID
<4E79DF81.8090605@syntevo.com>
In-Reply-To
<20110920175458.GA3776@sigill.intra.peff.net>
On 20.09.2011 19:54, Jeff King wrote:
Show 20 quoted lines
> On Tue, Sep 20, 2011 at 12:30:53PM +0200, Marc Strapetz wrote:
> 
>> For our Git client, we are invoking
>>
>> git diff-files--quiet --ignore-submodules
>>
>> immediately after a commit of *all* changes. Hence, the expected exit
>> code would be 0 (because there are no changes). A user has now reported
>> that for commits with many changes, exit code is sometimes 1. For the
>> last incident, the commit was started at 15:24:11,820 and finished at
>> 15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with
>> exit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm
>> wondering now, if that could be a timestamp problem (maybe related to
>> the Index)?
> 
> diff-files is scriptable plumbing, which means it is up to the script
> writer to decide exactly when the index should be refreshed with respect
> to the working tree files (because doing so could be kind of expensive,
> as it needs to stat every file in the working tree). Have you tried
> running "git update-index --refresh" just before your diff-files?

My point is that "git diff-files --quiet" seems to returns 1 and when invoked a short time later (without modifying working tree or invoking any other Git command) it returns 0. This would indicate a bug in Git, I guess. I think we can add more debug logging to our client to track down that problem. However, to do that I'd need some input on what to log?

-- Best regards, Marc Strapetz ============= syntevo GmbH http://www.syntevo.com http://blog.syntevo.com

Previous: Jeff KingNext: Junio C Hamano
Message 3 of 5 in “Possible timestamp problems with diff-files?”
  1. Marc StrapetzSep 20, 2011
  2. Jeff KingSep 20, 2011
  3. Marc StrapetzSep 21, 2011
  4. Junio C HamanoSep 21, 2011
  5. Robin RosenbergSep 24, 2011

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.