contrib: Make prepare-commit-msg hook smarter for amends
authorJonathan Wakely <jwakely@redhat.com>
Thu, 11 Jun 2020 19:22:17 +0000 (20:22 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 11 Jun 2020 19:22:33 +0000 (20:22 +0100)
commitdf665e568dcba2fe0b14a6cf0888cc78b4ebbf44
tree873579b5c1571eb8a422df4cef1f7bdae278d4b0
parent393ccb72566dc004b9ab5c3b8fb6fdca6c095812
contrib: Make prepare-commit-msg hook smarter for amends

With this change the prepare-commit-msg hook can compare the log of a
commit being amended with the staged changes, and not run mklog.py
unnecessarily. This is controlled by a git config option,
gcc-config.mklog-hook-type.

contrib/ChangeLog:

* prepare-commit-msg: Use the gcc-config.mklog-hook-type Git
config key instead of the GCC_FORCE_MKLOG environment variable.
Optionally disable generating a new ChangeLog template for
amended commits when the existing log is still OK.
contrib/prepare-commit-msg