feat: Add configurable polecat branch naming (#825)

feat: Add configurable polecat branch naming

Adds polecat_branch_template configuration for custom branch naming patterns.

Template variables supported:
- {user}: git config user.name  
- {year}/{month}: date (YY/MM format)
- {name}: polecat name
- {issue}: issue ID without prefix
- {description}: sanitized issue title
- {timestamp}: unique timestamp

Maintains backward compatibility - empty template uses existing format.
This commit is contained in:
Adam Zionts
2026-01-21 20:53:12 -08:00
committed by GitHub
parent 0dfb0be368
commit 02390251fc
7 changed files with 353 additions and 37 deletions

View File

@@ -558,6 +558,17 @@ func (g *Git) Remotes() ([]string, error) {
return strings.Split(out, "\n"), nil
}
// ConfigGet returns the value of a git config key.
// Returns empty string if the key is not set.
func (g *Git) ConfigGet(key string) (string, error) {
out, err := g.run("config", "--get", key)
if err != nil {
// git config --get returns exit code 1 if key not found
return "", nil
}
return out, nil
}
// Merge merges the given branch into the current branch.
func (g *Git) Merge(branch string) error {
_, err := g.run("merge", branch)