git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re* [PATCH 2/3] t1301-*.sh: Fix the 'forced modes' test on cygwin

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 20, 2011, 19:31 UTC
Message-ID
<7v8vswcn9s.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<4DFCF6AF.3060502@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> No, that is indeed a bug. See commit 7974843 (compat/cygwin.c: make
> runtime detection of lstat/stat lessor impact, 23-10-2008).
Let's fix it while the bug has our attention, then.
-- >8 --
Subject: cygwin: trust executable bit by default

Earlier 7974843 (compat/cygwin.c: make runtime detection of lstat/stat lessor impact, 2008-10-23) fixed the low-level "do we use cygwin specific hacks for stat/lstat?" logic not to call into git_default_config() from random codepaths that are typically very late in the program, to prevent the call from potentially overwriting other variables that are initialized from the configuration.

However, it forgot that on Cygwin, trust-executable-bit should default to true.

Noticed by J6t, confirmed by Ramsay Jones, and the brown paper bag is on Gitster's head.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 compat/cygwin.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/compat/cygwin.c b/compat/cygwin.c
index b4a51b9..ba3327f 100644
--- a/compat/cygwin.c
+++ b/compat/cygwin.c
@@ -101,7 +101,7 @@ static int cygwin_stat(const char *path, struct stat *buf)
  * and calling git_default_config() from here would break such variables.
  */
 static int native_stat = 1;
-static int core_filemode;
+static int core_filemode = 1; /* matches trust_executable_bit default */
 
 static int git_cygwin_config(const char *var, const char *value, void *cb)
 {
Previous: Ramsay Jones
Message 7 of 7 in “t1301-*.sh: Fix the 'forced modes' test on cygwin”
  1. 2/3 t1301-*.sh: Fix the 'forced modes' test on cygwinRamsay Jones, Jun 16, 2011
  2. Junio C HamanoJun 16, 2011
  3. Ramsay JonesJun 17, 2011
  4. Johannes SixtJun 17, 2011
  5. Junio C HamanoJun 17, 2011
  6. Ramsay JonesJun 18, 2011
  7. Re* [PATCH 2/3] t1301-*.sh: Fix the 'forced modes' test on cygwinJunio C Hamano, Jun 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.