Subject: Re: Git destroys u+s and g+s directory modes

From: Gabor Gombas <[email-masked]>
Date: Sat, 27 Dec 2025 22:49:55 +0100

On Sat, Dec 27, 2025 at 03:40:11PM +0100, Hadmut Danisch wrote:

> This does not solve the problem, since ACLs do not propagate into newly
> created subdirectories, as group ownership with S_ISGID flag does.
> 
> 
> Please try to understand the problem before trying to solve it.

Well, default ACLs may very well be the solution to your problem,
because git does not understand ACLs, so it would leave them alone. Of
coure, managing ACLs at scale have their fair share of problems, so
YMMV. The problem with the permission bits is git trying to be clever
and thinking it can manage them - but as often, trying to be clever ends
up not being clever at all. Unfortunately, there does not seem to be a
configuration option to tell git to leave permission bits alone.
core.filemode is the closest one, but what you want is the opposite
behavior - what you want is not ignoring the executable bit, but
ignoring everything _except_ the executable bit. Maybe you can try to
make a patch...

Regards,
Gabor