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

Re: git-diff-files and fakeroot

From
Junio C Hamano <junkio@cox.net>
Date
Jan 17, 2006, 02:33 UTC
Message-ID
<7v7j8zlh1p.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<43CC5231.3090005@michonline.com>
Ryan Anderson <ryan@michonline.com> writes:
Show 7 quoted lines
> Oddly, running "git status" seems to correct things.
>
> Running "fakeroot git-diff-files" gives me lines like this:
>
> :100644 100644 f866059f24bacd314fa4a979334a9893dbfc19ba 0000000000000000000000000000000000000000 M      write-tree.c
>
> Looking at strace output, I can't see a difference that appears meaningful,
How does fakeroot keep track of fake ownerships?
That is, I suspect:
	$ date >foo
	$ ls -l foo
	-rw-rw-r--  1 junio junio 29 Jan 16 18:29 foo
	$ fakeroot sh -i
        # ls -l foo
	-rw-rw-r--  1 root root 29 Jan 16 18:29 foo

which means that under fakeroot, stat would give file ownerships for *my* files as if they are owned by root.

And of course .git/index records the as me and fakeroot has no way of knowing me maps to root in that fake environment.

"git status" includes "git update-index --refresh", which reads from the stat bits and ownerships, notices that file contents have not changed, and writes a new index file that records these stat bits (so git thinks they are now owned by root).

If you come out of the fakeroot environment, I am reasonably sure that you would find all the index entries are dirty again, for exactly the same reason. index thinks things are owned by root, the files are owned by you, so without looking at file contents, it says "these things might have changed".

	
Previous: Ryan AndersonNext: Junio C Hamano
Message 2 of 7 in “git-diff-files and fakeroot”
  1. Ryan AndersonJan 17, 2006
  2. Junio C HamanoJan 17, 2006
  3. Junio C HamanoJan 17, 2006
  4. Ryan AndersonJan 17, 2006
  5. Kyle MoffettJan 17, 2006
  6. Ryan AndersonJan 17, 2006
  7. Sam RavnborgJan 17, 2006

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.