Re: Refreshing index timestamps without reading content
From: Quentin Casasnovas <hidden>
Date: 2017-01-09 12:13:54
On Mon, Jan 09, 2017 at 07:02:45PM +0700, Duy Nguyen wrote:
On Thu, Jan 5, 2017 at 6:23 PM, Quentin Casasnovas [off-list ref] wrote:quoted
If not, I am willing to implement a --assume-content-unchanged to the git update-index if you guys don't see something fundamentally wrong with this approach.If you do that, I think you should go with either of the following options - Extend git-update-index --index-info to take stat info as well (or maybe make a new option instead). Then you can feed stat info directly to git without a use-case-specific "assume-content-unchanged". - Add "git update-index --touch" that does what "touch" does. In this case, it blindly updates stat info to latest. But like touch, we can also specify mtime from command line if we need to. It's a bit less generic than the above option, but easier to use. Caveat: The options I'm proposing can be rejected. So maybe wait a bit to see how people feel and perhaps send an RFC patch, again to gauge the reception.
Hey Duy, Thanks for your answer. I've played with this a bit last week and added an extra command, which I called --refresh-stat, which works like your suggested --index. It works very well with my use case and improves the performances very significantly on some of our use cases. It is attached to this e-mail to gather comments, as you suggest, and is really not meant to be reviewed for inclusion yet as it lacks test cases, documentation changes, etc. It is just a convenient way to show what I need and receive comments. The logic is simple enugh and will just skip calling ie_modified() when refreshing the index. Cheers, Q
Attachments
- signature.asc [application/pgp-signature] 801 bytes