Presently, the Subversion post-commit hook only accepts numbers (and GNATS categories) in the PR field of commit logs. Since practically everything is a URL these days, and therefore everything else knows how to _handle_ a URL, the hook should accept URLs in the PR field. Modify hook scripts: https://reviews.freebsd.org/D19426 Update Subversion's commit log template in src and ports: https://reviews.freebsd.org/D19459 https://reviews.freebsd.org/D19460
Created attachment 202564 [details] URL redirect CGI script Here is a working CGI script that could someday be used in place of Bugzilla to keep commit log URLs alive long after we migrate away from Bugzilla.
With the transition to Git, should this report be closed (overcome by events)?
This feature would still be useful, no matter which VCS we use.
> This feature would still be useful, no matter which VCS we use. Yes it would.
Created attachment 238975 [details] extract_pr_numbers.py
Created attachment 238976 [details] test_extract_pr_numbers.py
I've attached the updated script to extract PR numbers and its test. This has been deployed in the gitrepo-dev.freebsd.org and looks fine to me. The only thing I would suggest is let's favor https://bugs.FreeBSD.org/###### over https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=###### , the previous one is what we kept before moving to Bugzilla (GNATS). The comment is updated to note this one but we do support both formats in the comment message to trigger the mechanism to post comments to related tickets.
And the patch to git hook (for src repo for now, will update doc/ports then): https://reviews.freebsd.org/D37863
Thank you for finishing this work, Li-Wen! I completely forgot about it. Let me know how I can help, if you would like.
I reviewed the attached version of extract_pr_numbers.py. lstrip() doesn't work that way. It strips any of the given characters, so: 'https://'.lstrip(':/hpst') == '' It happens to work in this case, but not the way we intend.
Created attachment 239104 [details] extract_pr_numbers.py v2
Created attachment 239105 [details] test_extract_pr_numbers.py v2
(In reply to Eric van Gyzen from comment #10) Indeed, totally forgot about this, thanks for pointing it out. The correct way is using removeprefix(). I've updated the script and its test.
NB <https://reviews.freebsd.org/D37863#inline-232343>