After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559537 - Automatically link "commit 123456" to that commit in Git
Automatically link "commit 123456" to that commit in Git
Status: RESOLVED WONTFIX
Product: bugzilla.gnome.org
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal enhancement
: Bugzilla 4.4
Assigned To: Bugzilla Maintainers
Bugzilla Maintainers
: 705065 747354 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-06 00:26 UTC by Nick Jenkins
Modified: 2019-02-22 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rough non-working example (785 bytes, patch)
2015-01-04 18:26 UTC, André Klapper
rejected Details | Review

Description Nick Jenkins 2008-11-06 00:26:53 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
Comment 1 André Klapper 2010-08-22 20:37:31 UTC
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 .
Comment 2 André Klapper 2012-01-03 16:02:33 UTC
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.
Comment 3 André Klapper 2015-01-02 16:30:42 UTC
Someone please provide examples for strings that should automatically link.
Comment 4 Alexandre Franke 2015-01-02 17:02:34 UTC
"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.
Comment 5 André Klapper 2015-01-02 17:17:10 UTC
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 :-)
Comment 6 André Klapper 2015-01-02 17:17:16 UTC
*** Bug 705065 has been marked as a duplicate of this bug. ***
Comment 7 André Klapper 2015-01-04 18:26:51 UTC
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.
Comment 8 André Klapper 2015-01-04 19:20:26 UTC
And product maybe by doing something like
  my $bug = $args->{'bug'};
  my $product = $bug->product;
if I remember Olav correctly.
Comment 9 André Klapper 2015-01-06 00:52:12 UTC
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.
Comment 10 Alexandre Franke 2015-02-10 09:17:31 UTC
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".
Comment 11 Alexandre Franke 2015-02-10 09:20:17 UTC
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.
Comment 12 Tim-Philipp Müller 2015-02-10 09:30:17 UTC
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.
Comment 13 André Klapper 2015-02-10 11:39:40 UTC
> 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.
Comment 14 André Klapper 2015-04-05 08:21:58 UTC
*** Bug 747354 has been marked as a duplicate of this bug. ***
Comment 15 Arun Raghavan 2015-05-04 13:41:34 UTC
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.
Comment 16 André Klapper 2015-07-26 11:51:04 UTC
(In reply to Arun Raghavan from comment #15)
> Can we have an opt-out mechanism, perhaps?

Your patch is welcome.
Comment 17 André Klapper 2019-02-22 13:04:14 UTC
With the move to Gitlab we won't investigate fixing this, hence declining.