threads / discuss / 6486

gets "-dirty" under fakeroot

Subject: gets "-dirty" under fakeroot

## tl;dr

3 messages between Jan 23, 2007 and Jan 24, 2007.

replies: 2people: 2as markdown or json

Yasushi SHOJI· Jan 23, 2007, 10:59 UTC · lore
Hi,

I noticed that compiling git under fakeroot always gives me "-dirty" in the version string even though the working directory is clean.

Git generates version string with GIT-VERSION-GEN. in the script, working directory is checked to see whether it's clean or not. if you run the script under fakeroot, it always say the working directory is dirty. that is, git diff-index HEAD reports files have changed.

that is because under fakeroot, we get faked value 0 for uid and gid, but we already have our own uid/gid in the cache. those two values are compared in ce_match_stat_basic()::read-cache.c:

	if (ce->ce_uid != htonl(st->st_uid) ||
	    ce->ce_gid != htonl(st->st_gid))
		changed |= OWNER_CHANGED;
I noticed that the code fragment is important because:
    /*
     * dev/ino/uid/gid/size are also just tracked to the low 32 bits
     * Again - this is just a (very strong in practice) heuristic that
     * the inode hasn't changed.
Now what should I do?
1) run git update-index --refresh with fakeroot before doing
   diff-index.
2) add --except-uid-gid to diff-index
3) just don't care about the "-dirty" string.
4) do whatever I do under real root env.

How do you guys do when you create snapshot package like rpm or deb? or is this just me?

regards,
-- 
          yashi
Yasushi SHOJI· Jan 24, 2007, 00:27 UTC · re: Matthias Lederhofer · lore

Re: gets "-dirty" under fakeroot

At Tue, 23 Jan 2007 15:22:19 +0100, Matthias Lederhofer wrote:

Show 5 quoted lines
> 
> Yasushi SHOJI <yashi@atmark-techno.com> wrote:
> > How do you guys do when you create snapshot package like rpm or deb?
> > or is this just me?
> Use fakeroot -u.
A ha!
Thanks, it worked like a charm.
-- 
        yashi

← back to recent threads