From 7126a40c710025322738d9c845ba3de1a650f458 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sat, 23 Apr 2022 12:55:45 +0200 Subject: [PATCH] meta:hooks:commit-msg: Allow {fixup,squash} prefix Allow the "fixup! " and "squash! " prefix' created by the `--fixup`/`--squash` flags to `git-commit` --- meta/git/hooks/commit-msg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/git/hooks/commit-msg b/meta/git/hooks/commit-msg index 58d627c..75c31c7 100755 --- a/meta/git/hooks/commit-msg +++ b/meta/git/hooks/commit-msg @@ -15,6 +15,10 @@ die() { } subject="$(head -1 "$1")" +# Ignore "fixup! " and "squash! " prefix' added by `git-commit` +subject="${subject#fixup! }" +subject="${subject#squash! }" + # Because of potential long lines in the changes (when using verbose commit) or # comments (for example when rebasing), everything until the first comment is # interpreted as body.