From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126819 invoked by alias); 4 Sep 2015 15:12:37 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 126810 invoked by uid 89); 4 Sep 2015 15:12:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Sep 2015 15:12:35 +0000 Received: by wibz8 with SMTP id z8so20934328wib.1 for ; Fri, 04 Sep 2015 08:12:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=FbwCBsgQL6AB1itxWWR0kMVU9+HJkou2kmwAf+w3fME=; b=PTAgxDt/+0HkkHph2jCwWM9gAO0vAkYbiPmB35d7WVSh9pvA+kXSwGt5ipXyIi2tCH iTOVSrEbWp7Kmnu/FeegSiYu303EFOISNWC87WAPS/8j+Tdw0wHYJeQX/zhPeEkan0k3 5JPtnliZImSnnpfAHpeuwqp4UV/hEf1eK+iUDYzOTXwuYjbY3sbzqQ8a0Igvaoi73Q/W 2Xj7gDRjew9fVCnSNH1Azuj0pozVSUKpQjymTMholRq/5yYZYPo+FPaYfg8FL+nxkjzs 1GfAbQTWi7o6W7FJR38Y4u8ObAP4RKjUyp8n9FtsJ+gne/vSeCIVq5Z7OurhX00e5QJ7 e1ag== X-Gm-Message-State: ALoCoQlIaq/3lnPPOICDO6O6zSjev6OqIn1UXGS2Y78L7VYSjIYQorxkWCVT11rSKrhHrOgmnxnb X-Received: by 10.194.179.6 with SMTP id dc6mr8110711wjc.39.1441379551906; Fri, 04 Sep 2015 08:12:31 -0700 (PDT) Received: from dinwoodie.org ([2001:ba8:0:1c0::9:1]) by smtp.gmail.com with ESMTPSA id uc12sm4890680wib.13.2015.09.04.08.12.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Sep 2015 08:12:31 -0700 (PDT) Date: Fri, 04 Sep 2015 15:12:00 -0000 From: Adam Dinwoodie To: cygwin@cygwin.com Subject: Re: Problem with git and file mode changes Message-ID: <20150904151229.GB14466@dinwoodie.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00072.txt.bz2 On Fri, Sep 04, 2015 at 04:44:11PM +0200, Dani Moncayo wrote: > After doing a 'git pull', I saw that git didn't make the merge, > because apparently I had some local changes. But I didn't make > any local change. For example, this file appears as modified: > > $ git status --short test/rmailmm.el > M test/rmailmm.el > > $ git diff test/rmailmm.el > diff --git a/test/rmailmm.el b/test/rmailmm.el > old mode 100644 > new mode 100755 > > Mmm strange, I never changed the permissions of any file in my > repo. And moreover: > > $ ls -o test/rmailmm.el > -rwxrwxr--+ 1 Dani 3106 Sep 4 16:19 test/rmailmm.el > > According to 'ls', the file mode is 774, but according to git is > 755. Which one is wrong? Git internally only stores file permissions of 755 or 644*; anything else is mapped down to one of those two, based (I believe) on whether the user execute bit is set or not. > Well, let's try to revert the misterious change: > > $ git checkout test/rmailmm.el > > $ git status --short test/rmailmm.el > M test/rmailmm.el > > $ git diff test/rmailmm.el > diff --git a/test/rmailmm.el b/test/rmailmm.el > old mode 100644 > new mode 100755 > > $ ls -o test/rmailmm.el > -rwxrwxr--+ 1 Dani 3106 Sep 4 16:28 test/rmailmm.el > > Apparently nothing has changed after the 'git checkout'!! It looks like the underlying file system is failing to record the file permissions correctly**. That could be a limitation of the file system (FAT32 is much more limited than NTFS, for example, and I could believe permissions go very wrong over network shares), of the options with which the filesystem is mounted in Cygwin (take a look for "noacl" in the Cygwin FAQs), or possibly just that you don't have permission to change the file properties (although I'd expect an error in that scenario). Another option is that some non-Cygwin program is getting in the way and interfering with the permissions. The underlying problem here is that Cygwin is trying to write a file without the executable bit set, but whenever it checks the filesystem, it sees the executable bit is set, and so has to assume that's a change. If you can't fix the filesystem, you can tell Git to ignore the filesystem executable bit with git config --global --bool core.fileMode false (Remove the `--global` to only change it for the current repository.) If you do that, you'll need to use `git update-index` if you need to change the executable bit as recorded in the Git repository; see `git help update-index` under the `--chmod` option for details. HTH Adam * There are some special values stored in the same way as permissions to denote things like submodules or symlinks, but the above is correct as far as simple files are concerned. ** Where by "correctly" I mean "in the POSIX-like style that Cygwin understands and uses"; it probably is correct from a Windows perspective. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple