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

Re: [RFC] Preserve per-file historical mtimes from Git history

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 2, 2026, 01:28 UTC
Message-ID
<xmqqqzi83n86.fsf@gitster.g>
In-Reply-To
<011ad911-2d62-4179-b3a7-e14aab79f18a@gmx.com>
"Artem S. Tashkinov" <aros@gmx.com> writes:

Omitting parts and details that are not interesting (to me) from the list.

>    3. How should rename following behave across complicated/non-linear
>       history?

You'd also want to think about what should happen when somebody concatenates two files to create one. No new contents are introduced to the tree.

As to the definition of the historical times, I would find it a lot more natural if they behaved as if you did this:

 * Prepare "git rev-list --first-parent --reverse HEAD" to prepare
   a list of commits that historically appeared at the tip of the
   trunk.
 * Make a checkout of the first commit in the list; give all the
   working tree files the committer timestamp of that commit.
 * Repeatedly run "git checkout" of the next commit, which should
   replace the paths that differ from the previous commit.  Give
   these paths the committer timestamp of the current commit.
   Repeat this process until you run out of the list.

and then looked at timestamp of each surviving paths in the working tree.

>    5. Would it make sense for `git archive` to optionally use these
>       historical per-file timestamps for archive members?

Yes, it would be interesting to teach "git archive" to produce a tarball with these synthesized timestamps.

Previous: Artem S. Tashkinov
Message 2 of 2 in “[RFC] Preserve per-file historical mtimes from Git history”
  1. Artem S. TashkinovOct 1, 2026
  2. Junio C HamanoOct 2, 2026

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.