git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Set file modification time on checkout

From
Torsten Bögershausen <tboegi@web.de>
Date
Nov 13, 2014, 05:04 UTC
Message-ID
<54643BCF.5000900@web.de>
In-Reply-To
<54643780.7060504@stormcloud9.net>
On 2014-11-13 05.45, Patrick Hemmer wrote:
Show 8 quoted lines
> 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

Previous: Patrick Hemmer
Message 2 of 2 in “Set file modification time on checkout”
  1. Patrick HemmerNov 13, 2014
  2. Torsten BögershausenNov 13, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.