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

gets "-dirty" under fakeroot

From
Yasushi SHOJI <yashi@atmark-techno.com>
Date
Jan 23, 2007, 10:59 UTC
Message-ID
<87ac0auhyy.wl@mail2.atmark-techno.com>
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
Next: Matthias Lederhofer
Message 1 of 3 in “gets "-dirty" under fakeroot”
  1. Yasushi SHOJIJan 23, 2007
  2. Matthias LederhoferJan 23, 2007
  3. Yasushi SHOJIJan 24, 2007

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.