From: Eric Sunshine <sunshine@sunshineco.com>
To: David Aguilar <davvid@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Brett Cundal <brett.cundal@iugome.com>,
"David A . Greene" <greened@obbligato.org>,
Charles Bailey <cbailey32@bloomberg.net>,
Techlive Zheng <techlivezheng@gmail.com>
Subject: Re: [PATCH 1/3] t7900-subtree.sh: fix quoting and broken && chains
Date: Tue, 26 Jul 2016 02:06:15 -0400 [thread overview]
Message-ID: <CAPig+cRGz2eqPK0uaih3hYCV0eLayot3VGyjKaz5Qf8Jy5o=DA@mail.gmail.com> (raw)
In-Reply-To: <20160726041416.9438-1-davvid@gmail.com>
On Tue, Jul 26, 2016 at 12:14 AM, David Aguilar <davvid@gmail.com> wrote:
> Allow whitespace in arguments to subtree_test_create_repo.
> Add missing && chains.
>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
> @@ -16,16 +16,16 @@ export TEST_DIRECTORY
> subtree_test_create_repo()
> {
> - test_create_repo "$1"
> + test_create_repo "$1" &&
> (
> - cd $1
> + cd "$1" &&
Thanks, I noticed this in December 2015 while reviewing a patch on the
list and have had a patch to fix it sitting in my queue since then but
never found time to formalize it.
> git config log.date relative
> )
> }
>
> create()
> {
> - echo "$1" >"$1"
> + echo "$1" >"$1" &&
> git add "$1"
> }
>
> @@ -73,10 +73,10 @@ join_commits()
> test_create_commit() (
> repo=$1
> commit=$2
Perhaps &&-chain the above two lines also to future-proof against
someone inserting important code somewhere above the following 'cd'.
> - cd "$repo"
> - mkdir -p $(dirname "$commit") \
> + cd "$repo" &&
> + mkdir -p "$(dirname "$commit")" \
> || error "Could not create directory for commit"
> - echo "$commit" >"$commit"
> + echo "$commit" >"$commit" &&
> git add "$commit" || error "Could not add commit"
> git commit -m "$commit" || error "Could not commit"
> )
next prev parent reply other threads:[~2016-07-26 6:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 4:14 [PATCH 1/3] t7900-subtree.sh: fix quoting and broken && chains David Aguilar
2016-07-26 4:14 ` [PATCH 2/3] subtree: fix "git subtree split --rejoin" David Aguilar
2016-07-26 4:14 ` [PATCH 3/3] subtree: adjust style to match CodingGuidelines David Aguilar
2016-07-26 6:12 ` Johannes Sixt
2016-07-26 20:54 ` Junio C Hamano
2016-07-26 6:06 ` Eric Sunshine [this message]
2016-07-26 6:46 ` [PATCH 1/3] t7900-subtree.sh: fix quoting and broken && chains Junio C Hamano
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='CAPig+cRGz2eqPK0uaih3hYCV0eLayot3VGyjKaz5Qf8Jy5o=DA@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=brett.cundal@iugome.com \
--cc=cbailey32@bloomberg.net \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=greened@obbligato.org \
--cc=techlivezheng@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 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 NNTP newsgroup(s).