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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user