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

checkout with given mtime

From
Daniel Fanjul <daniel.fanjul.alcuten@gmail.com>
Date
Jan 21, 2019, 14:17 UTC
Message-ID
<CAPktr3kFpP-CwWxwQP37g2xvuztDBSf-ksbGKqTyK9E7hoifgw@mail.gmail.com>
Hi all,

When the mtimes of my tracked files are updated during usual git commands some other tools that depend on them have trouble. So I restore their mtimes for these other tools and then git ends rereading contents of files that have not changed. I would like to improve this.

Is there a way to check out a file with a given mtime so I do not have to update it later and force git to reread it?

Something like 'git checkout --mtime $mymtime -- $myfile'. If the file is not there or does not have the proper contents, git would write the file, set the mtime of the file and update the index accordingly. If the file is there and does have the proper contents according to the index, git would update the mtime of the file, update the index accordingly, and not read or write the contents at all.

Thanks, and regards, Daniel.

Message 1 of 1 in “checkout with given mtime”
  1. Daniel FanjulJan 21, 2019

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.