git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Hemmer <git@stormcloud9.net>
To: git@vger.kernel.org
Subject: Set file modification time on checkout
Date: Wed, 12 Nov 2014 23:45:52 -0500	[thread overview]
Message-ID: <54643780.7060504@stormcloud9.net> (raw)

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

             reply	other threads:[~2014-11-13  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  4:45 Patrick Hemmer [this message]
2014-11-13  5:04 ` Set file modification time on checkout Torsten Bögershausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54643780.7060504@stormcloud9.net \
    --to=git@stormcloud9.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).