Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
14 changes: 14 additions & 0 deletions git-hooks/tests/commit-msg.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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' {
Expand Down Expand Up @@ -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 <noreply@anthropic.com>`n"
$result = Invoke-BashHook $content
Expand Down