DESCRIPTION

Auto-configure Gerrit configuration if repository is cloned from Gerrit

If a repository is cloned over http or https protocol use Gerrit's
REST API endpoint "Get Version" [1] to find out if the repository is
hosted by a Gerrit server. In that case auto-configure the repository
for Gerrit. Configure the push refspec to HEAD:refs/for/master which
should be ok in most cases.

[1] https://gerrit-documentation.storage.googleapis.com/Documentation/2.11/rest-api-config.html#get-version

Bug: 460423
Change-Id: I30b916e279e0bc84f86abbffae241f8aab3fa8df
Signed-off-by: Douglas Trujillo xxx@xxx.xxx


COMMENTS

author: Douglas Trujillo
date: 2015-02-25 00:19:10.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2015-02-25 00:19:17.000000000

Patch Set 5:

Build Started https://hudson.eclipse.org/egit/job/egit-stable.gerrit/638/

-------------------------------------
author: Brenden Conley
date: 2015-02-25 00:36:16.000000000

Patch Set 5: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit-stable.gerrit/638/ : UNSTABLE

-------------------------------------
author: Jayvion Booth
date: 2015-02-25 06:09:16.000000000

Patch Set 5:

(1 comment)

Please see comment in code, I think we schould be more flexible while discovering possible gerrit candidates.

Line:92, org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java -> I actually meant that we should *also* automatically recognize eclipse http non-gerrit repo urls (https://git.eclipse.org/gitroot/ *or* http://git.eclipse.org/gitroot/ *or* git own or ssh protocol urls (all those variants one can see for example in the gerrit review download row) and replace then the first part of the url with the gerrit variant.

In Eclipse project wikis user learn that they have to fetch from git with git url and may be later there is some info how to push via gerrit. This patch should help in this cases, so that first time contributors can just checkout the code using either url variant and push without  reading wikis and fiddling around with cryptical, very similar looking urls (my own experience btw).

I did not tried / checked what happens if the url contains the user name part - we should support this case too.

So finally if ee recognize any of the uri variants above and test the gerrit variant availability we can update the uri field to the gerrit variant and configure the push with updated uri.

-------------------------------------
author: Douglas Trujillo
date: 2015-02-25 11:27:11.000000000

Patch Set 5:

(1 comment)

Line:92, org.eclipse.egit.core/src/org/eclipse/egit/core/op/ConfigureGerritAfterCloneTask.java -> no, we can't do that since not all Eclipse projects are using Gerrit

Also there might be users which explicitly want to use the gitroot URL and we should not make this harder.

If project wikis tell contributors to clone from gitroot in order to contribute via Gerrit these wikis should be fixed instead of implementing black magic in EGit

-------------------------------------
