Unable to git review

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?

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.

1 Like

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

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

1 Like

OK, but how do I re-commit now?

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

Great - it worked.
Thanks!