From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: gets "-dirty" under fakeroot Date: Tue, 23 Jan 2007 19:59:17 +0900 Message-ID: <87ac0auhyy.wl@mail2.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-From: git-owner@vger.kernel.org Tue Jan 23 11:59:24 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1H9JN5-0004kl-OX for gcvg-git@gmane.org; Tue, 23 Jan 2007 11:59:24 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932961AbXAWK7U (ORCPT ); Tue, 23 Jan 2007 05:59:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932963AbXAWK7U (ORCPT ); Tue, 23 Jan 2007 05:59:20 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:40153 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932961AbXAWK7U (ORCPT ); Tue, 23 Jan 2007 05:59:20 -0500 Received: from wat.atmark-techno.com.atmark-techno.com (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 83D4E3BC3B; Tue, 23 Jan 2007 19:59:17 +0900 (JST) To: git@vger.kernel.org User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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