Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Problems pushing to Gerrit with refs/for/master

I think projects using Gerrit should not use direct push behind Gerrit's back. 
Direct push is also available through Gerrit if permissions are set appropriately.
I'll check with our local Gerrit wizards if Gerrit can prevent this problem.

--
Matthias

2012/9/7 Alex Blewitt <alex.blewitt@xxxxxxxxx>
As a heads up, the CDT team got into a mess by pushing a change to git (i.e. not through Gerrit) with a ref of refs/for/master. This prevented other changes from being pushed to Gerrit. 

Since this was a mistake (resolved by deleting the offending branch) I wonder what we could do to prevent it from recurring, or find out if Gerrit can be coded defensively against this condition. 

One thought is we could add a hook to prevent anyone trying to push a refs/for reference to Git directly or have some daily cleanup that removes */*.git/refs/for/ in case they get inadvertently added. 

Alex

Sent from my iPhone 4S

Begin forwarded message:

From: Marc Khouzam <marc.khouzam@xxxxxxxxxxxx>
Date: 7 September 2012 01:50:19 GMT+01:00
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Any problems pushing to Gerrit?
Reply-To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

Thanks Vladimir for figuring this out!

You were right that EGit fetches refs/heads branches and not refs/for.
When I added that spec manually, I got to see the bad branch.

I then did the
 git push origin :refs/for/master
which got rid of the branch (thanks Alex for making me feel safe to do it :))

... and Gerrit works again :)

BTW, the bad branch could not be seen straight from the Git repo on the web
(I had looked for it).
How did you find the for/master branch?  Did you type it in directly in the URL box?

Thanks again!

Marc

________________________________________
From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Alex Blewitt [alex.blewitt@xxxxxxxxx]
Sent: September 6, 2012 5:06 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Any problems pushing to Gerrit?

On 6 Sep 2012, at 22:04, Vladimir Prus wrote:

I actually believe anybody with commit access can do this:

git push origin :refs/for/master

to delete this ref on the server. Anybody wants to give it a try?

Yes, this should have the desired effect - but it will leave an empty direction 'refs/for' on the server. Whether that has an impact or not I don't know.

The Git log shows the push being incorrectly applied to the Git repo rather than Gerrit:

http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/log/?h=for/master

Alex
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
egit-dev mailing list
egit-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/egit-dev




--
Matthias

Back to the top