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

git init shared=group with a subdir

From
Ppetesea@bigfoot.com <petesea@bigfoot.com>
Date
Nov 14, 2012, 20:00 UTC
Message-ID
<alpine.OSX.2.00.1211141107180.737@nikto-air>

I believe there may be a bug when initializing a new repository relating to the directory permissions when the --shared=group option is used and the repository is within a sub-directory.

The following will create the "test.git" directory with 2775 permissions (which is as expected):

   $ ls -ld test.git
   ls: cannot access test.git: No such file or directory
   $ git init --bare --shared=group test.git
   Initialized empty shared Git repository in /tmp/test.git/
   $ ls -ld test.git
   drwxrwsr-x 7 pete users 4096 2012-11-14 11:15 test.git

This following will also create the "test.git" directory with 2775 permissions, BUT the "subdir" directory ends up with 755 permissions:

   $ ls -ld subdir
   ls: cannot access subdir: No such file or directory
   $ git init --bare --shared=group subdir/test.git
   Initialized empty shared Git repository in /tmp/subdir/test.git/
   $ ls -ld subdir subdir/test.git
   drwxr-xr-x 3 pete users 4096 2012-11-14 11:16 subdir
   drwxrwsr-x 7 pete users 4096 2012-11-14 11:16 subdir/test.git

Assuming the "subdir" directory doesn't already exist and is created by the "git init" command AND the --shared=group option is used, then shouldn't the "subdir" directory also have 2775 permissions?

Next: Junio C Hamano
Message 1 of 2 in “git init shared=group with a subdir”
  1. petesea@bigfoot.comNov 14, 2012
  2. Junio C HamanoNov 14, 2012

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.