git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Carlo Arenas <carenas@gmail.com>
To: Doan Tran Cong Danh <congdanhqx@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] test: switch to POSIX compliance symlink check
Date: Sat, 21 Dec 2019 12:45:43 -0800	[thread overview]
Message-ID: <CAPUEsphavRpYeJGLY73rzy18VFvTUfhsb=y6pC53e8b9aEbfRw@mail.gmail.com> (raw)
In-Reply-To: <20191221164057.24616-1-congdanhqx@gmail.com>

On Sat, Dec 21, 2019 at 8:50 AM Doan Tran Cong Danh
<congdanhqx@gmail.com> wrote:
>
> POSIX doesn't specify `-L' flag for test(1), POSIX specify `-h' for
> checking symlink instead.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

seems to indicate both are valid and equivalent

> While most shells and test(1) implementation provides both `-L' and
> `-h' for checking symlink,
> OpenBSD and NetBSD says we shouldn't rely on its existence. [1]

and macOS (from FreeBSD[1]) says the exact opposite :

     -h file     True if file exists and is a symbolic link.  This operator
                   is retained for compatibility with previous versions of
                   this program.  Do not rely on its existence; use -L
                   instead.

agree it would be a good idea to use only one for consistency though,
but it might be in that case a good idea to add it as a
"recommendation" by adding this rule in t/check-non-portable-shell.pl
or something like that IMHO

Carlo

[1] https://www.freebsd.org/cgi/man.cgi?test

  reply	other threads:[~2019-12-21 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 16:40 [PATCH] test: switch to POSIX compliance symlink check Doan Tran Cong Danh
2019-12-21 20:45 ` Carlo Arenas [this message]
2019-12-22  2:07   ` Danh Doan

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='CAPUEsphavRpYeJGLY73rzy18VFvTUfhsb=y6pC53e8b9aEbfRw@mail.gmail.com' \
    --to=carenas@gmail.com \
    --cc=congdanhqx@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).