My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 576: Gerrit SSHd fails to (force) update a branch that points to a tag object
2 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Aug 2010


Sign in to add a comment
 
Reported by di...@google.com, May 20, 2010
Affected Version:

What steps will reproduce the problem?
1. Create a branch in it pointing to v2.6.32 (the tag, not the commit, that 
can be done easily in the web GUI because of  issue 575 )
2. Now try to fix it by force updating it to point to v2.6.32^{} with:
git push repository -f v2.6.32^{}:refs/heads/branch

What is the expected output? What do you see instead?
Should work. Instead I get this error: [remote rejected] v2.6.32^{} -> 
test_tag (non-fast forward)

Please provide any additional information below.
I discovered the issue while trying to fix a problem created by 575. The 
ACLs I think are right (Push Branch +3, Forge identity +2) and it works to 
force updates (back in history) of branches that don't point to tags.

Initially I thought the error was because Gerrit wrongly performs fast-
forward submit checks on "git push" but I don't think so anymore, I think 
that "fast-forward" message comes from the client as it's the same error 
that I get when I try to force update a Gerrit branch that does not point 
to a tag and I don't have Push Branch +3 or I forget to add the "-f" flag.
Aug 24, 2010
#1 sop@google.com
This is happening because we don't check permissions
unless the ref current value and the new proposed value
are both commits.  If either one happens to be a tag (or
any other non-commit type) the server flat out refuses
to do the replacement.

A work around is to grant yourself Push Branch +3 on the
refs/tags/* namespace, delete the tag, and then create it
back again with the correct value.  But this isn't really
that acceptable.  :-)
Status: Accepted
Aug 24, 2010
#2 di...@google.com
Having the referenced bug fixed and no other way to create branches pointing to tags is there any supported use case that this bug is addressing? If not it could be closed.
Aug 24, 2010
#3 sop@google.com
Just today someone asked on repo-discuss how to
replace an annotated tag on their project.  They
had made a mistake and tagged something wrong,
and wanted to push a replacement tag.

This bug is blocking him from replacing the tag.

Fixed by I39d0f3ffb05c3aed7c6bd6b6a30461b2aa494c08
Status: Submitted
Labels: FixedIn-2.1.6
Dec 15, 2010
#4 sop@google.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting