{"thread":{"id":"40996","subject":"update index mtime etc metadata","startedAt":"2015-12-14T20:44:29Z","lastAt":"2015-12-15T11:17:14Z","messageCount":2,"participants":["Joey Hess","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"274425","messageId":"20151214204429.GA31013@kitenet.net","threadId":"40996","inReplyTo":null,"subject":"update index mtime etc metadata","fromName":"Joey Hess","fromEmail":"id@joeyh.name","sentAt":"2015-12-14T20:44:29Z","receivedAt":"2015-12-14T20:44:29Z","isPatch":false,"sender":{"key":"id@joeyh.name","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"Is there any available plumbing that can change the mtime etc metadata\nthat is recorded in the index for a file, to user-provided values? Or,\nto force the current file stat metadata to be updated in the index?\n\nI know, git update-index --refresh, but I have a case where that's too\nexpensive. I'm using smudge filters; I know that the cleaned version of\nthe file will be unchanged from what's in the index now and only the\nstat metadata will change, and so I want to avoid\ngit update-index --refresh running the clean filter, which can\nbe quite expensive for a large file.\n\nAt the moment I don't see a way to do it other than using eg libgit2 to\nupdate the appropriate fields in the index structure.\n\n-- \nsee shy jo\n"},{"id":"274487","messageId":"CACsJy8DUxBxQJxe0RzJAs7oeu0FbVhEF3OZFpHNp==1DD_Ht4w@mail.gmail.com","threadId":"40996","inReplyTo":"20151214204429.GA31013@kitenet.net","subject":"Re: update index mtime etc metadata","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-15T11:17:14Z","receivedAt":"2015-12-15T11:17:14Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 15, 2015 at 3:44 AM, Joey Hess <id@joeyh.name> wrote:\n> Is there any available plumbing that can change the mtime etc metadata\n> that is recorded in the index for a file, to user-provided values? Or,\n> to force the current file stat metadata to be updated in the index?\n\nI don't think there is a way. We probably should improve ls-files and\nupdate-index to examine and update basically everything in the index..\nBut so far, nothing yet.\n\n> I know, git update-index --refresh, but I have a case where that's too\n> expensive. I'm using smudge filters; I know that the cleaned version of\n> the file will be unchanged from what's in the index now and only the\n> stat metadata will change, and so I want to avoid\n> git update-index --refresh running the clean filter, which can\n> be quite expensive for a large file.\n>\n> At the moment I don't see a way to do it other than using eg libgit2 to\n> update the appropriate fields in the index structure.\n\nYeah. I see libgit2 has a haskell binding, probably best for you.\n-- \nDuy\n"}]}