shanesmith / gerrit-cli

Gerrit in your command lines.
MIT License
46 stars 19 forks source link

gerrit up fails to un-draft #21

Closed fredlebel closed 7 years ago

fredlebel commented 8 years ago

Pushing draft then following with a gerrit up fails with the following output.

? Topic "AddressBook" was previously saved as a *draft*, are you sure you want to un-draft it? Yes
Pushing to origin (refs/for/master/AddressBook)
remote: Resolving deltas: 100% (7/7)           
remote: Processing changes: refs: 1, done            
To ssh://user@server/repo
! [remote rejected] HEAD -> refs/for/master/AddressBook (no changes made)
error: failed to push some refs to 'ssh://user@server/repo'
gerrit ERROR Error while pushing commit.

Workaround was to amend my commit before trying to upload it.

gerrit version 0.1.0

shanesmith commented 7 years ago

Taking a look at the line ! [remote rejected] HEAD -> refs/for/master/AddressBook (no changes made) it seems like the the commit you were trying to push was already in Gerrit

fredlebel commented 7 years ago

It was already in gerrit but as a draft. I was trying to un-draft it.

shanesmith commented 7 years ago

Hmmm I see, either gerrit up should be made smarter or an undraft command should be created...

fredlebel commented 7 years ago

Right

shanesmith commented 7 years ago

Fixed by https://github.com/shanesmith/gerrit-cli/commit/4233f18d9f2bd560d9ea516bbd15e90f2a45d059