From: Antoine Musso Date: Tue, 10 Apr 2012 20:20:15 +0000 (+0200) Subject: makes gitweb URL points to full sha1 X-Git-Tag: 1.31.0-rc.0~23941^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=8196f3f11b5c9020d12105e09d072dc8e8de093b;p=lhc%2Fweb%2Fwiklou.git makes gitweb URL points to full sha1 The URL we are crafting are using a short sha1 (7 chars long) which can have some good chance of pointing to two different sha1. I have seen git log to use 8 chars from time to time because of sha1 collisions, 62 occurences outu of 45315 commits as of now. So to play it safe, this patch makes the URL points to the full sha1. Follow https://gerrit.wikimedia.org/r/4335 5734eac351dcd72f493bfd7547a5f638f582b048 (commit) 9afc1eff1c396a4d0273d2226e316cba2fb44ab0 (merge) Change-Id: Ic65d0ca89916fe43999b9e3f257d9f322198f9f8 --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index 595043a194..c2066ae801 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -29,8 +29,8 @@ class GitInfo { * full SHA-1 of the HEAD revision. */ protected $viewers = array( - 'https://gerrit.wikimedia.org/r/p/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%h', - 'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%h', + 'https://gerrit.wikimedia.org/r/p/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H', + 'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' => 'https://gerrit.wikimedia.org/r/gitweb?p=$1;h=%H', ); /**