All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>, git <git@vger.kernel.org>,
	"Jeff King" <peff@peff.net>,
	"Nguyen Thai Ngoc Duy" <pclouds@gmail.com>,
	"Michael Haggerty" <mhagger@alum.mit.edu>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Christian Couder" <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2] read-cache: write all indexes with the same permissions
Date: Sat, 17 Nov 2018 17:57:18 +0900	[thread overview]
Message-ID: <xmqqy39sgjyp.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAP8UFD2tC9B_m=NmK4DTCJP=o+L+RKy9C_2ra9fgeNMzOuCZ3A@mail.gmail.com> (Christian Couder's message of "Fri, 16 Nov 2018 20:25:43 +0100")

Christian Couder <christian.couder@gmail.com> writes:

>> > +test_expect_success POSIXPERM 'same mode for index & split index' '
>> > +     git init same-mode &&
>> > +     (
>> > +             cd same-mode &&
>> > +             test_commit A &&
>> > +             test_modebits .git/index >index_mode &&
>> > +             test_must_fail git config core.sharedRepository &&
>> > +             git -c core.splitIndex=true status &&
>> > +             shared=$(ls .git/sharedindex.*) &&
>>
>> I think the command substitution and 'ls' are unnecessary, and
>>
>>   shared=.git/sharedindex.*
>>
>> would work as well.
>
> If there is no shared index file with the above we would get:
>
> shared=.git/sharedindex.*
> $ echo $shared
> .git/sharedindex.*
>
> which seems bug prone to me.

It is not bug *PRONE*, but is already wrong, as the way this
variable is used is

        +		case "$shared" in
        +		*" "*)
        +			# we have more than one???
        +			false ;;
        +		*)
        +			test_modebits "$shared" >split_index_mode &&
        +			test_cmp index_mode split_index_mode ;;
        +		esac

i.e. we'd think there is a singleton ".git/shared/index.*" and we
can feed it to test_modebits.

So what you wrote originally is corrrect.

  reply	other threads:[~2018-11-17  8:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 17:31 [PATCH v2] read-cache: write all indexes with the same permissions Christian Couder
2018-11-16 18:02 ` Duy Nguyen
2018-11-16 19:10   ` Christian Couder
2018-11-16 19:16     ` Duy Nguyen
2018-11-16 18:29 ` SZEDER Gábor
2018-11-16 19:25   ` Ævar Arnfjörð Bjarmason
2018-11-16 19:25   ` Christian Couder
2018-11-17  8:57     ` Junio C Hamano [this message]
2018-11-17 12:24     ` SZEDER Gábor
2018-11-17  9:29 ` Junio C Hamano
2018-11-17 11:19   ` Christian Couder
2018-11-17 13:05     ` Junio C Hamano
2018-11-17 21:14       ` Ævar Arnfjörð Bjarmason
2018-11-18  7:09         ` Junio C Hamano
2018-11-18 12:03           ` Ævar Arnfjörð Bjarmason
2018-11-18 19:04             ` [PATCH v3] read-cache: make the split index obey umask settings Ævar Arnfjörð Bjarmason

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=xmqqy39sgjyp.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.