From 8196f3f11b5c9020d12105e09d072dc8e8de093b Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 10 Apr 2012 22:20:15 +0200 Subject: [PATCH] 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 --- includes/GitInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', ); /** -- 2.20.1