From: Junio C Hamano Date: Tue, 17 Jan 2006 02:33:22 GMT Subject: Re: git-diff-files and fakeroot Message-ID: <7v7j8zlh1p.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <43CC5231.3090005@michonline.com> Ryan Anderson writes: > 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".