Issue 366: gerrit gitweb links assume project repositories end in .git
Status:  Released
Owner: ----
Closed:  Oct 2012

Blocked on:
issue 371
Reported by daniel.l...@packetfront.com, Dec 21, 2009
Affected Version: 2.1

When adding a project, gerrit assumes the git repository on disk is named
<project>.git. For our setup this is not true. Also gitweb links will be
wrong.

This is easy to solve for the project repository (symlink or replicate would 
work fine), but have not found a solution that works for other places where
it appends .git without source changes.
Dec 22, 2009
#1 sop@google.com
Why are your repositories not ending in .git?

It is somewhat standard behavior to name a bare git repository with the suffix
".git" to indicate what it is from the path name alone.  We just assume you are
following that rule when looking for the repository on disk.

Actually...  When opening a project from disk we should be considering all of
the following patterns:

  <project>
  <project>.git
  <project>/.git

and failing only if none of those are a Git repository.  However creating a new
repository through `gerrit create-project` assumes only <project>.git, that is
true, as does the project creation over replication.
Dec 22, 2009
#2 daniel.l...@packetfront.com
Hi,

Yeah, I am aware of the convention. When we setup our ssh based git we chose
ssh://git.<domain>/git/<project> as repo URLs, we stripped out .git because it would
be a lot of git in the name :)

You are right, project git repository works fine without the suffix. That only leaves
the gitweb links AFAIK.
Dec 24, 2009
#3 sop@google.com
Oh, yea, gitweb URLs do just slap on .git suffix without considering
whether or not that is correct for the receiving gitweb instance.

So I guess this bug is really just about gitweb URLs being wrong.
Summary: gerrit gitweb links assume project repositories end in .git
Status: Accepted
Dec 28, 2009
#4 sop@google.com
 issue 371  makes gitweb configurable, which means a custom
gitweb configuration could be used for your installation.
Blockedon: 371
Dec 29, 2009
#5 sop@google.com
In 2.1.1 you can now add to your gerrit.config:

  [gitweb]
    url = ...
    project = ?p=${project};a=summary
    revision = ?p=${project};a=commit;h=${commit}
    branch = ?p=${project};a=shortlog;h=${branch}

To use gitweb.cgi, but without the .git suffix on project names.
Status: Fixed
Labels: FixedIn-2.1.1
Jan 10, 2010
#6 daniel.l...@packetfront.com
Works like a charm.

Thanks.

Oct 21, 2012
#7 sop@google.com
(No comment was entered for this change.)
Status: Released
Blockedon: -gerrit:371 gerrit:371