From 6c467a5041430009c7db0eb970d11d575be53d53 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 12 Aug 2016 11:26:15 +0200 Subject: [PATCH] Added a helper git config file to simplify marking bugfixes in commits To enable the config file run (in the root source directory): git config --add include.path "$(pwd)/helpers/git/fixes_alias" Then after commiting a change, you can decorate the commit with appropriate lines by: git fixes 123456 --- helpers/git/fixes_alias | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 helpers/git/fixes_alias diff --git a/helpers/git/fixes_alias b/helpers/git/fixes_alias new file mode 100644 index 0000000000..b5744784db --- /dev/null +++ b/helpers/git/fixes_alias @@ -0,0 +1,5 @@ +[alias] + fixes = "!f() { \ + COMMIT_MSG=$(git log -1 --format=medium | tail -n +5 | sed -e 's/^ //'); \ + git commit --amend -m \"${COMMIT_MSG}\n\nFixes: lp:$1\n* https://bugs.launchpad.net/kicad/+bug/$1\"; \ + }; f"