git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "John A. Leuenhagen" <john@zlima12.com>
Cc: git@vger.kernel.org
Subject: Re: Behavior of core.sharedRepository on non-bare Repositories
Date: Mon, 17 Jan 2022 15:05:38 -0800	[thread overview]
Message-ID: <xmqqo84at131.fsf@gitster.g> (raw)
In-Reply-To: <20220117223912.fwsydwpkwfbcdlcq@Zulu-1> (John A. Leuenhagen's message of "Mon, 17 Jan 2022 17:39:12 -0500")

"John A. Leuenhagen" <john@zlima12.com> writes:

> Based on the wording in the man page, I was under the impression that
> this would affect all files in any type of repository (bare or not), but
> it seems as though this is not the case. It affects bare repositories as
> one would expect, but it only affects the .git directory on non-bare
> repositories. The working tree is not affected by the option at all.

This behaviour, as far as I know, dates back way before "git
worktree add" was invented.  Such an arrangement to share the object
store and refs (i.e. contents of .git/) among multiple worktrees
were already available via contrib/workdir/ even back then.

The motivation behind the current design may be that sharing a
working tree between two people to allow overwriting each other's
change in an uncontrolled way with their editors is a total disaster
and nobody would consider doing such a nonsensical arrangement.  It
may be why we do not loosen the permission of working tree files
beyond what your umask does.

But allowing write access to the same repository from multiple
working trees were considered worth supporting.  More importantly,
the repository data access by git is not uncontrolled---there are
protections with lockfiles to avoid overwriting others' changes.

If multiple people must write into the same repository and the same
working tree, the umask(1) command is your friend.  Add these users
to the same single group, have the repository and working tree files
owned by that group, and make sure these users have umask no
stricter than 007.


  parent reply	other threads:[~2022-01-17 23:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 22:39 Behavior of core.sharedRepository on non-bare Repositories John A. Leuenhagen
2022-01-17 22:55 ` brian m. carlson
2022-01-17 23:09   ` John A. Leuenhagen
2022-01-17 23:05 ` Junio C Hamano [this message]
2022-01-17 23:12   ` Junio C Hamano

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=xmqqo84at131.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=john@zlima12.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).