CandyShop / gerrit

Automatically exported from code.google.com/p/gerrit
Apache License 2.0
1 stars 0 forks source link

Support for gitweb alternatives #371

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice if the support for external gitweb instances could be
extended to allow for other web-based git viewers.

The project I am involved in uses cgit rather than gitweb for our webbased
git viewer which gerrit doesn't support.

It would be nice to be able to define patterns or something in the config
such as:

[gitweb]
    url = http://git.dmdirc.com/cgit.cgi/
    type = cgit

[gitweb "cgit"]
    revision = %project%/commit/%commit%
    project = %project%/summary
    branch = %project%/log/?h=%branch%

or for the default:

[gitweb]
    url = http://git.soren.co.uk/
    type = gitweb # Optional, if not specified use 'gitweb'

[gitweb "gitweb"] # Not really needed, these would be the default values.
    revision = ?p=%project%.git;a=commit;h=%commit%
    project = ?p=%project%.git;a=summary
    branch = ?p=project%.git;a=shortlog;h=%branch%

Here I've suggested using [gitweb "cgit"] and [gitweb "gitweb"] rather than
just putting it into "[gitweb]" to perhaps in future allow different
projects to use different viewers, but I don't know if there is any plans
to allow configuration variations for different projects.

Theres also the option of putting the support for the different types into
the source code (like I have done here:
http://gerrit.dmdirc.com/#change,162) but I think making it configurable is
more useful.

Original issue reported on code.google.com by Shane...@gmail.com on 27 Dec 2009 at 10:00

GoogleCodeExporter commented 9 years ago
We probably should use our PatternString class which uses ${foo} for
string expansions rather than %foo%, because it then matches what
we do in the LDAP section.  But otherwise I agree that we can do a
more generic configuration approach here.

However, gitweb and cgit are the two "top dogs" when it comes to
web based viewers.  They are popular enough that we should have
configuration settings out of the box for them, just like we do with
Active Directory and OpenLDAP when it comes to our LDAP setup.
So I also want to embed the cgit rules into the code.

Original comment by sop@google.com on 27 Dec 2009 at 11:07

GoogleCodeExporter commented 9 years ago
I wasn't aware of the PatternString class and its uses (having not used LDAP 
support)
otherwise I would have suggested that as it makes sense to keep everything as 
similar
as possible.

Original comment by Shane...@gmail.com on 27 Dec 2009 at 11:11

GoogleCodeExporter commented 9 years ago
I've submitted a patch for this at https://review.source.android.com/13074 
(Change-Id
Ic681af1300b9c7cbae1f0f0ce31a5272378feac6).

It adds 4 new settings to the [gitweb] block, `type`, `revision`, `project` and 
`branch`

type can be either "gitweb", "cgit" or "custom". (If ommited, or blank, 
"gitweb" is
assumed, anything else will disable the gitweb links)

If custom is used, then patterns must be defined such as:
[gitweb]
  revision = ${project}/commit/?id=${commit}
  project = ${project}/summary
  branch = ${project}/log/?h=${branch}

Original comment by Shane...@gmail.com on 28 Dec 2009 at 5:09

GoogleCodeExporter commented 9 years ago
See change Ic681af1300b9c7cbae1f0f0ce31a5272378feac6

Original comment by sop@google.com on 29 Dec 2009 at 2:42

GoogleCodeExporter commented 9 years ago

Original comment by sop@google.com on 29 Dec 2009 at 2:54

GoogleCodeExporter commented 9 years ago

Original comment by sop@google.com on 28 Mar 2012 at 2:55