Last modified: 2013-06-05 11:54:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38774, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36774 - Auto-link SHA1 in Gerrit commit messages and comments
Auto-link SHA1 in Gerrit commit messages and comments
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Git/Gerrit (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-11 17:16 UTC by Krinkle
Modified: 2013-06-05 11:54 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2012-05-11 17:16:52 UTC
Gerrit has an excellent search system that can find any commit by its SHA1 hash. By default it will redirect from the search to the changeset (merge request), as it does with almost anything, redirects. Which is nice.

Also nice is that when a commit is merged to another branch, searching for the SHA1 hash will show a simple search results list with both changesets that requested a merge of that commit to a certain branch.

Anyway, https://gerrit.wikimedia.org/r/#/c/7265/ mentions 2 SHA1s. Would be nice if those were auto-linked to gerrit's search.

gitweb does link them:

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki%2Fcore.git;a=commit;h=a13e5e2cd087c04294cf6aef8b37ece202847171


Regex: /\b([a-f0-9]{40})\b/
Link: https://gerrit.wikimedia.org/r/#q,$1,n,z

(including the ",n,z" afterwards, not sure why Gerrit needs it, otherwise it doesn't perform the search)
Comment 1 Chad H. 2012-05-14 19:03:00 UTC
None of these "auto-linking in gerrit" bugs are +upstream...they're a local configuration change.
Comment 2 Krinkle 2012-05-27 23:47:08 UTC
bump, can we do this?
Comment 3 Chad H. 2012-05-27 23:52:37 UTC
Feel free to submit a change in gerrit to the puppet repo. Just need to tweak templates/gerrit/gerrit.config.erb.
Comment 4 Krinkle 2012-05-28 00:15:21 UTC
I couldn't find it (was looking for a "*/gerrit" repo of some sorts).

Found it:
https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=templates/gerrit/gerrit.config.erb;hb=HEAD

https://gerrit.wikimedia.org/r/#/c/9109/
Comment 5 Marcin Cieślak 2012-06-20 16:08:42 UTC
change 9109 breaks links like

https://github.com/pediapress/mwlib/commit/4406d53b4c7dcd6cba8b7e5cf7076d08bf754f5c#docs/collection.rst

Filed http://code.google.com/p/gerrit/issues/detail?id=1451 upstream but in fact we should tweak the regular expression a bit. Maybe replace \\b with \\s+ ?
Comment 6 Krinkle 2012-07-01 20:54:33 UTC
*** Bug 38103 has been marked as a duplicate of this bug. ***
Comment 7 Krinkle 2013-01-13 00:49:46 UTC
Change-Id: I6f18a716e51bbe7c965b82a4c2716e0ba6ce6a64
Comment 8 Krinkle 2013-04-24 17:51:00 UTC
Re-opening, this is broken again.

See https://gerrit.wikimedia.org/r/#/c/60681/:
> d1b4dcd6ac" target="_blank">https://github.com/joyent/node/commit/d1b4dcd6ac

Original text:
> https://github.com/joyent/node/commit/d1b4dcd6ac
Comment 9 Krinkle 2013-04-24 17:52:11 UTC
(In reply to comment #8)
> Re-opening, this is broken again.
> 
> See https://gerrit.wikimedia.org/r/#/c/60681/:
> > d1b4dcd6ac" target="_blank">https://github.com/joyent/node/commit/d1b4dcd6ac
> 
> Original text:
> > https://github.com/joyent/node/commit/d1b4dcd6ac

See bug 38103 instead.
Comment 10 Chad H. 2013-06-05 11:54:41 UTC
I'm resolving this as FIXED. We've added all the links we wanted (and any new linking can be a new bug). Bug 38103 is for tracking the "links broken when they appear in URLs" thing.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links