public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* Git destroys u+s and g+s directory modes
@ 2025-12-27  2:37 Hadmut Danisch
  2025-12-27 13:56 ` Michal Suchánek
  2026-01-02  7:55 ` Jeff King
  0 siblings, 2 replies; 9+ messages in thread
From: Hadmut Danisch @ 2025-12-27  2:37 UTC (permalink / raw)
  To: git

Hi,

(please respond to my e-mail as well, not just to the list, I'm not 
subscribed),


I do have a problem with git 2.43.0 (ubuntu server 24.04.3) and 
directory modes:


I do need my git repo (owned by me) to be readable by a system user 
(running a rootless podman container).

I therefore set a special group for the directory, and set the sgid bit 
of the directory ( chgrp ... and chmod 2770 ), but when doing a git 
clone onto that directory, git rewrites all file modes, including the 
one of the root directory, and the  S_ISGID is lost.


The only setting I found about file modes is core.fileMode, but git docs 
tell that this is for file systems that do not keep permissions 
correctly, such as CIFS or Windows bases file systems, not for keeping 
git from changing.

The only way I found is to define a hook to correctly set modes after 
git pull.


Is there a way to keep git from destroying group permission and S_ISGID?


If not: Proposal to set a bit mask with file mode flags git shouldn't touch?


regards

Hadmut





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-02  7:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-27  2:37 Git destroys u+s and g+s directory modes Hadmut Danisch
2025-12-27 13:56 ` Michal Suchánek
2025-12-27 14:27   ` rsbecker
2025-12-27 14:40     ` Hadmut Danisch
2025-12-27 15:12       ` Andreas Schwab
2025-12-27 15:19       ` rsbecker
2025-12-27 21:49       ` Gabor Gombas
2025-12-27 14:44   ` Hadmut Danisch
2026-01-02  7:55 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox