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

Re: [PATCH v2 1/2] create_default_files(): don't set u+x bit on $GIT_DIR/config

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Nov 17, 2014, 11:32 UTC
Message-ID
<5469DCCE.8040801@alum.mit.edu>
In-Reply-To
<5469BAFA.7070709@web.de>
On 11/17/2014 10:08 AM, Torsten Bögershausen wrote:
Show 17 quoted lines
> On 11/17/2014 02:40 AM, Eric Sunshine wrote:
>> On Sun, Nov 16, 2014 at 2:21 AM, Michael Haggerty
>> <mhagger@alum.mit.edu> wrote:
>>> [...]
> Sorry for the late reply, I actually had prepared a complete different
> patch
> for a different problem, but it touches the very same lines of code.
> 
> (And we may want to add a
> !chmod(path, st1.st_mode & ~S_IXUSR)
> at the end of the operation)
> 
> There are systems when a file created with 666 have 766, and we
> do not handle this situation yet.
> 
> Michael, if there is a chance that you integrate my small code changes
> in your patch ?

Your change seems like a good idea, but is is logically separate from mine and I think it would be awkward to yoke them together. Both changes are short enough that conflict resolution shouldn't be a big problem.

It will be easier for you to follow up on your patch if you submit it separately. The first question you get might be: "Should it be applied to maint or is it more suitable for master?", which also hints at one of the reasons that yoking the patches together might be awkward.

Regarding your patch itself:
Show 10 quoted lines
> [...]
>     b) The user executable bit is always 1
>     c) Is similar to b):
>        When a file is created with mode 0666 the file mode on disc is 766
>        and the user executable bit is 1 even if it should be 0 like b)
> 
>        There are smbfs implementations where the file mode can be maintained
>        locally and chmod -x changes the file mode from 0766 to 0666.
>        When the file system is unmounted and remounted,
>        the file mode is 0766 and executable bit is 1 again.

It seems surprising that there isn't also a case (d) like (c) except that a file created with mode 0666 initially has the correct mode, and the executable bits can be maintained locally while the filesystem is mounted, but where executable bits are lost whenever the filesystem is unmounted and remounted. Does that case not arise, or is it simply that it is impossible to test for it in create_default_files()?

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
Previous: Torsten BögershausenNext: Michael Haggerty
Message 7 of 14 in “Don't make $GIT_DIR executable”
  1. 0/2 Don't make $GIT_DIR executableMichael Haggerty, Nov 16, 2014
  2. 1/2 create_default_files(): don't set u+x bit on $GIT_DIR/configMichael Haggerty, Nov 16, 2014
  3. Junio C HamanoNov 16, 2014
  4. Michael HaggertyNov 17, 2014
  5. Eric SunshineNov 17, 2014
  6. Torsten BögershausenNov 17, 2014
  7. Michael HaggertyNov 17, 2014
  8. Michael HaggertyNov 17, 2014
  9. Junio C HamanoNov 17, 2014
  10. Michael HaggertyNov 17, 2014
  11. Junio C HamanoNov 17, 2014
  12. 2/2 config: clear the executable bits (if any) on $GIT_DIR/configMichael Haggerty, Nov 16, 2014
  13. Johannes SixtNov 16, 2014
  14. Michael HaggertyNov 17, 2014

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.