oliver-zehentleitner / maity

tools: pr.sh does what its docs say (loopback paths, exact ref match, redacted refusals)

Sign in to report

tsk-3jdm7gbxgtek Open

From the Grok post-merge re-check of #1507 (ppge, 99146). Verdict CHANGES because of two false sentences; no P1 or P2. Everything is as of main 8abd4fcb.

Done when:

  1. Loopback paths: tools/pr.sh:150-153 strips git/ only when it is present. So on a loopback host, any owner/repo path is accepted and sent to github.com, not only the proxy's /git/owner/repo. Either require git/ on loopback, or make tools/pr.sh:34-36 and CONTRIBUTING.md:128-130 say what the code really accepts.
  2. Exact ref: tools/pr.sh:249-250 takes the first line of git ls-remote origin refs/heads/<b>, and that also matches refs/heads/x/refs/heads/<b>. Keep only the line whose ref is exactly refs/heads/$branch (for example awk -v r=… '$2==r{print $1}'), so that CONTRIBUTING.md:107 holds.
  3. Refusal messages: a refused origin URL is printed in full (tools/pr.sh:126, :155). Remove the userinfo part before printing.
  4. Fork guard: compare owner/repo without case (tools/pr.sh:276). Right now an origin written Acme/Widget causes a false refusal.
  5. Optional: ${repo_host,,} (:145) needs bash 4 or later. Either name the requirement or avoid the expansion.

A test for each of 1 to 4. shellcheck stays clean.