{"thread":{"id":"37948","subject":"Set file modification time on checkout","startedAt":"2014-11-13T04:45:52Z","lastAt":"2014-11-13T05:04:15Z","messageCount":2,"participants":["Patrick Hemmer","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251786","messageId":"54643780.7060504@stormcloud9.net","threadId":"37948","inReplyTo":null,"subject":"Set file modification time on checkout","fromName":"Patrick Hemmer","fromEmail":"git@stormcloud9.net","sentAt":"2014-11-13T04:45:52Z","receivedAt":"2014-11-13T04:45:52Z","isPatch":false,"sender":{"key":"git@stormcloud9.net","avatar":null},"body":"The request is to allow git to set the file modification time on\ncheckout to the commit-author-date of the commit which last modified the\nfile.\nYes I know this is in the FAQ, but the FAQ entry is missing an\nincreasingly common use case: docker.\nWhen docker builds an image, it generates layers of images based on each\nbuild step. Adding a file would be a build step, and for this action it\ngenerates a hash based on the file modification time & content. Next\ntime the image is built, if these haven't changed, the previously built\nlayer is reused. And like git commit history, if a layer changes, the\nhash of all subsequent layers change and have to be rebuilt. So reusing\nlayers can save a ton of time.\n\nNow I'm not proposing that this be made the default action. The `make`\nuse case is legitimate. But it would be nice to have an option for\n`checkout` and `reset` which toggles the behavior.\n\n-Patrick\n"},{"id":"251787","messageId":"54643BCF.5000900@web.de","threadId":"37948","inReplyTo":"54643780.7060504@stormcloud9.net","subject":"Re: Set file modification time on checkout","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-13T05:04:15Z","receivedAt":"2014-11-13T05:04:15Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-11-13 05.45, Patrick Hemmer wrote:\n> The request is to allow git to set the file modification time on\n> checkout to the commit-author-date of the commit which last modified the\n> file.\n> Yes I know this is in the FAQ, but the FAQ entry is missing an\n> increasingly common use case: docker.\n> When docker builds an image, it generates layers of images based on each\n> build step. Adding a file would be a build step, and for this action it\n> generates a hash based on the file modification time & content.\nWhy do they do this?\nThe file content is the only thing that matters.\n\nThe other thing is to use a hook, utilizing test-chmtime\nfrom test-chmtime.c\n"}]}