git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, "Yaroslav Halchenko" <yoh@onerussian.com>,
	"SZEDER Gábor" <szeder@ira.uka.de>, "Jeff King" <peff@peff.net>
Subject: Re: [PATCH v2 2/2] Handle more file writes correctly in shared repos
Date: Mon, 11 Jan 2016 09:06:24 -0800	[thread overview]
Message-ID: <xmqqtwmkxcz3.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqio30yur4.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 11 Jan 2016 07:57:03 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> On Fri, 8 Jan 2016, Junio C Hamano wrote:
>>
>>> I think it is correct not to touch this codepath in this patch,
>>> because of the above two reasons, but more simply and generally, it
>>> is correct not to touch this codepath because core.sharedRepository
>>> is not about working tree files, and .rej is a file you use in your
>>> working tree.
>>
>> I am happy to adjust the log message, but I am pretty certain that the
>> `core.sharedRepository` setting actually also affects the working tree. At
>> least in my hands, calling
>>
>> 	git clone -c core.sharedRepository=group . test-shared
>>
>> results in all of the working tree files being group-writable.
>
> Interesting.  I have a suspicion that "clone" does not honor the
> configuration given that way, though.
>
>  $ umask 077
>  $ git clone -c core.sharedRepository=group ~/w/git.git sharedtest
>  $ cd sharedtest
>  $ ls -l COPYING .git/index
>  -rw------- 1 jch eng 18765 Jan 11 07:43 COPYING
>  -rw------- 1 jch eng 272037 Jan 11 07:43 .git/index
>
> Notice that the permission bits in the working tree is correct, but
> in the resulting .git/ they are bogus, so from this we cannot
> clearly see the reason why COPYING is not group-readable is because
> the checkout codepath (write_entry(), I think) is correctly omitting
> the call to adjust_perm(), or simply the configuration is ignored
> during the clone.
>
> With a workaround to ensure that checkout happens definitely after
> the configuration gets in effect by doing config and pull/checkout
> as two separate steps:
>
>  $ rm -fr sharedtest
>  $ umask 077
>  $ git init sharedtest && cd sharedtest
>  $ git config core.sharedRepository group
>  $ git pull ~/w/git.git/ master
>  $ ls -l COPYING .git/index
>  -rw------- 1 jch eng 18765 Jan 11 07:48 COPYING
>  -rw-rw---- 1 jch eng 272037 Jan 11 07:48 .git/index
>
> we can see that the configuration affects only the $GIT_DIR/ files
> and not working tree.
>
> So you found a bug in clone, I think ;-)

Having said all that, the above does not mean that I'll refuse to
consider changing the semantics of core.sharedRepository in a future
major version bump by doing adjust_perm() for working tree files,
which we have deliberately chosen not to do in the current code.

But that is not within the scope of the patch we are discussing, and
I am not convinced it is a good idea (I haven't heard either sides
of arguments), so based on the current design, I think "we don't do
fopen_for_writing() for working tree files" is a valid justification
that is short-and-sweet for this patch.

  reply	other threads:[~2016-01-11 17:06 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 18:21 [PATCH] commit: ensure correct permissions of the commit message Johannes Schindelin
2015-12-20  7:45 ` Jeff King
2015-12-20 14:21   ` Johannes Schindelin
2015-12-20 22:57     ` Torsten Bögershausen
2015-12-30 14:57       ` Johannes Schindelin
2015-12-21  1:31   ` Junio C Hamano
2015-12-21  6:59     ` Jeff King
2015-12-21 17:22       ` Junio C Hamano
2015-12-30 14:50         ` Johannes Schindelin
2015-12-30 22:56           ` Junio C Hamano
2016-01-01 15:04             ` Johannes Schindelin
2016-01-04 18:34               ` Junio C Hamano
2016-01-05 12:52                 ` Johannes Schindelin
2016-01-05 19:39                   ` Junio C Hamano
2016-01-06  8:20                     ` Johannes Schindelin
2016-01-06  8:23                       ` Jeff King
2016-01-06  8:50                         ` Johannes Schindelin
2016-01-15  1:12     ` SZEDER Gábor
2016-01-15  1:29       ` Junio C Hamano
2016-01-15  6:51         ` Johannes Schindelin
2016-01-15 10:51         ` SZEDER Gábor
2016-01-15 12:18           ` Johannes Schindelin
2016-01-06 13:09 ` [PATCH v2 0/2] Correctly handle transient files in shared repositories Johannes Schindelin
2016-01-06 13:09   ` [PATCH v2 1/2] commit: allow editing the commit message even in shared repos Johannes Schindelin
2016-01-07 12:41     ` Jeff King
2016-01-07 21:35       ` Junio C Hamano
2016-01-06 13:09   ` [PATCH v2 2/2] Handle more file writes correctly " Johannes Schindelin
2016-01-07 12:46     ` Jeff King
2016-01-08 16:04       ` Johannes Schindelin
2016-01-07 21:52     ` Junio C Hamano
2016-01-08 16:05       ` Johannes Schindelin
2016-01-08 17:59         ` Junio C Hamano
2016-01-11  9:28           ` Johannes Schindelin
2016-01-11 15:57             ` Junio C Hamano
2016-01-11 17:06               ` Junio C Hamano [this message]
2016-01-11 18:35   ` [PATCH v3 0/2] Correctly handle transient files in shared repositories Johannes Schindelin
2016-01-11 18:35     ` [PATCH v3 1/2] commit: allow editing the commit message even in shared repos Johannes Schindelin
2016-01-11 18:35     ` [PATCH v3 2/2] Handle more file writes correctly " Johannes Schindelin
2016-01-11 20:22     ` [PATCH v3 0/2] Correctly handle transient files in shared repositories Jeff King
2016-01-11 21:12     ` Junio C Hamano
2016-01-11 21:22       ` Junio C Hamano
2016-01-11 21:38         ` Jeff King
2016-01-11 21:54           ` Junio C Hamano
2016-01-11 22:06             ` Jeff King
2016-01-12  8:05               ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqtwmkxcz3.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=szeder@ira.uka.de \
    --cc=yoh@onerussian.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).