Re: [PATCH 0/3] commit-graph: write non-split graphs as read-only
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 21, 2020, 18:59 UTC
- Message-ID
- <xmqqk128oebd.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200421070135.GA2906244@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
>> Yes, I would say "always 0444" is wrong. > > I'm not sure. That's what we do for loose objects, packs, etc. The mode > we feed to git_mkstemp_mode(), etc, is not the true mode we expect to > end up with. We know that it will be modified by the umask, and then > perhaps by adjust_shared_perm(). > > If you are arguing that there are only two interesting modes: 0444 and > 0666, and those could be represented by a read-only/read-write enum, I'd > agree with that.
Yup, that is what I meant. I am aware that these 0444/0666 are limited with umask at open(O_CREAT) time, and then we later call adjust_shared_perm(). I thought Taylor meant to always make it readable by everybody, which was the only point I was objecting to.
> Right. I think adjust_shared_perm() should already be doing what we > want, and we should continue to call it. But it should not be > responsible for this "read-only versus read-write" decision. That > happens much earlier, and it adjusts as appropriate.
Yes.