From dd70412911e22b4ced5b07e36439c8ef03d527c3 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sun, 14 Jan 2024 23:22:02 +0100 Subject: Automatization of closing bug in git-bug via commit message. --- post-commit | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 post-commit diff --git a/post-commit b/post-commit new file mode 100644 index 0000000..b0587ba --- /dev/null +++ b/post-commit @@ -0,0 +1,8 @@ +#!/bin/sh +set -eux + +BUG_ID=$(git format-patch --stdout HEAD~|git interpret-trailers --parse|awk -F '#' '/^Fixes: gb#/ { print $2}') +if [ -n "$BUG_ID" ] ; then + git bug comment add "${BUG_ID}" -m "Closed by the commit $(git log -1 --abbrev=12 --format="format:%h" HEAD)." + git bug status close "$BUG_ID" +fi -- cgit