Page MenuHomeFreeBSD

subversion: update commit message template to allow URLs in PR field
Needs ReviewPublic

Authored by vangyzen on Mar 4 2019, 7:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 8:24 PM
Unknown Object (File)
Jan 30 2024, 11:15 PM
Unknown Object (File)
Jan 12 2024, 10:47 AM
Unknown Object (File)
Dec 23 2023, 2:23 AM
Unknown Object (File)
Nov 14 2023, 6:09 AM
Unknown Object (File)
Sep 2 2023, 12:57 AM
Unknown Object (File)
Aug 25 2023, 9:18 PM
Unknown Object (File)
Jul 25 2023, 6:12 AM

Details

Reviewers
rgrimes
Summary

Following D19426, suggest URLs in addition to PR numbers in the PR field.
Also suggest adding multiple PR lines, which will probably be even more
relevant with the much longer URLs.

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 22898
Build 21984: arc lint + arc unit

Event Timeline

contrib/subversion/subversion/svn/util.c
465

Wouldn't be better to copy this line just change phabric to bugzilla? reviews to bugs?

contrib/subversion/subversion/svn/util.c
465

I still wanted to say that bare PR numbers are accepted. However, in hindsight, I really want to encourage URLs, so yeah, I'll take your suggestion. Old-timers will still know about bare PR numbers, and new committers will probably want to use URLs anyway.

Just mention the URL in the comments.

https://bugs.freebsd.org/12345 redirects to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=12345. Wouldn't the first form be better? It's shorter and likely easier to map to whatever bug tracker we might move to after bugzilla (if we ever do change). It also looks more like the phabricator links.

In D19459#417484, @kristof wrote:

https://bugs.freebsd.org/12345 redirects to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=12345. Wouldn't the first form be better? It's shorter and likely easier to map to whatever bug tracker we might move to after bugzilla (if we ever do change). It also looks more like the phabricator links.

@bdrewery and I both independently had the same idea. He mentioned it in D19426.

Yes, the first form would be _far_ better. The problem is getting people to put that in their commit logs. I imagine the vast majority of people will copy it from their browser's address bar. Nobody wants to hand-type a URL from scratch. Very few would copy it from this description into the PR field and modify the bug number. So, we would need the short URL to appear consistently in the address bar. If you know how to make that happen, would you be willing to make the change in Bugzilla and its web server configuration? Do you know someone else who would? I would love to see that happen even if my changes never go in.

An alternative is to add a pre-commit hook that looks for the long URL and either rewrites it to the short URL or rejects the commit and instructs the author to rewrite it. I don't want to modify the commit log in the hook scripts. It's rude and possibly dangerous, and it sets a dangerous precedent for further modifications that are beyond the committer's control. I also don't want to reject the commit, for the same reasons as the previous paragraph. It would also be yet another barrier to committing code. People would complain about the "heavyweight process", and I would tend to agree.

I believe what your wanting is web server re-write rules, that would rewrite the URL in and out of the web pages to have the preffered form. Beyond my area of expertise to implement, but I know it can be done and that is probably the easiest place to do it (ie, no modifying bugzilla should be required.)

@bdrewery and I both independently had the same idea. He mentioned it in D19426.

Ah, I hadn't looked at that review yet.

Yes, the first form would be _far_ better. The problem is getting people to put that in their commit logs. I imagine the vast majority of people will copy it from their browser's address bar. Nobody wants to hand-type a URL from scratch. Very few would copy it from this description into the PR field and modify the bug number. So, we would need the short URL to appear consistently in the address bar. If you know how to make that happen, would you be willing to make the change in Bugzilla and its web server configuration? Do you know someone else who would? I would love to see that happen even if my changes never go in.

I see. Yes, that's an issue. Sadly I'm not too familiar with bugzilla, and I know basically nothing about our bugzilla and webserver configuration. I'd think clusteradm would be the best people to talk to about this.

An alternative is to add a pre-commit hook that looks for the long URL and either rewrites it to the short URL or rejects the commit and instructs the author to rewrite it. I don't want to modify the commit log in the hook scripts. It's rude and possibly dangerous, and it sets a dangerous precedent for further modifications that are beyond the committer's control. I also don't want to reject the commit, for the same reasons as the previous paragraph. It would also be yet another barrier to committing code. People would complain about the "heavyweight process", and I would tend to agree.

Yes, that makes sense too. It *should* be very safe, but I understand the slippery slope aspect of the issue.

With the git migration the commit message template is now in tools/tools/git/hooks/prepare-commit-msg