aboutsummaryrefslogtreecommitdiff
path: root/contrib/prepare-commit-msg
AgeCommit message (Collapse)AuthorFilesLines
2023-09-04mklog: handle Signed-off-by, minor cleanupMarc Poulhiès1-10/+10
Consider Signed-off-by lines as part of the ending of the initial commit to avoid having these in the middle of the log when the changelog part is injected after. This is particularly usefull with: $ git gcc-commit-mklog --amend -s that can be used to create the changelog and add the Signed-off-by line. Also applies most of the shellcheck suggestions on the prepare-commit-msg hook. contrib/ChangeLog: * mklog.py: Leave SOB lines after changelog. * prepare-commit-msg: Apply most shellcheck suggestions. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-01-16Update copyright years.Jakub Jelinek1-1/+1
2022-07-22Allow space in git commit-mklog argsMartin Liska1-1/+1
contrib/ChangeLog: * git-commit-mklog.py: Do not parse -b argument. Pass mklog_args as json environment variable. * mklog.py: Parse GCC_MKLOG_ARGS and append it to sys.argv. * prepare-commit-msg: Do not append GCC_MKLOG_ARGS to args.
2021-06-23contrib: add git-commit-mklog wrapperMartin Liska1-1/+1
contrib/ChangeLog: * gcc-git-customization.sh: Use the new wrapper. * git-commit-mklog.py: New file. * prepare-commit-msg: Support GCC_MKLOG_ARGS.
2020-06-11contrib: Make prepare-commit-msg hook smarter for amendsJonathan Wakely1-0/+13
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.
2020-06-11prepare-commit-hook: Use gcc-config.diff-file.Martin Liska1-2/+3
contrib/ChangeLog: * prepare-commit-msg: Replace ENV variable with a git config value.
2020-06-11contrib: Avoid redundant 'git diff' in prepare-commit-msg hookJonathan Wakely1-2/+4
contrib/ChangeLog: * prepare-commit-msg: Use 'tee' to save the diff to a file instead of running 'git diff' twice.
2020-06-02contrib: Make prepare-commit-msg hook safe for older branchesJonathan Wakely1-0/+3
If a user installs this script as .git/hooks/prepare-commit-msg and then works on an old branch which doesn't have the mklog.py script, trying to commit will fail with an error like: environment: /.../gcc/contrib/mklog.py: No such file or directory This makes it exit cleanly so it's possible to commit. contrib/ChangeLog: * prepare-commit-msg: Do nothing if the mklog.py script isn't present.
2020-05-27prepare-commit-msg: Save diff if requested by user.Martin Liska1-0/+5
contrib/ChangeLog: * prepare-commit-msg: Save diff to a file if the GCC_GIT_DIFF_FILE variable is set.
2020-05-26gcc-git: Add prepare-commit-msg hook.Jason Merrill1-0/+57
This patch introduces a prepare-commit-msg hook that appends a ChangeLog skeleton to a commit message when the GCC_FORCE_MKLOG environment variable is set, and a 'git commit-mklog' command set that variable while running 'git commit'. contrib/ChangeLog: * prepare-commit-msg: New file. * gcc-git-customization.sh: Install it. Add commit-mklog alias. * mklog.py: Add new option -c which appends to a ChangeLog file.