Commit: support for prepare-commit-msg hook [SG-8515]

Marc Strapetz 5 years ago updated by Christoph Schäfer 7 months ago 6

(Optionally) call prepare-commit-msg hook to customize the default commit message

The problem with the current template support is that it completely overrides the merge-conflict generated messages, which we very much prefer over a static-warning commit style message.

I'd like to use SmartGIT in a project with customer provided (mandatory!) git hooks to

check and process files and prepare preformatted commit messages.

It would be nice if the generated commit message would be transferred automatically

into the SmartGIT commit GUI messagebox.

In our organization, each commit shall begin with Ticket ID.

This hook would help every developer.

Workarounds via post-checkout- or commit-hooks are far from ideal.

To be honest, I find it strange, that the prepare commit message hook is not called by SmartGit (as to my mind the most professional Client/GUI out there).

When exactly the pre-commit hook should be invoked? On every refresh?

Hello Mr Singer.

Our use case would be: You manually select changed files for commit and choose "commit" (Ctrl + K)

On the other hand our prepare commit message hook should be robust enough that it should work on every refresh. 

I assume refresh refers to periodical git checks for changes in the repo?

Edit: We are working in an environment with several Submodules

I'm using SmartGit for several years now and this is the only hook as far as I know which doesn't get invoked.
SmartGit is working great with any of our other hooks, but this one which would be a small QoL improvement just doesn't exist.
Like other I would like to infer a commit message prefix from the branch name to match our commit message style.