From 0ef56d09a84e5f77be2ead823b0841fbb81c9e78 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:46:38 +0000 Subject: [PATCH 1/2] Initial plan From e2a206d84bde7811a503e43d267dd039a2f8e9ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:49:40 +0000 Subject: [PATCH 2/2] Add Copilot noreply bot email test coverage and README git hooks install instructions Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com> --- README.md | 16 ++++++++++++++++ git-hooks/tests/commit-msg.Tests.ps1 | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index c87da5d..6d1b477 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # Config Files +## Git Hooks + +Strips AI-generated trailers (e.g. `Co-authored-by: Copilot`) from commit messages automatically. + +**macOS / Linux:** + +```bash +bash git-hooks/install.sh +``` + +**Windows (PowerShell):** + +```powershell +powershell -ExecutionPolicy Bypass -File git-hooks/install.ps1 +``` + ## Winget Config instructions 1. Take the desired configuration scripts from the [winget_configurations folder](./winget_configurations) diff --git a/git-hooks/tests/commit-msg.Tests.ps1 b/git-hooks/tests/commit-msg.Tests.ps1 index d5c4f31..76958ea 100644 --- a/git-hooks/tests/commit-msg.Tests.ps1 +++ b/git-hooks/tests/commit-msg.Tests.ps1 @@ -112,6 +112,13 @@ Describe 'Remove-AITrailers' { $result = Remove-AITrailers -Lines $lines $result | Should -Not -Match 'co-authored-by' } + + It 'removes Co-authored-by: Copilot with GitHub noreply bot email' { + $lines = @('Fix bug', '', 'Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>') + $result = @(Remove-AITrailers -Lines $lines) + $result | Should -Not -Match 'Co-authored-by' + $result[0] | Should -Be 'Fix bug' + } } Context 'Claude / Anthropic Co-authored-by is removed' { @@ -384,6 +391,13 @@ Describe 'commit-msg bash hook (end-to-end)' -Skip:($IsWindows -or -not (Get-Com $result.Trim() | Should -Be 'Fix bug' } + It 'removes Copilot trailer with GitHub noreply bot email' { + $content = "Fix bug`n`nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>`n" + $result = Invoke-BashHook $content + $result | Should -Not -Match 'Co-authored-by' + $result.Trim() | Should -Be 'Fix bug' + } + It 'removes Claude trailer by email domain' { $content = "Fix bug`n`nCo-Authored-By: Claude Opus 4.6 `n" $result = Invoke-BashHook $content