Files
member-console/scripts
cgalo5758 f340def385 Take spdx-headers.sh's root from its own location
spdx-headers.sh changed into `git rev-parse --show-toplevel` before
stamping. Run from a copy of the repository that has no .git of its
own, such as a git archive export under the working tree, git names
the enclosing checkout, so the copy stamped the checkout's tracked
files instead of its own. The script now takes as its root the
directory above its own scripts/ directory. When git does not name
that directory as the top of a checkout, it prints a refusal on stderr
and exits 2 before it reads any file. Run from its own checkout it
behaves as before, which is how `make spdx-headers` and
`make sqlc-generate` call it.

TestSPDXHeadersStampsOnlyItsOwnCheckout builds a scratch git checkout
with one tracked Go file and, under it, an export holding the same
files without a .git. Run from the export, the script must exit 2 and
leave both Go files unstamped; run from the checkout's own copy, it
must stamp the checkout's file and not the export's. At the parent the
export case fails: the script exits 0 and stamps the checkout's a.go.
The checkout case passes on both sides.

Run in the working tree, the new script stamped 0 of 934 eligible
files and changed no path. go vet, gofmt, bash -n and make lint pass.
2026-10-15 20:34:33 -05:00
..