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

Reset sometimes updates mtime

From
Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date
Jul 9, 2015, 14:02 UTC
Message-ID
<1436450534.15519.49.camel@kaarsemaker.net>

I'm seeing some behaviour with git reset that I find odd. Basically if I do

git fetch && \ git reset --hard simple-tag-that-points-to-the-current-commit

sometimes the reset will update the mtime of all files and directories in the repo and sometimes it will leave them alone. Changing it to

git fetch && \ git status && \ git reset --hard simple-tag-that-points-to-the-current-commit

Cause the mtime update to reliably not happen.

Bad thing is that I am relying on the mtime updates not to happen if the files don't actually change. Is this an assumption I can safely make? If it is, then I'll debug further (e.g. I don't even know yet if the file gets rewritten or just touched, why the index gets updated as well etc.).

-- 
Dennis Kaarsemaker
http://www.kaarsemaker.net
Next: Junio C Hamano
Message 1 of 3 in “Reset sometimes updates mtime”
  1. Dennis KaarsemakerJul 9, 2015
  2. Junio C HamanoJul 9, 2015
  3. Dennis KaarsemakerJul 10, 2015

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.