From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Justin Tobler <jltobler@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH v2 3/5] ci: separate whitespace check script
Date: Fri, 3 May 2024 19:59:46 +0200 [thread overview]
Message-ID: <ZjUmEuKZB1xwAPo7@ncase> (raw)
In-Reply-To: <xmqq1q6ialiu.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]
On Fri, May 03, 2024 at 09:49:13AM -0700, Junio C Hamano wrote:
> Justin Tobler <jltobler@gmail.com> writes:
>
> > On 24/05/03 08:56AM, Patrick Steinhardt wrote:
> >> On Thu, May 02, 2024 at 02:38:37PM -0500, Justin Tobler wrote:
> >> > The `check-whitespace` CI job is only available as a GitHub action. To
> >> > help enable this job with other CI providers, first separate the logic
> >> > performing the whitespace check into its own script. In subsequent
> >> > commits, this script is further generalized allowing its reuse.
> >> >
> >> > Helped-by: Patrick Steinhardt <ps@pks.im>
> >> > Signed-off-by: Justin Tobler <jltobler@gmail.com>
> >> > ---
> >> [snip]
> >> > diff --git a/ci/check-whitespace.sh b/ci/check-whitespace.sh
> >> > new file mode 100755
> >> > index 0000000000..f57d1ff5f0
> >> > --- /dev/null
> >> > +++ b/ci/check-whitespace.sh
> >> > @@ -0,0 +1,74 @@
> >> > +#!/bin/bash
> >>
> >> This needs to be either "/bin/sh" or "/usr/bin/env bash".
> >
> > Since the script is using some shell specific features, I'll update this
> > to "/usr/bin/env bash" in the next version.
>
> This is a question to Patrick, but what makes it bad to assume
> "bash" is in "/bin" when it is OK to assume that "env" is always in
> "/usr/bin"?
My own bias. I know of systems without "/bin/bash" (NixOS), but I don't
know of any without "/usr/bin/env". But you're right, "/usr/bin/env" is
not part of POSIX and thus not really portable, either.
Ultimately I don't think there is any way to write the shebang so that
it is fully POSIX compliant. So I'd rather go with the option which is
supported on more systems, which is to the best of my knowlede env(1).
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-05-03 17:59 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 0:33 [PATCH 0/2] Add GitLab CI to check for whitespace errors Justin Tobler
2024-04-30 0:33 ` [PATCH 1/2] ci: pre-collapse GitLab CI sections Justin Tobler
2024-04-30 0:33 ` [PATCH 2/2] gitlab-ci: add whitespace error check Justin Tobler
2024-04-30 1:59 ` James Liu
2024-04-30 3:01 ` Justin Tobler
2024-04-30 5:04 ` Patrick Steinhardt
2024-04-30 5:04 ` Patrick Steinhardt
2024-04-30 12:14 ` Taylor Blau
2024-04-30 14:00 ` Justin Tobler
2024-04-30 14:05 ` Patrick Steinhardt
2024-04-30 14:41 ` Justin Tobler
2024-04-30 14:45 ` Patrick Steinhardt
2024-04-30 14:58 ` Justin Tobler
2024-05-02 19:38 ` [PATCH v2 0/5] Add GitLab CI to check for whitespace errors Justin Tobler
2024-05-02 19:38 ` [PATCH v2 1/5] ci: pre-collapse GitLab CI sections Justin Tobler
2024-05-02 19:38 ` [PATCH v2 2/5] github-ci: fix link to whitespace error Justin Tobler
2024-05-02 19:38 ` [PATCH v2 3/5] ci: separate whitespace check script Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-03 15:27 ` Justin Tobler
2024-05-03 16:49 ` Junio C Hamano
2024-05-03 17:59 ` Patrick Steinhardt [this message]
2024-05-04 6:51 ` Chris Torek
2024-05-02 19:38 ` [PATCH v2 4/5] ci: make the whitespace report optional Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-03 15:35 ` Justin Tobler
2024-05-02 19:38 ` [PATCH v2 5/5] gitlab-ci: add whitespace error check Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-02 21:45 ` [PATCH v2 0/5] Add GitLab CI to check for whitespace errors Junio C Hamano
2024-05-03 15:39 ` Justin Tobler
2024-05-03 17:21 ` [PATCH v3 " Justin Tobler
2024-05-03 17:21 ` [PATCH v3 1/5] ci: pre-collapse GitLab CI sections Justin Tobler
2024-05-03 17:21 ` [PATCH v3 2/5] github-ci: fix link to whitespace error Justin Tobler
2024-05-03 17:21 ` [PATCH v3 3/5] ci: separate whitespace check script Justin Tobler
2024-05-03 17:21 ` [PATCH v3 4/5] ci: make the whitespace report optional Justin Tobler
2024-05-03 17:21 ` [PATCH v3 5/5] gitlab-ci: add whitespace error check Justin Tobler
2024-05-06 6:55 ` Patrick Steinhardt
2024-05-06 13:59 ` Justin Tobler
2024-05-06 17:17 ` Junio C Hamano
2024-05-06 19:21 ` Justin Tobler
2024-05-07 4:12 ` Patrick Steinhardt
2024-05-07 18:06 ` Justin Tobler
2024-05-07 18:12 ` Patrick Steinhardt
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=ZjUmEuKZB1xwAPo7@ncase \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@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).