Skip to contentSkip to conversation

undocumented core.sharedRepository=2 set by git init --shared=world

DISCUSSION Joey Hess 4 participants 6 messages Jun 15, 2016

lore
Share & tools
lore

Joey Hess

author
#0 lore raw

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values. Anyway, I suppose they ought to be documented too.

Signature · 1 line
see shy jo
#1 lore raw
Quoted 10 lines · Joey Hess

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values.

Thanks for the report.
Changing the behavior of Git may cause problems with
- older versions of Git
- Other implementations of Git, like JGit, libgit2, ...

Did you check what these implementations do ?

Anyway, I suppose they ought to be documented too.

Quoted 1 line

Yes.
Do you want to send a patch ?

#2 lore raw
In reply to Joey Hess

Hi Joey,

Quoted 10 lines · Joey Hess

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values. Anyway, I suppose they ought to be documented too.

The rationale can be found here: https://github.com/git/git/blob/v2.4.5/builtin/init-db.c#L413-L418

/* We do not spell "group" and such, so that
* the configuration can be read by older version
* of git. Note, we use octal numbers for new share modes,
* and compatibility values for PERM_GROUP and
* PERM_EVERYBODY.
*/

I am sympathetic to your wish, of course, and I am sure that you understand why we cannot simply break other people's setups to satisfy it.

Ciao,
Johannes

#3 lore raw
Quoted 24 lines · Johannes Schindelin

Hi Joey,

Quoted 10 lines · Joey Hess

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values. Anyway, I suppose they ought to be documented too.

The rationale can be found here:
https://github.com/git/git/blob/v2.4.5/builtin/init-db.c#L413-L418

/* We do not spell "group" and such, so that
* the configuration can be read by older version
* of git. Note, we use octal numbers for new share modes,
* and compatibility values for PERM_GROUP and
* PERM_EVERYBODY.
*/

Quoted 3 lines

I am sympathetic to your wish, of course, and I am sure that you understand why we cannot simply break other people's setups to satisfy it.

That comment was added in 94df250 (shared repository: optionally allow reading to "others"., 2006-06-09) which was in 1.4.1. I suspect that is now sufficiently old that it no longer matters.

#4 lore raw

Hi John,

Quoted 25 lines · John Keeping
Quoted 24 lines · Johannes Schindelin

Hi Joey,

Quoted 10 lines · Joey Hess

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values. Anyway, I suppose they ought to be documented too.

The rationale can be found here:
https://github.com/git/git/blob/v2.4.5/builtin/init-db.c#L413-L418

/* We do not spell "group" and such, so that
* the configuration can be read by older version
* of git. Note, we use octal numbers for new share modes,
* and compatibility values for PERM_GROUP and
* PERM_EVERYBODY.
*/

Quoted 7 lines
Quoted 3 lines

I am sympathetic to your wish, of course, and I am sure that you understand why we cannot simply break other people's setups to satisfy it.

That comment was added in 94df250 (shared repository: optionally allow reading to "others"., 2006-06-09) which was in 1.4.1. I suspect that is now sufficiently old that it no longer matters.

I understand your point of view. With my maintainer hat on I have to say, though, that things like that require a major version change. Users tend to appreciate such a careful maintenance.

Ciao,
Johannes

#5 lore raw
Quoted 32 lines · Johannes Schindelin

Hi John,

Quoted 29 lines · John Keeping
Quoted 27 lines · Johannes Schindelin

Hi Joey,

Quoted 10 lines · Joey Hess

joey@darkstar:~/tmp>git init --shared=world testrepo Initialized empty shared Git repository in /home/joey/tmp/testrepo/.git/ joey@darkstar:~/tmp>grep shared testrepo/.git/config
sharedrepository = 2

This magic value of 2 seems to be undocumented, as is the magic value of 1 that's equvilant to "group".

I think it would be better to have git init put in "world" or "group" and not these magic values. Anyway, I suppose they ought to be documented too.

The rationale can be found here:
https://github.com/git/git/blob/v2.4.5/builtin/init-db.c#L413-L418

/* We do not spell "group" and such, so that
* the configuration can be read by older version
* of git. Note, we use octal numbers for new share modes,
* and compatibility values for PERM_GROUP and
* PERM_EVERYBODY.
*/

I am sympathetic to your wish, of course, and I am sure that you understand why we cannot simply break other people's setups to satisfy it.

Quoted 7 lines
Quoted 3 lines

That comment was added in 94df250 (shared repository: optionally allow reading to "others"., 2006-06-09) which was in 1.4.1. I suspect that is now sufficiently old that it no longer matters.

I understand your point of view. With my maintainer hat on I have to say, though, that things like that require a major version change. Users tend to appreciate such a careful maintenance.

However, there has been a major version since the new syntax was introduced (in the same commit mentioned above), so this only affects users who initialize a repository with (say) 2.6.0 or later and then try to use 1.4.0 or earlier to operate on it.

That means using two versions of Git released more than 9 years apart to operate on the same repository. IMHO even careful maintenance can declare that an unsupported configuration.