From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Hourihane Subject: Re: new platform & S_IFGITLINK problem Date: Thu, 22 Jul 2010 17:23:32 +0100 Message-ID: <1279815812.7796.5499.camel@jetpack.demon.co.uk> References: <1272756555.13488.1314.camel@jetpack.demon.co.uk> <7vfx2b2ft5.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Thu Jul 22 18:36:17 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Obykp-000563-E4 for gcvg-git-2@lo.gmane.org; Thu, 22 Jul 2010 18:36:15 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755797Ab0GVQgL (ORCPT ); Thu, 22 Jul 2010 12:36:11 -0400 Received: from fairlite.demon.co.uk ([80.176.228.186]:56959 "EHLO fairlite.demon.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572Ab0GVQgJ (ORCPT ); Thu, 22 Jul 2010 12:36:09 -0400 X-Greylist: delayed 749 seconds by postgrey-1.27 at vger.kernel.org; Thu, 22 Jul 2010 12:36:08 EDT Received: from localhost (unknown [127.0.0.1]) by fairlite.demon.co.uk (Postfix) with ESMTP id A131A2088DE; Thu, 22 Jul 2010 16:23:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at demon.co.uk Received: from fairlite.demon.co.uk ([127.0.0.1]) by localhost (server.demon.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6HaBVC+HlYRa; Thu, 22 Jul 2010 17:23:32 +0100 (BST) Received: from [192.168.0.50] (jetpack.demon.co.uk [192.168.0.50]) by fairlite.demon.co.uk (Postfix) with ESMTP id 85689208897; Thu, 22 Jul 2010 17:23:32 +0100 (BST) In-Reply-To: <7vfx2b2ft5.fsf@alter.siamese.dyndns.org> X-Mailer: Evolution 2.28.3.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Sat, 2010-05-01 at 19:33 -0700, Junio C Hamano wrote: > Alan Hourihane writes: > > > Just joined as I'm compiling git on a new platform and wondered if > > someone can help solve a problem with the definition of S_IFGITLINK. > > Yikes. The current codebase pretty much assumes that IFREG is 0100000, > IFDIR 0040000, and IFLNK 0120000, and the bits read from "struct stat" and > the mode bits we store in the index and tree objects are interchangeable. > > Yes, that assumption is a gross POSIX violation but we so far haven't seen > any platform that matters in real life that assigns the IFMT bits > differently. > > We would need to: > > (1) rename S_IFGITLINK to GIT_S_IFMODULE; > > (2) define GIT_S_IF{REG,DIR,LNK} as 0100000, 0040000, and 0120000; > > (3) write MODE_SYSTEM_TO_GIT() macro to convert from S_IF{REG,DIR,LNK} we > read from struct stat to the "canonical" GIT_S_IF{REG,DIR,LNK} > values; and > > (4) change all the code that read mode from struct stat and use it to > first use MODE_SYSTEM_TO_GIT(). > > Currently 'git grep -e "S_IF[A-Z]" -e "struct stat"' reports around 250 > hits, so it is not infeasible amount of work, but it is not a trivial and > mechanical replacement, either. I or somebody need to set aside a block > of time to do this clean-up and audit the result. > > Thanks for a report. Hi Junio, Is there any ETA on fixing this up ? Thanks, Alan.