From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
K_V <zinen2@gmail.com>,
git@vger.kernel.org
Subject: Re: git gc changes ownerships of files linux
Date: Sun, 11 Feb 2024 08:43:33 -0800 [thread overview]
Message-ID: <xmqqcyt39cju.fsf@gitster.g> (raw)
In-Reply-To: <20240211154345.GA28699@tb-raspi4> ("Torsten Bögershausen"'s message of "Sun, 11 Feb 2024 16:43:45 +0100")
Torsten Bögershausen <tboegi@web.de> writes:
> Briam, Hm, I wonder what this function (in path.c) does:
>
> int adjust_shared_perm(const char *path)
>
> According to my understanding, it was included into the Git codebase
> to work around the missing "setgid" feature in Linux (and probably cygwin).
No. "g+s on directory" is required and depended upon for getting
the correct group ownership. We do not do anything to chown(2) a
filesystem entry to force what group it is owned by there.
What adjust_shared_perm() does is to counter what the screwed-up
umask settings the user may have causes. If you are a member of a
group and working in a directory owned by the group with other
members, you want to make sure others in the group can access the
files and the directories in the project. Their umask should be
loosened to at least 027 and preferrably to 007 to give group
members the same access as you do. Yet people do not loosen their
umask when starting work in such a group owned directory that is
supposed to be shared, as it would be extremely cumbersome to do
[*]. These users end up creating files with overly tight permission
bits, e.g. 0644 or 0700, and we go in with adjust_shared_perm() to
fix these modes.
You definitely must set up your initial directory with g+s if you
are usihng the group-writable shared directory model (which I would
actually be surprised to see in 2020---is a shared machine with more
than one user-account still a thing???); adjust_shared_perm() will
not help you there.
[Footnote]
* Unless, of course, you use some sort of "hook" in the shell to
notice you switched to a certain directory and run command
there---some people achieve this by aliasing their "cd", "pushd",
and "popd".
next prev parent reply other threads:[~2024-02-11 16:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-10 19:52 git gc changes ownerships of files linux K_V
2024-02-11 15:14 ` Torsten Bögershausen
2024-02-11 15:28 ` brian m. carlson
2024-02-11 15:43 ` Torsten Bögershausen
2024-02-11 16:43 ` Junio C Hamano [this message]
2024-02-11 16:59 ` Torsten Bögershausen
2024-02-11 19:09 ` brian m. carlson
2024-02-11 19:48 ` rsbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqcyt39cju.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
--cc=tboegi@web.de \
--cc=zinen2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).