GNOME Bugzilla – Bug 559537
Automatically link "commit 123456" to that commit in Git
Last modified: 2019-02-22 13:04:14 UTC
Please autolink the text "revision <number>" to Subversion. Example: http://bugzilla.gnome.org/show_bug.cgi?id=559371#c2 In this example comment, the text "revision 36743" should link to http://svn.gnome.org/viewvc/evolution?view=revision&revision=36743 , same as per "bug 124" gets autolink to the relevant bug number in bugzilla. The same thing should happen with "r36743" (if it does not already) - i.e. r36743 should link to relevant revision. Other information: This can be customized to happen automatically with bugzilla - e.g. see https://bugzilla.wikimedia.org/show_bug.cgi?id=7676#c6 for an example. That bugzilla installation was set up by Brion Vibber I think, so you he can be contacted if needed to find out what had to be done to get this functionality - User page link: http://en.wikipedia.org/wiki/User:Brion_VIBBER
GNOME does not use SVN anymore so this is obsolete. However it makes sense for git of course, but I'd prefer to see this fixes in upstream first instead. See https://bugzilla.mozilla.org/show_bug.cgi?id=314097 .
According to upstream, "This is now possible thanks to the bug_format_comment hook, see http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Hook.html#bug_format_comment ." Just(TM) needs to be implemented for Git and GNOME infrastructure. Patches welcome.
Someone please provide examples for strings that should automatically link.
"commit 61dfafb" should link to https://git.gnome.org/browse/gnome-builder/commit/?id=61dfafb I guess the issue is determining that this commit belongs to the gnome-builder repo. We couldn't really find a way to do it for the MoinMoin macro we have created to do this and the workaround used there is to use the following syntax: <<GnomeGit(gnome-builder,61dfafb)>> Maybe we could use the associated product for the bug report the link is in, but that would not work in all cases (e.g. "this bug depends on a bug in GTK+ which has been solved in commit abc1234"). An alternative would be a "reponame commit abc1234", so the syntax for our real life example would become "gnome-builder commit 61dfafb". Additionnaly, it would be nice to have "pushed as 61dfafb" also transform into a link, as that's the string left in comments by git-bz. See https://bugzilla.gnome.org/show_bug.cgi?id=742081#c5 for an example.
Copying from dup bug 705065: --- André Klapper [bugzilla.gnome.org developer] 2013-07-29 12:09:01 UTC Can be done by writing / enhancing an extension. See https://git.wikimedia.org/blob/wikimedia%2Fbugzilla%2Fmodifications.git/19207c99daf9c5fb211cb0fe8cd50f08e313a8f9/extensions%2FWikimedia%2FExtension.pm#L36 for very similar examples. --- Comment 2 Nelson Benitez [reporter] 2013-07-30 14:46:13 UTC Ok, if such extension could be integrated into bugzilla.gnome.org I'll give it a go. Btw, I think we should also support the "pushed as $refcommit" syntax that is automatically generated by.. ¿Owen's git-bz? as seen here[1] [1] https://bugzilla.gnome.org/show_bug.cgi?id=692097#c9 Thank you for the feedback and extension link :-)
*** Bug 705065 has been marked as a duplicate of this bug. ***
Created attachment 293715 [details] [review] Rough non-working example Thanks for the link examples! (In reply to comment #4) > I guess the issue is determining that this commit belongs to the gnome-builder > repo. Exactly! I'm attaching a non-working example (link missing the product, regex totally untested), but anybody who wants to further investigate should at least be able to understand how it's supposed to work.
And product maybe by doing something like my $bug = $args->{'bug'}; my $product = $bug->product; if I remember Olav correctly.
Fixed by https://git.gnome.org/browse/bugzilla-gnome-org-customizations/commit/?id=27f1c5e9e2758bdbd84b208adb078bfe77f69a40 The fix will be available once GNOME Bugzilla has been upgraded to version 4.4.
First of all thanks for solving the "commit abcd123" and "pushed as abcd123" cases. (In reply to Alexandre Franke from comment #4) > Maybe we could use the associated product for the bug report the link is in, > but that would not work in all cases (e.g. "this bug depends on a bug in > GTK+ which has been solved in commit abc1234"). > > An alternative would be a "reponame commit abc1234", so the syntax for our > real life example would become "gnome-builder commit 61dfafb". This is the outstanding case. Olav suggested on d-d-l to use "module gnome-builder commit 61dfafb". After a bit of thought, maybe a syntax like "commit 61dfafb in gnome-builder" would come more naturally in a phrase and we'd maybe match already existing bug reports. The risk is of course to have false positives in cases such as "you need to apply commit abcd123 in order to fix your problem".
By the way for some reason (because of the quotes?) the two bogus references in the first line in comment 10 don't have a link.
This is a really nice feature. In case of GStreamer, our git modules are on fdo and there's a bunch of them, and it would be fantastic if it was possible to make the commit linking work for those as well. A component <-> git-repo mapping would work for many cases, but not for all, in our case.
> A component <-> git-repo mapping I don't see any place where to store such information but if anyone wants to write and maintain an extension that pushes the Git repository URL included in the project's DOAP files into the bugtracker URL included in that DOAP file, I'm looking forward to it. In GNOME we have a bunch of places where we try to map //manually// and fail. I don't want a bunch+1.
*** Bug 747354 has been marked as a duplicate of this bug. ***
Can we have an opt-out mechanism, perhaps? It's not too great to have these links turn up on the bug and not work at all.
(In reply to Arun Raghavan from comment #15) > Can we have an opt-out mechanism, perhaps? Your patch is welcome.
With the move to Gitlab we won't investigate fixing this, hence declining.