{"thread":{"id":"26266","subject":"Forcing re-reading files with unchanged stats","startedAt":"2011-01-12T14:07:25Z","lastAt":"2011-01-14T21:03:02Z","messageCount":5,"participants":["Maaartin","Tomas Carnecky","Jeff King","Junio C Hamano","Maaartin-1"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159403","messageId":"loom.20110112T150313-103@post.gmane.org","threadId":"26266","inReplyTo":null,"subject":"Forcing re-reading files with unchanged stats","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2011-01-12T14:07:25Z","receivedAt":"2011-01-12T14:07:25Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"There are files in my working tree which changes, but their size and mtime \nremains the same (I know it's strange, but it's useful). Can I make git to re-\nread them all, so it recognizes the change? Ideally, using a configuration \nvariable. The repo is fairly small, so speed is no issue here.\n"},{"id":"159422","messageId":"4D2E6D99.9060907@dbservice.com","threadId":"26266","inReplyTo":"loom.20110112T150313-103@post.gmane.org","subject":"Re: Forcing re-reading files with unchanged stats","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2011-01-13T03:12:25Z","receivedAt":"2011-01-13T03:12:25Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"  On 1/12/11 3:07 PM, Maaartin wrote:\n> There are files in my working tree which changes, but their size and mtime\n> remains the same (I know it's strange, but it's useful). Can I make git to re-\n\nWhen can this be useful?\n\n> read them all, so it recognizes the change? Ideally, using a configuration\n> variable. The repo is fairly small, so speed is no issue here.\n\nTry git update-index --refresh. I'm not aware of any config option, but \nyou might want to look through man git-config.\n\ntom\n"},{"id":"159424","messageId":"20110113033217.GA32661@sigill.intra.peff.net","threadId":"26266","inReplyTo":"4D2E6D99.9060907@dbservice.com","subject":"Re: Forcing re-reading files with unchanged stats","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-01-13T03:32:18Z","receivedAt":"2011-01-13T03:32:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jan 13, 2011 at 04:12:25AM +0100, Tomas Carnecky wrote:\n\n>  On 1/12/11 3:07 PM, Maaartin wrote:\n> >There are files in my working tree which changes, but their size and mtime\n> >remains the same (I know it's strange, but it's useful). Can I make git to re-\n> \n> When can this be useful?\n> \n> >read them all, so it recognizes the change? Ideally, using a configuration\n> >variable. The repo is fairly small, so speed is no issue here.\n> \n> Try git update-index --refresh. I'm not aware of any config option,\n> but you might want to look through man git-config.\n\nThat won't work, as it respects the stat information. So does\n--really-refresh. AFAIK, there isn't a way to tell update-index to\nignore start information, short of blowing away the index entirely, and\ndoing a read-tree to repopulate it.\n\nI'm curious what this use case is, and whether it would be acceptable to\nupdate something like ctime on the files to make them stat-dirty to git.\n\n-Peff\n"},{"id":"159428","messageId":"7vmxn51cy5.fsf@alter.siamese.dyndns.org","threadId":"26266","inReplyTo":"20110113033217.GA32661@sigill.intra.peff.net","subject":"Re: Forcing re-reading files with unchanged stats","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-13T07:26:42Z","receivedAt":"2011-01-13T07:26:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I'm curious what this use case is, and whether it would be acceptable to\n> update something like ctime on the files to make them stat-dirty to git.\n\nChanging crlf-related attributes (or filter/smudge) after the fact,\nperhaps?\n"},{"id":"159507","messageId":"4D30BA06.3090100@seznam.cz","threadId":"26266","inReplyTo":"20110113033217.GA32661@sigill.intra.peff.net","subject":"Re: Forcing re-reading files with unchanged stats","fromName":"Maaartin-1","fromEmail":"grajcar1@seznam.cz","sentAt":"2011-01-14T21:03:02Z","receivedAt":"2011-01-14T21:03:02Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"On 11-01-13 04:32, Jeff King wrote:\n> On Thu, Jan 13, 2011 at 04:12:25AM +0100, Tomas Carnecky wrote:\n> \n>>  On 1/12/11 3:07 PM, Maaartin wrote:\n>>> There are files in my working tree which changes, but their size and mtime\n>>> remains the same (I know it's strange, but it's useful). Can I make git to re-\n>>\n>> When can this be useful?\n\nWell, not really. I was asked to place a line containing a version\nnumber and a fingerprint in each file (of course the fingerprint must\nignore this line), so I did. This gets done using a script, and I didn't\nlike always saying \"yes\" to Emacs complaining about editing a file\nchanged on the disk, so I reset the mtime. I really don't think it was\nthe brightest idea ever.\n\n>>> read them all, so it recognizes the change? Ideally, using a configuration\n>>> variable. The repo is fairly small, so speed is no issue here.\n>>\n>> Try git update-index --refresh. I'm not aware of any config option,\n>> but you might want to look through man git-config.\n> \n> That won't work, as it respects the stat information. So does\n> --really-refresh. AFAIK, there isn't a way to tell update-index to\n> ignore start information, short of blowing away the index entirely, and\n> doing a read-tree to repopulate it.\n\nBlowing away the index could work for me. I had to check if it's clean\n(equal to the HEAD or working tree) first, so I loose no work. But this\nis a bit too much work for making my mtime hack work.\n\n> I'm curious what this use case is, and whether it would be acceptable to\n> update something like ctime on the files to make them stat-dirty to git.\n\nI'd suppose, Emacs does the same checks.\n"}]}