git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Cc: git <git@vger.kernel.org>
Subject: Re: Is git-am expected to honor core.sharedRepository?
Date: Tue, 01 Dec 2020 09:58:33 -0800	[thread overview]
Message-ID: <xmqqpn3tqugm.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAHd-oW4yHSTYr0Gwn60tu2c7VY=PJbSbg23Z5Bd_11Do-+juGA@mail.gmail.com> (Matheus Tavares Bernardino's message of "Tue, 1 Dec 2020 12:23:55 -0300")

Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:

> If not, the place to be changed is probably the
> safe_create_leading_directories() call in apply.c.

https://lore.kernel.org/git/xmqqziglaxj4.fsf@gitster.mtv.corp.google.com/

Calling adjust_shared_perm() on a path outside .git/ is a potential
bug, as you found out, and definitely a bug if used on working tree
files.  We may want to share with only selected users in a group the
contents of the repository (e.g. allow local cloning from us), while
allowing daemon-ish tools to scan what is in the working tree files
without letting them touch what is in the repository, for example;
adjust_shared_perm() is meant for .git/ repository files and
tightening working tree files' permissions using it would break such
arrangement.

I think bugreport uses scld, but it may be used to drop cruft inside
the working tree, but the files created are *not* to be "git add"ed,
so the use case does not count as "if used on working tree files".

> $ git commit -m d
> $ ls -l
> drwxr-xr-x 2 matheus matheus 60 dez  1 11:29 d
> ...
> Then we create a patch and use am to apply it:
> The setting was honored by am:
> $ ls -l
> drwx--S--- 2 matheus matheus 60 dez  1 11:30 d

Having said that, I know it can be argued both ways.  If we want to
protect .git/ contents in a certain way, it may be worth protecting
the files in the working tree in the same way as well.  But at least
that is not the current rule is (even though as you found out we do
have bugs).

Thanks.



  reply	other threads:[~2020-12-01 17:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 15:23 Is git-am expected to honor core.sharedRepository? Matheus Tavares Bernardino
2020-12-01 17:58 ` Junio C Hamano [this message]
2020-12-01 23:45   ` [PATCH] apply: don't use core.sharedRepository to create working tree files Matheus Tavares
2020-12-02  0:21     ` Junio C Hamano
2020-12-19 17:51     ` Adam Dinwoodie
2020-12-19 18:12       ` Junio C Hamano
2020-12-19 18:59         ` Adam Dinwoodie
2020-12-19 18:32       ` Achim Gratz
2020-12-19 19:57         ` Adam Dinwoodie
2020-12-19 21:01           ` Achim Gratz
2020-12-22 22:24             ` Adam Dinwoodie
2020-12-22 22:49               ` Matheus Tavares Bernardino
2020-12-23 11:44                 ` [PATCH] t4129: fix setfacl-related permissions failure Adam Dinwoodie
2021-01-09 15:06                   ` Matheus Tavares Bernardino
2021-01-09 22:43                     ` Junio C Hamano
2020-12-02 22:06 ` Is git-am expected to honor core.sharedRepository? Junio C Hamano
2020-12-03  1:44   ` Matheus Tavares Bernardino

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=xmqqpn3tqugm.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=matheus.bernardino@usp.br \
    /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).