Re: Re* [PATCH 7/8] ci: run style check on GitHub and GitLab
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jul 8, 2024, 23:17 UTC
- Message-ID
- <pcyr4eb52de67j7idzfklbeg5d5jbfmgkt6loqhkbxppvjvnco@3b2lmbd7nt3b>
- In-Reply-To
- <xmqqwmlvcx9g.fsf_-_@gitster.g>
On 24/07/08 03:52PM, Junio C Hamano wrote:
Show 16 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > > > I think the consensus from the last discussion we had was to allow > > scripts that rely on bash-isms to say "#!/usr/bin/env bash" because > > we know /bin/sh can legitimately be not bash and we assume bash may > > not be installed as /bin/bash. > > Let's do this before we forget. > > ------- >8 ------------- >8 ------------- >8 ------- > Subject: [PATCH] ci: unify bash calling convention > > Under ci/ hierarchy, we run scripts under either "sh" (any Bourne > compatible POSIX shell would work) or specifically "bash" (as they > require features from bash, e.g., $(parameter/pattern/string} > expansion). As we have the CI envionment under our control, we can
s/envionment/environment
Show 12 quoted lines
> expect that /bin/sh will always be fine to run the scripts that only > require Bourne, but we may not know where "bash" gets installed > depending on distros. > > So let's make sure we start these scripts with either one of these: > > #!/bin/sh > #!/usr/bin/env bash > > Yes, the latter has to assume that everybody installs "env" at that > path and not as /bin/env or /usr/local/bin/env, but this currently > is the best we could do.
Makes sense to me to be consistent and I also think `#!/usr/bin/env bash` is probably the best route. Other than the small typo this looks good to me.
-Justin