Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bash script shebangs more portable #1361

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion etc/check-package-size.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eu -o pipefail

Expand Down
2 changes: 1 addition & 1 deletion etc/copy-packetline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euC -o pipefail

Expand Down
2 changes: 1 addition & 1 deletion etc/corpus/clone-repos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Check if there is input on stdin
if [ -t 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion gix-archive/tests/fixtures/basic.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init
Expand Down
2 changes: 1 addition & 1 deletion gix-attributes/tests/fixtures/make_attributes_baseline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

mkdir basics;
Expand Down
2 changes: 1 addition & 1 deletion gix-command/tests/fixtures/win_path_lookup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

mkdir a b c
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

function tick () {
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/octopus_merges.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/single_commit.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

# The goal with this repo is to have the smallest commit-graph file possible, in the hopes that an
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/single_commit_huge_dates.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

function setup_repo() {
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/single_parent.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/split_chain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-commitgraph/tests/fixtures/two_parents.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q main-worktree
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-config/tests/fixtures/make_config_repo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/all-but-credentials.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

echo protocol=ftp
echo host=example.com:8080
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/custom-helper.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

test "$1" = get && \
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/fail.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

exit 42
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/last-pass.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

echo username=user
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/password.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

echo password=pass
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/reflect.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

cat
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/url.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

echo protocol=ftp
echo host=github.com
Expand Down
2 changes: 1 addition & 1 deletion gix-credentials/tests/fixtures/username.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

echo username=user
2 changes: 1 addition & 1 deletion gix-date/tests/fixtures/generate_git_date_baseline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init;
Expand Down
Binary file not shown.
Binary file modified gix-diff/tests/fixtures/generated-archives/make_blob_repo.tar.xz
Binary file not shown.
Binary file modified gix-diff/tests/fixtures/generated-archives/make_diff_repo.tar.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-diff/tests/fixtures/make_blob_repo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-diff/tests/fixtures/make_diff_repo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail


Expand Down
2 changes: 1 addition & 1 deletion gix-dir/tests/fixtures/many-symlinks.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

# Note that symlink creation fails on Windows for some reason,
Expand Down
2 changes: 1 addition & 1 deletion gix-dir/tests/fixtures/many.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

# Nothing here may use symlinks so these fixtures can be used on windows as well.
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-discover/tests/fixtures/make_basic_repo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-discover/tests/fixtures/make_exfat_repo_darwin.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

[[ $(uname) == Darwin ]] || exit 1
Expand Down
2 changes: 1 addition & 1 deletion gix-discover/tests/fixtures/make_submodules.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q module1
Expand Down
2 changes: 1 addition & 1 deletion gix-filter/tests/fixtures/baseline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

driver=${1:?First argument is the driver program supporting both process mode and clean/smudge}
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-filter/tests/fixtures/pipeline_repos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

(mkdir all-filters && cd all-filters
Expand Down
2 changes: 1 addition & 1 deletion gix-fsck/tests/fixtures/make_test_repos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -x
set -euo pipefail

Expand Down
Binary file modified gix-glob/tests/fixtures/generated-archives/make_baseline.tar.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-glob/tests/fixtures/make_baseline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

cat <<EOF >user.exclude
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/file_metadata.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

# The largest-possible date for Ext4, nanos are special there, but ont usually on other filesystems
Expand Down
Binary file modified gix-index/tests/fixtures/generated-archives/V2_empty.tar.xz
Binary file not shown.
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v2.tar.xz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v2_more_files.tar.xz
Binary file not shown.
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v2_split_index.tar.xz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v3_added_files.tar.xz
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v3_skip_worktree.tar.xz
Binary file not shown.
Binary file modified gix-index/tests/fixtures/generated-archives/v3_sparse_index.tar.xz
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/V2_empty.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v2_all_file_kinds.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2;
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v2_deeper_tree.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v2_more_files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v2_split_index.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Creates a 2 identical repositories, one using a split index, the other
# using a regular index
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v3_added_files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v3_skip_worktree.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v3_sparse_index.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-index/tests/fixtures/make_index/v4_more_files_IEOT.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

export GIT_INDEX_VERSION=4
Expand Down
4 changes: 2 additions & 2 deletions gix-index/tests/fixtures/make_traverse_literal_separators.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

# Makes a repo carrying a literally named file, which may even contain "/".
Expand Down Expand Up @@ -41,4 +41,4 @@ make_repo traverse_dotgit_backslashes '.git\hooks\pre-commit' 100755 <<'EOF'
#!/bin/sh
printf 'Vulnerable!\n'
date >vulnerable
EOF
EOF
Binary file modified gix-negotiate/tests/fixtures/generated-archives/make_repos.tar.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-negotiate/tests/fixtures/make_repos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

function tick () {
Expand Down
Binary file modified gix-object/tests/fixtures/generated-archives/make_trees.tar.xz
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-object/tests/fixtures/make_trees.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

function baseline() {
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-odb/tests/fixtures/make_alternates_odb.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-odb/tests/fixtures/make_replaced_history.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-odb/tests/fixtures/make_repo_multi_index.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

omit_multi_index=${1:-no}
Expand Down
2 changes: 1 addition & 1 deletion gix-odb/tests/fixtures/repo_with_loose_objects.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-pack/tests/fixtures/make_pack_gen_repo.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-pack/tests/fixtures/make_pack_gen_repo_multi_index.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gix-pathspec/tests/fixtures/match_baseline_dirs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init;
Expand Down
2 changes: 1 addition & 1 deletion gix-pathspec/tests/fixtures/match_baseline_files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init;
Expand Down
2 changes: 1 addition & 1 deletion gix-pathspec/tests/fixtures/parse_baseline.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
2 changes: 1 addition & 1 deletion gix-ref/tests/fixtures/make_packed_ref_repository.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu -o pipefail

git init -q
Expand Down
Loading
Loading