Unable to git review


#1

First time I try to submit a code fix. I have opened an issue (https://issues.asterisk.org/jira/browse/ASTERISK-28246), added a file (git add) and committed. When I try to invoke the git review (“git review 13”), I got these errors:
remote: error: 220fe4b: too many commit message lines longer than 80 characters; manually wrap lines
remote: Pushing to refs/publish/* is deprecated, use refs/for/* instead.
To ssh://eyalhasson@gerrit.asterisk.org:29418/asterisk.git
! [remote rejected] HEAD -> refs/publish/13/ASTERISK-28246 (Commit length validation failed)
error: failed to push some refs to ‘ssh://eyalhasson@gerrit.asterisk.org:29418/asterisk.git’

Any idea what I did wrong?


#2

The problem is mentioned in the message:

remote: error: 220fe4b: too many commit message lines longer than 80 characters; manually wrap lines

You have lines exceeding 80 characters.


#3

The wiki has a page on how commit messages should be formatted here:

https://wiki.asterisk.org/wiki/display/AST/Commit+Messages


#4

OK, but how do I re-commit now?


#5

You need to amend your previous commit[1] after which you can do “git review” again. In Gerrit 1 commit = 1 review, so you have to update the commit.

[1] https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage#GerritUsage-Amendtheoriginalcommit


#6

Great - it worked.
Thanks!