From: Junio C Hamano <hidden> Date: 2016-06-15 22:43:38
Martin Waitz [off-list ref] writes:
hoi :)
On Wed, Oct 03, 2007 at 11:23:22PM -0700, Junio C Hamano wrote:
quoted
filemode = !( (st1.st_mode & S_IXUSR)
/* we did not ask for x-bit -- bogus FS */
|| chmod(path, st1.st_mode & S_IXUSR)
/* it does not let us flip x-bit -- bogus FS */
|| lstat(path, &st2)
/* it does not let us read back -- bogus FS */
|| (st1.st_mode == st2.st_mode)
/* it forgets we flipped -- bogus FS */
);
that looks good.
FWIW, I did not mean it to be an example for preferred
indentation nor code layout, but as a better way to explain what
the logic is computing.
I do not think git on Cygwin nor WinGit creates $GIT_DIR/config
with executable bit set. Is this pretty much a workaround only
for vfat-on-Linux ?
From: Johannes Sixt <hidden> Date: 2016-06-15 22:43:38
Junio C Hamano schrieb:
Martin Waitz [off-list ref] writes:
quoted
On Wed, Oct 03, 2007 at 11:23:22PM -0700, Junio C Hamano wrote:
quoted
filemode = !( (st1.st_mode & S_IXUSR)
/* we did not ask for x-bit -- bogus FS */
|| chmod(path, st1.st_mode & S_IXUSR)
/* it does not let us flip x-bit -- bogus FS */
|| lstat(path, &st2)
/* it does not let us read back -- bogus FS */
|| (st1.st_mode == st2.st_mode)
/* it forgets we flipped -- bogus FS */
);
that looks good.
I do not think git on Cygwin nor WinGit creates $GIT_DIR/config
with executable bit set. Is this pretty much a workaround only
for vfat-on-Linux ?
I think so. Here on Windows, 'ls -l' after 'git init' tells that .git/config
is not executable (both FAT and NTFS). But, anyway, as far as the MinGW port
is concerned, at least the last condition in the sequence above triggers and
causes filemode=false, which is good.
-- Hannes
From: Martin Waitz <hidden> Date: 2016-06-15 22:43:38
hoi :)
On Thu, Oct 04, 2007 at 01:21:02AM -0700, Junio C Hamano wrote:
FWIW, I did not mean it to be an example for preferred
indentation nor code layout, but as a better way to explain what
the logic is computing.
sure, and I think it makes sense the way you wrote it.
I do not think git on Cygwin nor WinGit creates $GIT_DIR/config
with executable bit set. Is this pretty much a workaround only
for vfat-on-Linux ?
I just checked Cygwin, it creates files without executable bit and
disregards a chmod +x. So yes, this seems to be a Linux-only problem.
--
Martin Waitz
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:43:38
Hi,
On Thu, 4 Oct 2007, Junio C Hamano wrote:
I do not think git on Cygwin nor WinGit creates $GIT_DIR/config with
executable bit set. Is this pretty much a workaround only for
vfat-on-Linux ?
I do not know precisely about Cygwin (a quick test on my USB stick shows
that .git/config is created without the executable bit set), but in MSys
plain files which start with a she-bang are automatically +x, while all
other plain files are automatically -x (therefore this applies to
.git/config).
Given these findings, I fail to see what the patch should achieve, as
the first test (for -x) always succeeds...
Ciao,
Dscho
From: Jan Hudec <hidden> Date: 2016-06-15 22:43:40
On Thu, Oct 04, 2007 at 10:42:37 +0200, Martin Waitz wrote:
hoi :)
On Thu, Oct 04, 2007 at 01:21:02AM -0700, Junio C Hamano wrote:
quoted
FWIW, I did not mean it to be an example for preferred
indentation nor code layout, but as a better way to explain what
the logic is computing.
sure, and I think it makes sense the way you wrote it.
quoted
I do not think git on Cygwin nor WinGit creates $GIT_DIR/config
with executable bit set. Is this pretty much a workaround only
for vfat-on-Linux ?
I just checked Cygwin, it creates files without executable bit and
disregards a chmod +x. So yes, this seems to be a Linux-only problem.
AFAIR in cygwin it depends on both configuration of cygwin and whether you
are on NTFS or FAT. On NTFS with proper setting (CYGWIN=ntsec IIRC), cygwin
actually implements the x bit (uses the NT ACL to somewhat represent it). On
other filesystem there is an option somewhere to tell whether it should show
the x bit always set or always cleared (for me it seems to be always set).
On the other hand MSYS shows the x bit as set whenever the file has
executable extension. I don't think cygwin has this mode.
--
Jan 'Bulb' Hudec [off-list ref]