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

Re: git gc changes ownerships of files linux

From
Torsten Bögershausen <tboegi@web.de>
Date
Feb 11, 2024, 15:43 UTC
Message-ID
<20240211154345.GA28699@tb-raspi4>
In-Reply-To
<ZcjnuSAZiNHvA5h1@tapette.crustytoothpaste.net>
On Sun, Feb 11, 2024 at 03:28:57PM +0000, brian m. carlson wrote:
Show 21 quoted lines
> On 2024-02-11 at 15:14:55, Torsten Bögershausen wrote:
> > Thanks for reporting this -
> > I think that you have a working workaround ?
> >
> > However, Git has a feature called "shared repository".
> > You need to define a (unix) group that is shared between
> > your user(s) and the ansible user.
> >
> > The basic trick is to do
> > git config core.sharedRepository true
> >
> > (And then change the ownership of all files/directories to the new group)
>
> On Linux, you also should set each directory to be setgid.  That's
> because by default, Linux uses the user's current group ID as the group
> to create new directories.  However, you'll want the group to be
> inherited from the parent directory, which is the behaviour when the
> parent directory is setgid.
>
> This behaviour is the default on the BSDs, and no such configuration is
> required there.
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). And then we have t/t1301-shared-repo.sh, so I think we are in a good shape: for all systems that have posix permissions. and do not overwrite them with facl or other features.

Previous: brian m. carlsonNext: Junio C Hamano
Message 4 of 8 in “git gc changes ownerships of files linux”
  1. K_VFeb 10, 2024
  2. Torsten BögershausenFeb 11, 2024
  3. brian m. carlsonFeb 11, 2024
  4. Torsten BögershausenFeb 11, 2024
  5. Junio C HamanoFeb 11, 2024
  6. Torsten BögershausenFeb 11, 2024
  7. brian m. carlsonFeb 11, 2024
  8. rsbecker@nexbridge.comFeb 11, 2024

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.