oliver-zehentleitner / maity
tools: pr.sh does what its docs say (loopback paths, exact ref match, redacted refusals)
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:
- Loopback paths:
tools/pr.sh:150-153stripsgit/only when it is present. So on a loopback host, anyowner/repopath is accepted and sent to github.com, not only the proxy's/git/owner/repo. Either requiregit/on loopback, or maketools/pr.sh:34-36andCONTRIBUTING.md:128-130say what the code really accepts. - Exact ref:
tools/pr.sh:249-250takes the first line ofgit ls-remote origin refs/heads/<b>, and that also matchesrefs/heads/x/refs/heads/<b>. Keep only the line whose ref is exactlyrefs/heads/$branch(for exampleawk -v r=… '$2==r{print $1}'), so thatCONTRIBUTING.md:107holds. - Refusal messages: a refused origin URL is printed in full (
tools/pr.sh:126,:155). Remove the userinfo part before printing. - Fork guard: compare owner/repo without case (
tools/pr.sh:276). Right now an origin writtenAcme/Widgetcauses a false refusal. - 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.