c7f9e45614
Added a documentation page that explains the "missing Change-Id in commit message" error in details and what can be done to solve the problem. Signed-off-by: Edwin Kempin <edwin.kempin@gmail.com> Change-Id: I58a193f4ad86d0a81ff048e7841e322d8b200732
42 lines
1.7 KiB
Plaintext
42 lines
1.7 KiB
Plaintext
Push fails due to commit message
|
|
================================
|
|
|
|
If Gerrit rejects pushing a commit it is often the case that there is
|
|
an issue with the commit message of the pushed commit. In this case
|
|
often the problem can be resolved by fixing the commit message.
|
|
|
|
If the commit message of the last commit needs to be fixed you can
|
|
simply amend the last commit (please find a detailed description in
|
|
the link:http://www.kernel.org/pub/software/scm/git/docs/git-commit.html[Git documentation]):
|
|
|
|
----
|
|
$ git commit --amend
|
|
----
|
|
|
|
If you need to fix the commit messages of several commits or of any
|
|
commit other than the last one you have to do an interactive git
|
|
rebase for the affected commits. While doing the interactive rebase
|
|
you can e.g. choose 'reword' for those commits for which you want to
|
|
fix the commit messages. For a detailed description of git rebase
|
|
please check the link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[Git documentation].
|
|
|
|
Please use interactive git rebase with care as it rewrites existing
|
|
commits. Generally you should never rewrite commits that have already
|
|
been submitted in Gerrit.
|
|
|
|
[[commit_hooks]]
|
|
Sometimes commit hooks are used to automatically insert/update
|
|
information in the commit message. If such information is missing in
|
|
the commit message of existing commits (e.g. because the commit hook
|
|
was only configured later) rewriting the commits will (re)execute the
|
|
commit hook and so update the commit messages. If you do an
|
|
interactive rebase to achieve this make sure that the affected
|
|
commits are really rewritten, e.g. by choosing 'reword' for all these
|
|
commits and then confirming all the commit messages. Just picking a
|
|
commit may not rewrite it.
|
|
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:error-messages.html[Gerrit Error Messages]
|