Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 458827

Summary: Delete a branch on Git ("You need 'Push' rights with the 'Force Push'")
Product: Community Reporter: Michael Vorburger <mike>
Component: GitAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: denis.roy
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422215
Whiteboard:

Description Michael Vorburger CLA 2015-01-30 10:02:23 EST
Hello eclipse.org Git webmaster,

I have pushed 3x "feature branches" to http://git.eclipse.org/c/emf/org.eclipse.emf.eson.git/, named "DS-8268_ProblemRefWithNumberOnlyBetweenDots", "NewGrammarWithAnyValue" and "PerfAbstractValueSwitchAvoidToStringAndReParse".  

The idea here is to work on stuff in isolation from master, being able to share and discuss progress with others, and (eventually) commit a squashed result into master (or abandon the work).  E.g. for DS-8268_ProblemRefWithNumberOnlyBetweenDots this has just happened in http://git.eclipse.org/c/emf/org.eclipse.emf.eson.git/commit/?id=400af606c7f4d4a042cf141adfa07c2ccca44200 (while "NewGrammarWithAnyValue" and "PerfAbstractValueSwitchAvoidToStringAndReParse" are still ongoing).

However I've just found out that I'm unable to myself delete such FBs:

$ git push origin :DS-8268_ProblemRefWithNumberOnlyBetweenDots
remote: Branch refs/heads/DS-8268_ProblemRefWithNumberOnlyBetweenDots:
remote: You need 'Push' rights with the 'Force Push'
remote: flag set to delete references.
remote: User: mvorburgeragh
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done    
To https://mvorburgeragh@git.eclipse.org/r/emf/org.eclipse.emf.eson
 ! [remote rejected] DS-8268_ProblemRefWithNumberOnlyBetweenDots (cannot delete references)
error: failed to push some refs to 'https://mvorburgeragh@git.eclipse.org/r/emf/org.eclipse.emf.eson'

$ git push --force origin :DS-8268_ProblemRefWithNumberOnlyBetweenDots
remote: Branch refs/heads/DS-8268_ProblemRefWithNumberOnlyBetweenDots:
remote: You need 'Push' rights with the 'Force Push'
remote: flag set to delete references.
remote: User: mvorburgeragh
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done    
To https://mvorburgeragh@git.eclipse.org/r/emf/org.eclipse.emf.eson
 ! [remote rejected] DS-8268_ProblemRefWithNumberOnlyBetweenDots (cannot delete references)
error: failed to push some refs to 'https://mvorburgeragh@git.eclipse.org/r/emf/org.eclipse.emf.eson'


I gathered from having just read a few previous issues that this is intentional, and while you do occasionally temporarily grant force push, you prefer not to in general (which actually seems fair and a Good Idea, to me). I have two questions / requests:

1. How do you see feature branches working on Git @ eclipse.org then?  I think to backup and share ongoing work I'll just push branches of the same Git repo somewhere else, say https://github.com/vorburger/ESON - that's no problem - and I'll push only the "final" (squashed) result to the master at eclipse.org; fair enough.  Is this the intended workflow, or am I missing something?  Or am I supposed to / can easily use Gerrit for this kind of workflow myself - even as the core maintainer who could push directly to the repo - is using Gerrit better for FBs? I'm not much into Gerrit, yet - guidance appreciated.  (Perhaps this use case could be documented on https://wiki.eclipse.org/Git and/or https://wiki.eclipse.org/Gerrit ?)

2. In the mean time, would you be kind enough to delete said branches DS-8268_ProblemRefWithNumberOnlyBetweenDots", "NewGrammarWithAnyValue" and "PerfAbstractValueSwitchAvoidToStringAndReParse" on emf.eson.git, just for clean-up? Tx.
Comment 1 Denis Roy CLA 2015-02-10 13:22:17 EST
> 1. How do you see feature branches working on Git @ eclipse.org then?

For feature/topic branches, Gerrit does allow a more fine-grained approach, where we can allow deletes and force pushes in a specific refspec only (refs/heads/${username}/* to be exact).  Gerrit will match ${username} to your committer ID, so committer A cannot delete your feature branches (and vice-versa).

Let me know (with approval from your project lead) if you'd like for us to define those access rules for your Gerrit project(s).


> 2. In the mean time, would you be kind enough to delete said branches
> DS-8268_ProblemRefWithNumberOnlyBetweenDots", "NewGrammarWithAnyValue" and
> "PerfAbstractValueSwitchAvoidToStringAndReParse" on emf.eson.git, just for
> clean-up? Tx.

I've deleted those two.
Comment 2 Denis Roy CLA 2015-05-27 15:24:38 EDT
(In reply to Denis Roy from comment #1)
> > 1. How do you see feature branches working on Git @ eclipse.org then?
> 
> For feature/topic branches, Gerrit does allow a more fine-grained approach,
> where we can allow deletes and force pushes in a specific refspec only
> (refs/heads/${username}/* to be exact).  Gerrit will match ${username} to
> your committer ID, so committer A cannot delete your feature branches (and
> vice-versa).
> 
> Let me know (with approval from your project lead) if you'd like for us to
> define those access rules for your Gerrit project(s).


Haven;t heard back, so I'll assume you don't want that.  Please reopen if that is a setup you'd like to implement.