* Set file modification time on checkout
@ 2014-11-13 4:45 Patrick Hemmer
2014-11-13 5:04 ` Torsten Bögershausen
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Hemmer @ 2014-11-13 4:45 UTC (permalink / raw)
To: git
The request is to allow git to set the file modification time on
checkout to the commit-author-date of the commit which last modified the
file.
Yes I know this is in the FAQ, but the FAQ entry is missing an
increasingly common use case: docker.
When docker builds an image, it generates layers of images based on each
build step. Adding a file would be a build step, and for this action it
generates a hash based on the file modification time & content. Next
time the image is built, if these haven't changed, the previously built
layer is reused. And like git commit history, if a layer changes, the
hash of all subsequent layers change and have to be rebuilt. So reusing
layers can save a ton of time.
Now I'm not proposing that this be made the default action. The `make`
use case is legitimate. But it would be nice to have an option for
`checkout` and `reset` which toggles the behavior.
-Patrick
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Set file modification time on checkout
2014-11-13 4:45 Set file modification time on checkout Patrick Hemmer
@ 2014-11-13 5:04 ` Torsten Bögershausen
0 siblings, 0 replies; 2+ messages in thread
From: Torsten Bögershausen @ 2014-11-13 5:04 UTC (permalink / raw)
To: Patrick Hemmer, git
On 2014-11-13 05.45, Patrick Hemmer wrote:
> The request is to allow git to set the file modification time on
> checkout to the commit-author-date of the commit which last modified the
> file.
> Yes I know this is in the FAQ, but the FAQ entry is missing an
> increasingly common use case: docker.
> When docker builds an image, it generates layers of images based on each
> build step. Adding a file would be a build step, and for this action it
> generates a hash based on the file modification time & content.
Why do they do this?
The file content is the only thing that matters.
The other thing is to use a hook, utilizing test-chmtime
from test-chmtime.c
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-13 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 4:45 Set file modification time on checkout Patrick Hemmer
2014-11-13 5:04 ` Torsten Bögershausen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).