Based on a known pattern, for example 'Fix #xxxxx' where xxxxx is the issue number, add a git post-hook to add a comment to the related bug. We can use the bugzilla rest api ( https://bugzilla.readthedocs.io/en/latest/api/core/v1/general.html#authentication / https://bugzilla.readthedocs.io/en/latest/api/core/v1/comment.html#create-comments ).
This is auto generated comment
I m a curl bot. Hook Hook !
Some food for the curl bot to feast on: git log |grep -Poi "(?<=Bug)[:# ]*[0-9]+"|tr -d ':# '|xargs -I BUG_NUMBER echo "https://bugzilla.xfce.org/show_bug.cgi?id=BUG_NUMBER"
Just a test-comment with a commit link: https://git.xfce.org/xfce/xfce4-panel/commit/?id=6514d86d6fb2b2ee1e262da2012fa3c396c3fba9
Ok, so just to document this clearly here. Step1: Get API token (be sure to wrap the URL in double-quotes, otherwise bash interprets the ampersand as forking): curl "https://bugzilla.xfce.org/rest/login?login=gitbot@xfce.org&password=secretpassword" Step2: Add comment: curl -H "Content-Type: application/json" -X POST -d '{ "comment": "Just a test-comment with a commit link: https://git.xfce.org/xfce/xfce4-panel/commit/?id=6514d86d6fb2b2ee1e262da2012fa3c396c3fba9", "is_private": false, "is_markdown": true }' https://bugzilla.xfce.org/rest/bug/13510/comment?token=yoursecrettoken
Fixed in $newrev
Fixed in f26f1c077e3e3dd100c83880160f6b49318a06fb
Fixed in ae16b1b01225582a1f160c2544ae25557e626866
Fixed by ae16b1b01225582a1f160c2544ae25557e626866 on users/skunnyk/bugzilla
Fixed by 6bb96fc71ec57704e0658a9f71302471cef33629 on users/skunnyk/bugzilla
This bug was referenced in commit [https://git.xfce.org/users/skunnyk/bugzilla/commit?id=55be697c5c395526122ecdcc38ff021b4c58e3b3](55be697c5c395526122ecdcc38ff021b4c58e3b3)
This bug was referenced in commit [ecb86a8d34257f636b68cb4e68a5fedbe80697d2](https://git.xfce.org/users/skunnyk/bugzilla/commit?id=ecb86a8d34257f636b68cb4e68a5fedbe80697d2)
This bug was referenced in this commit: https://git.xfce.org/users/skunnyk/bugzilla/commit?id=8a5324aee6fb23d04fe043f88fd357182231c581
"Skunnyk referenced this bugreport in commit 14360bbf8ff7b6042913e885eb255f0955e14508 Post commit hook : Fix bug #13510" https://git.xfce.org/users/skunnyk/bugzilla/commit?id=14360bbf8ff7b6042913e885eb255f0955e14508
Skunnyk referenced this bugreport in commit 846f3519edf134094c57260bc9dc5b9864f26151 Again, I test the commit hook for bug #13510 - Now we print author name + commithash + commitmessage in bz issue - With a nice formatting - This is a usefull commit message - Will this works ? https://git.xfce.org/users/skunnyk/bugzilla/commit?id=846f3519edf134094c57260bc9dc5b9864f26151
Skunnyk referenced this bugreport in commit 5621cc6a6fb02857b8ac96125cfefbe849c71feb Only print subject on bugzilla hook - fix bug #13510 - Now we print author name + commithash + commitmessage in bz issue - With a nice formatting - This is a usefull commit message - Will this works ? https://git.xfce.org/users/skunnyk/bugzilla/commit?id=5621cc6a6fb02857b8ac96125cfefbe849c71feb
Skunnyk referenced this bugreport in commit 2a889c6eb9733838aa727132b2baf6aaf8d58f2f Only print subject on bugzilla hook, for real https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2a889c6eb9733838aa727132b2baf6aaf8d58f2f
Skunnyk referenced this bugreport in commit de8603a6834f9aacfb53fa0a4998c9fbbbcd1c8d fix bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=de8603a6834f9aacfb53fa0a4998c9fbbbcd1c8d
Skunnyk referenced this bugreport in commit 0a918c8c005a334c8d1476698eed61448b79b08a Commit number two fix bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=0a918c8c005a334c8d1476698eed61448b79b08a
Skunnyk referenced this bugreport in commit 21b53c6d394475fff46a8ce4f5c59aa26e3666eb Fix bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=21b53c6d394475fff46a8ce4f5c59aa26e3666eb
Skunnyk referenced this bugreport in commit 2ca0669f70d807c07d90c159db420e084f540a3c Fix bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2ca0669f70d807c07d90c159db420e084f540a3c
Skunnyk referenced this bugreport in commit 8ee1a89e493918febb2d9f08e4ced096d5e43973 Fix bug #13510 again https://git.xfce.org/users/skunnyk/bugzilla/commit?id=8ee1a89e493918febb2d9f08e4ced096d5e43973
Skunnyk referenced this bugreport in commit f5e01ccf3618e0a7feeb6bcb4f90c6e4f58e233d Fix bug #13510 again again https://git.xfce.org/users/skunnyk/bugzilla/commit?id=f5e01ccf3618e0a7feeb6bcb4f90c6e4f58e233d
Skunnyk referenced this bugreport in commit 9c85a20f706d3a4f01617030f631b9331051b8c0 Fix bug #13510 again 2 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=9c85a20f706d3a4f01617030f631b9331051b8c0
Skunnyk referenced this bugreport in commit 2351e2d29ae27a9f4fd2f4eedf8915280e48e2dd Maybe Fix Bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=2351e2d29ae27a9f4fd2f4eedf8915280e48e2dd
Skunnyk referenced this bugreport in commit 595573369d1b635e8ba71f45e15e2df59d256503 Yes Bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=595573369d1b635e8ba71f45e15e2df59d256503
Skunnyk referenced this bugreport in commit 83df6a7b397d3c22983654a6fb813fbda9a20521 Yes fix Bug #13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=83df6a7b397d3c22983654a6fb813fbda9a20521
Skunnyk referenced this bugreport in commit d00c95a5e0ae555fd4c93ad9093042298071eadd Yes fix again Bug: 13510 https://git.xfce.org/users/skunnyk/bugzilla/commit?id=d00c95a5e0ae555fd4c93ad9093042298071eadd
Romain Bouvier referenced this bugreport in commit 443207c966926b554b4956b86a247edcf5a4aa16 Fix bug #13510 on gitlab for real https://gitlab.xfce.org/project-116/commit/-/443207c966926b554b4956b86a247edcf5a4aa16
Simon Steinbeiss referenced this bugreport in commit 671b0da9e44491821e5eec88140d0e6f2f51d58b Fix bug #13510 on gitlab for real https://gitlab.xfce.org/skunnyk/my-project/commit/-/671b0da9e44491821e5eec88140d0e6f2f51d58b
Simon Steinbeiss referenced this bugreport in commit 2293a8813239ff6242e73153bcd66e6be64897e9 Fix bug #13510 on gitlab for real https://gitlab.xfce.org/skunnyk/my-project/commit/2293a8813239ff6242e73153bcd66e6be64897e9
Simon Steinbeiss referenced this bugreport in commit 69fccfd8712a0259199f8da36de9dd5538e0aad8 Test commit bug #13510 https://gitlab.xfce.org/skunnyk/my-project/commit/69fccfd8712a0259199f8da36de9dd5538e0aad8