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

Re: A puzzle: reset --hard and hard links

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Jan 25, 2022, 08:49 UTC
Message-ID
<875yq842to.fsf@igel.home>
In-Reply-To
<CABrKpmDjrTPhL_55YaXEAVTEmu8iZEsKUJYab7OgK0=w9d_7MA@mail.gmail.com>
On Jan 24 2022, Michael Herrmann wrote:
Show 7 quoted lines
> My suspicion is that Git keeps a cache of the stat(...) result of
> files. An additional hard link increases the .st_nlink count of this
> struct. `git reset` compares the cached stat(...) values to the actual
> ones and sees that one has changed. `git status` does the same but is
> smart enough to realize that the additional hard link does not change
> anything. It writes this to the cache. `git reset` should also be
> smart!
See the core.trustctime config.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Previous: Michael HerrmannNext: Ævar Arnfjörð Bjarmason
Message 13 of 18 in “A puzzle: reset --hard and hard links”
  1. Michael HerrmannJan 19, 2022
  2. brian m. carlsonJan 19, 2022
  3. Junio C HamanoJan 19, 2022
  4. Michael HerrmannJan 20, 2022
  5. brian m. carlsonJan 20, 2022
  6. Michael HerrmannJan 21, 2022
  7. Michael HerrmannJan 24, 2022
  8. Junio C HamanoJan 24, 2022
  9. Michael HerrmannJan 24, 2022
  10. Junio C HamanoJan 24, 2022
  11. rsbecker@nexbridge.comJan 24, 2022
  12. Michael HerrmannJan 24, 2022
  13. Andreas SchwabJan 25, 2022
  14. Ævar Arnfjörð BjarmasonJan 25, 2022
  15. Andreas SchwabJan 25, 2022
  16. Michael HerrmannJan 25, 2022
  17. brian m. carlsonJan 26, 2022
  18. Junio C HamanoJan 26, 2022

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.