{"thread":{"id":"6486","subject":"gets \"-dirty\" under fakeroot","startedAt":"2007-01-23T10:59:17Z","lastAt":"2007-01-24T00:27:47Z","messageCount":3,"participants":["Yasushi SHOJI","Matthias Lederhofer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32378","messageId":"87ac0auhyy.wl@mail2.atmark-techno.com","threadId":"6486","inReplyTo":null,"subject":"gets \"-dirty\" under fakeroot","fromName":"Yasushi SHOJI","fromEmail":"yashi@atmark-techno.com","sentAt":"2007-01-23T10:59:17Z","receivedAt":"2007-01-23T10:59:17Z","isPatch":false,"sender":{"key":"yashi@atmark-techno.com","avatar":"https://gravatar.com/avatar/4817e8703ac4379935834d87453faa9d0c94b9dc19d83fcc54c67875eb133e59?d=mp&s=160"},"body":"Hi,\n\nI noticed that compiling git under fakeroot always gives me \"-dirty\"\nin the version string even though the working directory is clean.\n\nGit generates version string with GIT-VERSION-GEN. in the script,\nworking directory is checked to see whether it's clean or not.  if you\nrun the script under fakeroot, it always say the working directory is\ndirty. that is, git diff-index HEAD reports files have changed.\n\nthat is because under fakeroot, we get faked value 0 for uid and gid,\nbut we already have our own uid/gid in the cache. those two values are\ncompared in ce_match_stat_basic()::read-cache.c:\n\n\tif (ce->ce_uid != htonl(st->st_uid) ||\n\t    ce->ce_gid != htonl(st->st_gid))\n\t\tchanged |= OWNER_CHANGED;\n\nI noticed that the code fragment is important because:\n    /*\n     * dev/ino/uid/gid/size are also just tracked to the low 32 bits\n     * Again - this is just a (very strong in practice) heuristic that\n     * the inode hasn't changed.\n\n\nNow what should I do?\n\n1) run git update-index --refresh with fakeroot before doing\n   diff-index.\n\n2) add --except-uid-gid to diff-index\n\n3) just don't care about the \"-dirty\" string.\n\n4) do whatever I do under real root env.\n\n\nHow do you guys do when you create snapshot package like rpm or deb?\nor is this just me?\n\nregards,\n-- \n          yashi\n"},{"id":"32406","messageId":"20070123142219.GA21219@moooo.ath.cx","threadId":"6486","inReplyTo":"87ac0auhyy.wl@mail2.atmark-techno.com","subject":"Re: gets \"-dirty\" under fakeroot","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-01-23T14:22:19Z","receivedAt":"2007-01-23T14:22:19Z","isPatch":false,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Yasushi SHOJI <yashi@atmark-techno.com> wrote:\n> How do you guys do when you create snapshot package like rpm or deb?\n> or is this just me?\nUse fakeroot -u.\n"},{"id":"32465","messageId":"873b61l14s.wl@mail2.atmark-techno.com","threadId":"6486","inReplyTo":"20070123142219.GA21219@moooo.ath.cx","subject":"Re: gets \"-dirty\" under fakeroot","fromName":"Yasushi SHOJI","fromEmail":"yashi@atmark-techno.com","sentAt":"2007-01-24T00:27:47Z","receivedAt":"2007-01-24T00:27:47Z","isPatch":false,"sender":{"key":"yashi@atmark-techno.com","avatar":"https://gravatar.com/avatar/4817e8703ac4379935834d87453faa9d0c94b9dc19d83fcc54c67875eb133e59?d=mp&s=160"},"body":"At Tue, 23 Jan 2007 15:22:19 +0100,\nMatthias Lederhofer wrote:\n> \n> Yasushi SHOJI <yashi@atmark-techno.com> wrote:\n> > How do you guys do when you create snapshot package like rpm or deb?\n> > or is this just me?\n> Use fakeroot -u.\n\nA ha!\n\nThanks, it worked like a charm.\n-- \n        yashi\n"}]}