Hi,
just to connect things ... this issue has also been brought up in the
Wikimedia bug tracker some days back:
https://phabricator.wikimedia.org/T103990
(More responses below inline)
On Wed, Jul 01, 2015 at 10:18:23PM +0200, Edwin Kempin wrote:
> 2015-07-01 20:54 GMT+02:00 Ray Pelkey <
ray.p...@here.com>:
> > but it's not clear if this is a gerrit config or project config change.
Neither.
This setting belongs in the config file of the git repo.
So for the All-Projects project, that would be
$SITE/git/All-Projects.git/config
for the project "foo" it would be
$SITE/git/foo.git/config
. You get the picture :-)
> In any case the syntax looks incorrect, it should rather be
>
> [uploadpack]
> hideRefs = refs/changes
> hideRefs = refs/cache-automerge
> allowtipsha1inwant = true
While Edwin's syntax is correct, it might not do what you expect it to
do. It would hide only the (non-existing) "refs/changes" (exact
match), but it would happily continue to advertise refs like
"refs/changes/12/512/1".
So judging from the quoted bug of OP, exact matching is not what you
want, but you want prefix matching. To switch to prefix matching, add
a trailing slash ("/") to the refs. So the final config would look
like:
[uploadpack]
hideRefs = refs/changes/
hideRefs = refs/cache-automerge/
allowtipsha1inwant = true
With that config, refs like "refs/changes/12/512/1" no longer get
advertized. \o/
What sounds like a win, isn't a win, because with that config you can
now no longer fetch the ref. So the fetch/pull/... commands that
Gerrit shows on the change screen no longer work. E.g.:
git fetch origin refs/changes/12/512/1
would no longer work. Hence, many tools that ease the gerrit workflow
would break.
What you can use though to fetch commits, is the plain sha1 of the
commit (allowtipsha1inwant :-)). So if the above ref would point at,
say, 28f8a185c732940b3dca7a5773ccd80c9b484afa, then
git fetch origin 28f8a185c732940b3dca7a5773ccd80c9b484afa
would work (if you use a recent enough git client). But for that to
work, obviously one needs to know the commit hash beforehand. :-(
So the uploadpack config is not a solution either from my point of
view.
Have fun,
Christian
--
---- quelltextlich e.U. ---- \\ ---- Christian Aistleitner ----
Companies' registry: 360296y in Linz
Christian Aistleitner
Kefermarkterstrasze 6a/3 Email:
chri...@quelltextlich.at
4293 Gutau, Austria Phone: +43 7946 / 20 5 81
Fax: +43 7946 / 20 5 81
Homepage:
http://quelltextlich.at/
---------------------------------------------------------------