From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Jonathan Tan <jonathantanmy@google.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH 03/10] t1450: make hash size independent
Date: Tue, 11 Jun 2019 23:40:42 +0000 [thread overview]
Message-ID: <20190611234041.GA8616@genre.crustytoothpaste.net> (raw)
In-Reply-To: <CAPig+cT-N6=-9CJR1ugQnrksy-Zfx7bqnppsEdpiX8qaG-7_Hg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]
On 2019-06-11 at 23:20:31, Eric Sunshine wrote:
> On Tue, Jun 11, 2019 at 7:03 PM Jonathan Tan <jonathantanmy@google.com> wrote:
> > > test_expect_success 'alternate objects are correctly blamed' '
> > > test_when_finished "rm -rf alt.git .git/objects/info/alternates" &&
> > > + path=$(test_oid numeric) &&
> > > + path=$(test_oid_to_path "$path") &&
> >
> > Double assignment to path?
>
> I tripped over this, as well, when reading the patch, but if you look
> closely, the second assignment is "refining" a value computed in first
> assignment. It would have been clearer if written as:
>
> name=$(test_oid numeric) &&
> path=$(test_oid_to_path "$name") &&
>
> or:
>
> path=$(test_oid_to_path $(test_oid numeric))
I think in general people have discouraged the latter form because it
doesn't fail predictably if the inner command substitution fails. I'll
rename the first variable so that it's less surprising.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]
next prev parent reply other threads:[~2019-06-11 23:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-09 22:43 [PATCH 00/10] Hash-independent tests, part 4 brian m. carlson
2019-06-09 22:43 ` [PATCH 01/10] t: add helper to convert object IDs to paths brian m. carlson
2019-06-09 22:43 ` [PATCH 02/10] t1410: make hash size independent brian m. carlson
2019-06-09 22:43 ` [PATCH 03/10] t1450: " brian m. carlson
2019-06-10 7:57 ` Eric Sunshine
2019-06-10 22:09 ` brian m. carlson
2019-06-11 23:02 ` Jonathan Tan
2019-06-11 23:20 ` Eric Sunshine
2019-06-11 23:40 ` brian m. carlson [this message]
2019-06-11 23:35 ` brian m. carlson
2019-06-09 22:43 ` [PATCH 04/10] t5000: make hash independent brian m. carlson
2019-06-09 22:43 ` [PATCH 05/10] t6030: make test work with SHA-256 brian m. carlson
2019-06-09 22:43 ` [PATCH 06/10] t0027: make hash size independent brian m. carlson
2019-06-09 22:43 ` [PATCH 07/10] t0090: make test pass with SHA-256 brian m. carlson
2019-06-09 22:43 ` [PATCH 08/10] t1007: remove SHA1 prerequisites brian m. carlson
2019-06-09 22:43 ` [PATCH 09/10] t1710: make hash independent brian m. carlson
2019-06-09 22:44 ` [PATCH 10/10] t2203: avoid hard-coded object ID values brian m. carlson
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=20190611234041.GA8616@genre.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=sunshine@sunshineco.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).