Git Mailing List Archive on
 help / color / Atom feed
From: Vadim Zeitlin <>
To: Johannes Schindelin <>
Subject: Re[2]: [PATCH] fetch: allow running as different users in shared repositories
Date: Thu, 26 Mar 2020 23:32:01 +0100
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2632 bytes --]

On Thu, 26 Mar 2020 15:40:47 +0100 (CET) Johannes Schindelin <> wrote:

JS> On Thu, 26 Mar 2020, Vadim Zeitlin wrote:
JS> > On Wed, 25 Mar 2020 20:04:09 +0100 Johannes Schindelin wrote:
JS> >
JS> > JS> Hi Vadim,
JS> >
JS> >  Hello Johannes and thanks for your reply!
JS> >
JS> > JS> On Thu, 19 Mar 2020, Vadim Zeitlin wrote:
JS> > JS>
JS> > JS> > The function fopen_for_writing(), which was added in 79d7582e32 (commit:
JS> > JS> > allow editing the commit message even in shared repos, 2016-01-06) and
JS> > JS> > used for overwriting FETCH_HEAD since ea56518dfe (Handle more file
JS> > JS> > writes correctly in shared repos, 2016-01-11), didn't do it correctly in
JS> > JS> > shared repositories under Linux.
JS> > JS> >
JS> > JS> > This happened because in this situation the file FETCH_HEAD has mode 644
JS> > JS>
JS> > JS> I wonder why that is. In a shared repository, it should have mode 664, I
JS> > JS> thought.
JS> >
JS> >  This file is created using a simple fopen("w") and so is subject to umask.
JS> > With the usual default umask value (022) its mode would be 644, regardless
JS> > of the repository settings.
JS> Maybe we should change that to an `open()` call with the explicit `0666`
JS> mode?

 Hello again,

 Sorry if I'm missing something, but AFAICS this wouldn't change anything,
open() mode argument is still combined with the (negated) umask, and 0666 &
!022 would still give 0644. The only ways to give this file the mode
of 664 that I know about are to either temporarily reset the "group" byte
of umask to 0 or to explicitly call [f]chmod() after creating it. I don't
know if this is really worthwhile to do...

JS> My take is that this was waiting for a review, and I provided it (*not*
JS> asking for any changes), and if there are no further reviews, the patch
JS> should make it into the `pu` branch, then `next` and eventually `master`,
JS> at which point it will be slated for the next official `.0` version.

 OK, thanks (both for the review and for the explanations)!

JS> It might make sense to ask for it to be trickled down into the `maint`
JS> branch, too, in case a `v2.26.1` is released. I would be in favor of that,
JS> but would not do the asking myself ;-)

 This is not really urgent to me, so I don't think I want to bother people
with backporting it to `maint` neither, even if I definitely wouldn't have
any objections to this. I'd just like this to work in some future version
of Git without the workaround we have to use right now (which basically
consists in running chmod manually) in the bright future when we upgrade to

 Thanks again,

[-- Attachment #2: Type: APPLICATION/PGP-SIGNATURE, Size: 196 bytes --]

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  0:44 Vadim Zeitlin
2020-03-26 14:40 ` Johannes Schindelin
2020-03-26 22:32   ` Vadim Zeitlin [this message]
2020-05-01 23:11   ` Re[2]: " Vadim Zeitlin
2020-05-04 16:32     ` Junio C Hamano
2020-05-04 17:04       ` Re[2]: " Vadim Zeitlin
2020-05-04 20:39         ` Junio C Hamano
2020-05-05  0:08           ` Re[2]: " Vadim Zeitlin

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Mailing List Archive on

Archives are clonable:
	git clone --mirror git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ \
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone