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

Re: Unfortunate interaction between git diff-index and fakeroot

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 8, 2017, 15:38 UTC
Message-ID
<xmqqwp1x9qm0.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<a770d158-c472-206f-dcdc-55cea0cf308f@oracle.com>
Elazar Leibovich <elazar.leibovich@oracle.com> writes:
> ignore unused information, such as commit
> 2cb45e95438c113871fbbea5b4f629f9463034e7
> which ignores st_dev, because it doesn't actually matter, or

I do not think it ignores because "it doesn't matter". st_dev is known not to be stable (e.g. across reboots and reconnects nfs), so it is a poor indicator to use as a quick measure to see if the file contents may have changed since we last checked. On the other hand, in a sane (it is of course open to debate "by whose definition") environment, the fact that the owner of the file has changed _is_ a significant enough sign to suspect that the file contents have changed (i.e. the file is suspect to be dirty; you can actually check and refresh, of course, though).

> commit e44794706eeb57f2ee38ed1604821aa38b8ad9d2 which ignores
> mode changes not relevant to the owner.

And that one is not even about the cached stat information used for the quick "dirty-ness" check. The change is about the mode bits in recorded history.

File's mtime is not recorded in the history, either, but we do care and record it in the index, because it can be used as a good (albeit a bit too coarse grained) indicator that the contents of a file may have changed.

The owner and group fall into the same category.
Previous: Elazar Leibovich
Message 4 of 4 in “Unfortunate interaction between git diff-index and fakeroot”
  1. Elazar LeibovichDec 7, 2017
  2. Junio C HamanoDec 7, 2017
  3. Elazar LeibovichDec 8, 2017
  4. Junio C HamanoDec 8, 2017

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.