[Development] git submodules

Sze Howe Koh szehowe.koh at gmail.com
Wed Jan 1 01:23:10 CET 2014


On 1 January 2014 04:00, Jiergir Ogoerg <f35f22fan at gmail.com> wrote:
> Thanks,
> I managed to commit my changes to local qtbase, but when trying to
> push from the folder qtbase to gerrit it complains about
> "Change-Id"...


Hi,

If you have a look at other commit messages (e.g.
https://codereview.qt-project.org/#change,74482), you'll see a text
field called "Change-Id" at the end of the message, which is a SHA-1
ID. Every submission must have a unique Change-Id. If you update your
patch, keep the existing Change-Id. This lets Gerrit know that you are
pushing an update, not a new patch.

Also notice the "Task-number" field which lets you link a patch to a
bug report (e.g.
https://bugreports.qt-project.org/browse/QTBUG-35722).

If you had used 'init-repository' script to clone the submodules, it
would have automatically set up the necessary git hooks to
auto-generate a Change-Id when you make a new commit. Anyway, you can
do it manually:

1) Copy the contents of <Qt>/qtrepotools/git-hooks into <Qt>/qtbase/.git/hooks
2) Edit <Qt>/qtbase/.git/config and add these 2 lines (replace <Qt>
with your absolute path):

    [commit]
        template = <Qt>/.commit-template

3) Call 'git commit --amend' to generate the Change-Id
4) Push again

Repeat (1) and (2) for every repository you wish to make changes in.


Regards,
Sze-Howe



More information about the Development mailing list