[Qt-creator] prepare-commit-msg and commit-msg hooks

Seth Raymond seth.c.raymond at gmail.com
Mon Jan 8 15:25:37 CET 2018


With the current Qt Creator git plugin implementation, it is difficult (and
perhaps impossible?) to use the prepare-commit-msg and commit-msg hooks to
check if a commit message is stylistically valid. This is because Qt
Creator does not run `git commit` until after the message has been written
in the "Description" box and the "Commit" button has been pressed. The
current sequence is as follows:

-User types commit message into blank Description box
-User presses "Commit"
-Description is written to temp/commit/msg
-prepare-commit-msg hook is run on path/to/repo/.git/EDIT-COMMITMSG
-Data from temp/commit/msg is pseudo-appended to
path/to/repo/.git/EDIT-COMMITMSG
-commit-msg hook is run on path/to/repo/.git/EDIT-COMMITMSG

My temporary workaround is to use a static template, but the template
cannot dynamically insert text into the commit (such as the current branch
name). I could "fix" the commit message after the user is done, but that is
not ideal. Suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20180108/a5861cdf/attachment.html>


More information about the Qt-creator mailing list