From: Junio C Hamano <gitster@pobox.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 2/7] t0301: remove trailing / for dir creation
Date: Mon, 26 Nov 2018 15:40:10 +0900 [thread overview]
Message-ID: <xmqqpnusxrxx.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <fdf6f2ec6296cf48f5e5ac5edc5fe93adca77f32.1543143503.git.carenas@gmail.com> ("Carlo Marcelo Arenas Belón"'s message of "Sun, 25 Nov 2018 03:06:45 -0800")
Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
> the semantics of how mkdir -p should work, specially when using -m are
> not standard and in this case NetBSD will assume that the permision
> should not be changed, breaking the test
This does not explain, except for the fuzzy "in this case", why we
want to lose trailing slash at all. If what you wanted to say was
On NetBSD, "mkdir -p -m $bits path/to/dir/" ignores the
permission bits when creating the directory component 'dir', but
without the trailing slash at the end of "dir/", it works as
expected.
then that would be an understandable justification for the patch.
If you meant to say something else, then I couldn't read it from
what you wrote, so the log message needs updating to help future
readers.
> -p is technically not needed either, but will be cleared in a future
> patch eventhough it could be considered an alternative fix
I haven't seen the steps 3-7/7 yet, but if they remove "-p", then
"but" would be a strange thing to say here. If they indeed do, then
perhaps:
The '-p' option is not needed in thse cases, as we know $HOME/
exists in the test environment and we are creating a new
directory directly under it. It will be removed in a future
patch in the series. Removing '-p' could be an alternative fix,
as the command then works as expected even on NetBSD with the
trailing slash after directory name.
On the other hand, if future changes make it necessary to create two
or more levels here, then
At this point in the series, '-p' is not needed in thse cases,
as we know $HOME/ exists in the test environment and we are
creating .git-credential-cache directory directly under it.
However, in later patches, we'll make it necessary for these
'mkdir -p' to create two or more levels, so removing '-p' would
be an alternative fix for this step, but would not work for the
series as a whole.
would also make sense. I simply do not have enough information yet
to tell which at this point in the series.
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
> t/t0301-credential-cache.sh | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
> index fd92533acf..9529c612af 100755
> --- a/t/t0301-credential-cache.sh
> +++ b/t/t0301-credential-cache.sh
> @@ -77,9 +77,9 @@ test_expect_success "use custom XDG_CACHE_HOME even if xdg socket exists" '
> test_expect_success 'use user socket if user directory exists' '
> test_when_finished "
> git credential-cache exit &&
> - rmdir \"\$HOME/.git-credential-cache/\"
> + rmdir \"\$HOME/.git-credential-cache\"
> " &&
> - mkdir -p -m 700 "$HOME/.git-credential-cache/" &&
> + mkdir -p -m 700 "$HOME/.git-credential-cache" &&
> check approve cache <<-\EOF &&
> protocol=https
> host=example.com
> @@ -92,10 +92,10 @@ test_expect_success 'use user socket if user directory exists' '
> test_expect_success SYMLINKS 'use user socket if user directory is a symlink to a directory' '
> test_when_finished "
> git credential-cache exit &&
> - rmdir \"\$HOME/dir/\" &&
> + rmdir \"\$HOME/dir\" &&
> rm \"\$HOME/.git-credential-cache\"
> " &&
> - mkdir -p -m 700 "$HOME/dir/" &&
> + mkdir -p -m 700 "$HOME/dir" &&
> ln -s "$HOME/dir" "$HOME/.git-credential-cache" &&
> check approve cache <<-\EOF &&
> protocol=https
next prev parent reply other threads:[~2018-11-26 6:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-25 11:06 [RFC PATCH 0/7] test: NetBSD support Carlo Marcelo Arenas Belón
2018-11-25 11:06 ` [RFC PATCH 1/7] Documentation: update INSTALL for NetBSD Carlo Marcelo Arenas Belón
2018-11-26 6:27 ` Junio C Hamano
2018-11-25 11:06 ` [RFC PATCH 2/7] t0301: remove trailing / for dir creation Carlo Marcelo Arenas Belón
2018-11-26 6:40 ` Junio C Hamano [this message]
2018-11-25 11:06 ` [RFC PATCH 3/7] config.mak.uname: NetBSD uses BSD semantics with fread for directories Carlo Marcelo Arenas Belón
2018-11-26 6:41 ` Junio C Hamano
2018-11-25 11:06 ` [RFC PATCH 4/7] config.mak.uname: NetBSD uses old iconv interface Carlo Marcelo Arenas Belón
2018-11-26 6:45 ` Junio C Hamano
2018-11-25 11:06 ` [RFC PATCH 5/7] test-lib: use pkgsrc provided unzip for NetBSD Carlo Marcelo Arenas Belón
2018-11-26 6:50 ` Junio C Hamano
2018-11-25 11:06 ` [RFC PATCH 6/7] t5004: use GNU tar to avoid known issues with BSD tar Carlo Marcelo Arenas Belón
2018-11-26 6:52 ` Junio C Hamano
2018-11-25 11:06 ` [RFC PATCH 7/7] config.mak.uname: use pkgsrc perl for NetBSD Carlo Marcelo Arenas Belón
2018-11-26 6:53 ` Junio C Hamano
2018-11-26 15:42 ` [RFC PATCH 0/7] test: NetBSD support Æ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
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=xmqqpnusxrxx.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=carenas@gmail.com \
--cc=git@vger.kernel.org \
/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).