git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: "Junio C Hamano" <gitster@pobox.com>,
	"Torsten Bögershausen" <tboegi@web.de>
Cc: Jon Forrest <nobozo@gmail.com>, git@vger.kernel.org
Subject: Re: Odd Difference Between Windows Git and Standard Git
Date: Fri, 20 May 2016 18:12:47 +0200	[thread overview]
Message-ID: <5067f10f-a12e-c6e6-493b-5ff14dae4380@web.de> (raw)
In-Reply-To: <xmqqy474g3cv.fsf@gitster.mtv.corp.google.com>

On 20.05.16 17:23, Junio C Hamano wrote:
> Torsten Bögershausen <tboegi@web.de> writes:
> 
>>>> What does
>>>> git diff
>>>> say ?
>>>
>>> Great question. For all the unexpected files it says the
>>> same thing:
>>>
>>> old mode 100755
>>> new mode 100644
>>
>> So the solution is to run
>> git config  core.filemode false
> 
> Thanks for asking a great question.  I somehow expected that we
> probe in init-db.c::create_default_files() for this when we probe
> for case sensitivity, symlinks, etc., but apparently we don't.
> 
> I guess we don't because on some filesystems we can't.  IIRC, it
> goes something like: chmod immediately followed by lstat pretends
> that change to the executable bit stuck, until the in-core buffer at
> the vfs layer is flushed to the disk platter that holds the
> filesystem without any notion of executable bit.

We do the probing, when the repo is cloned, and then never again.
If I clone the repo under Windows, the probing gives core.filemod false.
If I clone under Linux, the probing gives core.filemod true.

Unfortunatly Git for Windows looks at core.filemode, when looking
at the working tree, even if the stat() implementation never detects
the executable bit.

A fix could look like this:
 
static int git_default_core_config(const char *var, const char *value)
{
	/* This needs a better name */
	if (!strcmp(var, "core.filemode")) {
#ifndef GIT_WINDOWS_NATIVE
		trust_executable_bit = git_config_bool(var, value);
#endif
		return 0;
	}

  reply	other threads:[~2016-05-20 16:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  1:48 Odd Difference Between Windows Git and Standard Git Jon Forrest
2016-05-20 13:19 ` Torsten Bögershausen
2016-05-20 13:48   ` Jon Forrest
2016-05-20 14:19     ` Torsten Bögershausen
2016-05-20 14:28       ` Jon Forrest
2016-05-20 15:57         ` Torsten Bögershausen
2016-05-20 15:23       ` Junio C Hamano
2016-05-20 16:12         ` Torsten Bögershausen [this message]
2016-05-20 16:21         ` Junio C Hamano
2016-05-23 11:12           ` Johannes Schindelin
2016-05-23 13:44             ` Jon Forrest
2016-05-23 15:08               ` Johannes Schindelin
2016-05-23 18:52             ` Junio C Hamano
2016-05-24  4:52               ` Torsten Bögershausen
2016-05-24 11:57                 ` Johannes Schindelin
2016-05-25  4:36                   ` Torsten Bögershausen
2016-05-25 11:52                     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5067f10f-a12e-c6e6-493b-5ff14dae4380@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nobozo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).