{"thread":{"id":"28443","subject":"Possible timestamp problems with diff-files?","startedAt":"2011-09-20T10:30:53Z","lastAt":"2011-09-24T14:30:56Z","messageCount":5,"participants":["Marc Strapetz","Jeff King","Junio C Hamano","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"175851","messageId":"4E786B5D.40601@syntevo.com","threadId":"28443","inReplyTo":null,"subject":"Possible timestamp problems with diff-files?","fromName":"Marc Strapetz","fromEmail":"marc.strapetz@syntevo.com","sentAt":"2011-09-20T10:30:53Z","receivedAt":"2011-09-20T10:30:53Z","isPatch":false,"sender":{"key":"marc.strapetz@syntevo.com","avatar":"https://avatars.githubusercontent.com/u/3380730?v=4"},"body":"For our Git client, we are invoking\n\ngit diff-files--quiet --ignore-submodules\n\nimmediately after a commit of *all* changes. Hence, the expected exit\ncode would be 0 (because there are no changes). A user has now reported\nthat for commits with many changes, exit code is sometimes 1. For the\nlast incident, the commit was started at 15:24:11,820 and finished at\n15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with\nexit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm\nwondering now, if that could be a timestamp problem (maybe related to\nthe Index)?\n\nNote that there are a couple of threads running in the client itself, so\nI guess actual running time of diff-files was much shorter than 9\nseconds and chances are that some parts of diff-files were run in the\nsame second 15:24:12.\n\nSystem configuration is:\nLinux splitter 2.6.38-11-server #48-Ubuntu SMP Fri Jul 29 19:20:32 UTC\n2011 x86_64 x86_64 x86_64 GNU/Linux\n\ngit version 1.7.4.1\n\n--\nBest regards,\nMarc Strapetz\n=============\nsyntevo GmbH\nhttp://www.syntevo.com\nhttp://blog.syntevo.com\n"},{"id":"175875","messageId":"20110920175458.GA3776@sigill.intra.peff.net","threadId":"28443","inReplyTo":"4E786B5D.40601@syntevo.com","subject":"Re: Possible timestamp problems with diff-files?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-09-20T17:54:58Z","receivedAt":"2011-09-20T17:54:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 20, 2011 at 12:30:53PM +0200, Marc Strapetz wrote:\n\n> For our Git client, we are invoking\n> \n> git diff-files--quiet --ignore-submodules\n> \n> immediately after a commit of *all* changes. Hence, the expected exit\n> code would be 0 (because there are no changes). A user has now reported\n> that for commits with many changes, exit code is sometimes 1. For the\n> last incident, the commit was started at 15:24:11,820 and finished at\n> 15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with\n> exit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm\n> wondering now, if that could be a timestamp problem (maybe related to\n> the Index)?\n\ndiff-files is scriptable plumbing, which means it is up to the script\nwriter to decide exactly when the index should be refreshed with respect\nto the working tree files (because doing so could be kind of expensive,\nas it needs to stat every file in the working tree). Have you tried\nrunning \"git update-index --refresh\" just before your diff-files?\n\n-Peff\n"},{"id":"175944","messageId":"4E79DF81.8090605@syntevo.com","threadId":"28443","inReplyTo":"20110920175458.GA3776@sigill.intra.peff.net","subject":"Re: Possible timestamp problems with diff-files?","fromName":"Marc Strapetz","fromEmail":"marc.strapetz@syntevo.com","sentAt":"2011-09-21T12:58:41Z","receivedAt":"2011-09-21T12:58:41Z","isPatch":false,"sender":{"key":"marc.strapetz@syntevo.com","avatar":"https://avatars.githubusercontent.com/u/3380730?v=4"},"body":"On 20.09.2011 19:54, Jeff King wrote:\n> On Tue, Sep 20, 2011 at 12:30:53PM +0200, Marc Strapetz wrote:\n> \n>> For our Git client, we are invoking\n>>\n>> git diff-files--quiet --ignore-submodules\n>>\n>> immediately after a commit of *all* changes. Hence, the expected exit\n>> code would be 0 (because there are no changes). A user has now reported\n>> that for commits with many changes, exit code is sometimes 1. For the\n>> last incident, the commit was started at 15:24:11,820 and finished at\n>> 15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with\n>> exit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm\n>> wondering now, if that could be a timestamp problem (maybe related to\n>> the Index)?\n> \n> diff-files is scriptable plumbing, which means it is up to the script\n> writer to decide exactly when the index should be refreshed with respect\n> to the working tree files (because doing so could be kind of expensive,\n> as it needs to stat every file in the working tree). Have you tried\n> running \"git update-index --refresh\" just before your diff-files?\n\nMy point is that \"git diff-files --quiet\" seems to returns 1 and when\ninvoked a short time later (without modifying working tree or invoking\nany other Git command) it returns 0. This would indicate a bug in Git, I\nguess. I think we can add more debug logging to our client to track down\nthat problem. However, to do that I'd need some input on what to log?\n\n--\nBest regards,\nMarc Strapetz\n=============\nsyntevo GmbH\nhttp://www.syntevo.com\nhttp://blog.syntevo.com\n"},{"id":"175965","messageId":"7vboud1sz5.fsf@alter.siamese.dyndns.org","threadId":"28443","inReplyTo":"4E79DF81.8090605@syntevo.com","subject":"Re: Possible timestamp problems with diff-files?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-21T21:33:02Z","receivedAt":"2011-09-21T21:33:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marc Strapetz <marc.strapetz@syntevo.com> writes:\n\n> On 20.09.2011 19:54, Jeff King wrote:\n>> On Tue, Sep 20, 2011 at 12:30:53PM +0200, Marc Strapetz wrote:\n>> \n>>> For our Git client, we are invoking\n>>>\n>>> git diff-files--quiet --ignore-submodules\n>>>\n>>> immediately after a commit of *all* changes. Hence, the expected exit\n>>> code would be 0 (because there are no changes). A user has now reported\n>>> that for commits with many changes, exit code is sometimes 1. For the\n>>> last incident, the commit was started at 15:24:11,820 and finished at\n>>> 15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with\n>>> exit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm\n>>> wondering now, if that could be a timestamp problem (maybe related to\n>>> the Index)?\n\nWhat peff said already.\n\nIf you do not refresh the cached stat information, diff-files may report\n\"they differ\" for a path that is otherwise unchanged without looking at\nthe contents of such a path to notice that the only difference is the\ncached stat information (the whole and only point of having the cached\nstat information is to avoid looking at the contents). Also, it may look\nat the contents of such a path if it has a reason to suspect that the file\nmight have changed if it cannot tell from the cached stat information\n(look for \"racy-git\" if you are really interested).\n\nUpdate the cached stat information before you use plumbing commands in\nyour script.\n"},{"id":"176126","messageId":"4E7DE9A0.8070209@dewire.com","threadId":"28443","inReplyTo":"7vboud1sz5.fsf@alter.siamese.dyndns.org","subject":"Re: Possible timestamp problems with diff-files?","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2011-09-24T14:30:56Z","receivedAt":"2011-09-24T14:30:56Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"Junio C Hamano skrev 2011-09-21 23.33:\n> Marc Strapetz<marc.strapetz@syntevo.com>  writes:\n>\n>> On 20.09.2011 19:54, Jeff King wrote:\n>>> On Tue, Sep 20, 2011 at 12:30:53PM +0200, Marc Strapetz wrote:\n>>>\n>>>> For our Git client, we are invoking\n>>>>\n>>>> git diff-files--quiet --ignore-submodules\n>>>>\n>>>> immediately after a commit of *all* changes. Hence, the expected exit\n>>>> code would be 0 (because there are no changes). A user has now reported\n>>>> that for commits with many changes, exit code is sometimes 1. For the\n>>>> last incident, the commit was started at 15:24:11,820 and finished at\n>>>> 15:24:12,329, diff-files was invoked at 15:24:12,455 and failed with\n>>>> exit code 1 at 15:24:21,394. A subsequent diff-files succeeded, so I'm\n>>>> wondering now, if that could be a timestamp problem (maybe related to\n>>>> the Index)?\n>\n> What peff said already.\n>\n> If you do not refresh the cached stat information, diff-files may report\n> \"they differ\" for a path that is otherwise unchanged without looking at\n> the contents of such a path to notice that the only difference is the\n> cached stat information (the whole and only point of having the cached\n> stat information is to avoid looking at the contents). Also, it may look\n> at the contents of such a path if it has a reason to suspect that the file\n> might have changed if it cannot tell from the cached stat information\n> (look for \"racy-git\" if you are really interested).\n>\n> Update the cached stat information before you use plumbing commands in\n> your script.\n\nUsing git diff instead of git diff-files would do just that, unless I am\nmissing something.\n\n-- robin\n"}]}