diff --git a/README.md b/README.md index 380bf6aa9f443358f193f18a541b94a393c31aa8..85f7376d7a9d30ecb55f26ce159ada1120ae64fa 100644 --- a/README.md +++ b/README.md @@ -374,11 +374,14 @@ it creates. You can customize this behavior with the `attribution` option: } ``` -- `trailer_style`: Controls the attribution trailer added to commit messages (default: `co-authored-by`) - - `co-authored-by`: Adds `Co-Authored-By: Crush ` - - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush` (includes the model name) - - `none`: No attribution trailer -- `generated_with`: When true (default), adds `💘 Generated with Crush` line to commit messages and PR descriptions +- `trailer_style`: Controls the attribution trailer added to commit messages + (default: `assisted-by`) + - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush ` + (includes the model name) + - `co-authored-by`: Adds `Co-Authored-By: Crush ` + - `none`: No attribution trailer +- `generated_with`: When true (default), adds `💘 Generated with Crush` line to + commit messages and PR descriptions ### Custom Providers diff --git a/internal/agent/tools/bash.tpl b/internal/agent/tools/bash.tpl index db81080cd895d41dcd3cdc98d2194d898ae03ef4..f1ef4b5a79a8e7b1d0a1804b92da218507ebed8a 100644 --- a/internal/agent/tools/bash.tpl +++ b/internal/agent/tools/bash.tpl @@ -69,7 +69,7 @@ When user asks to create git commit: {{ end}} {{if eq .Attribution.TrailerStyle "assisted-by" }} - Assisted-by: {{ .ModelName }} via Crush + Assisted-by: {{ .ModelName }} via Crush {{ else if eq .Attribution.TrailerStyle "co-authored-by" }} Co-Authored-By: Crush diff --git a/internal/config/attribution_migration_test.go b/internal/config/attribution_migration_test.go index 6f54b170ad4e4eb815e7cf22793584cb2ba4c9e4..6c891d92a9a29604d9d6c751e0d15df6edcf3598 100644 --- a/internal/config/attribution_migration_test.go +++ b/internal/config/attribution_migration_test.go @@ -66,7 +66,7 @@ func TestAttributionMigration(t *testing.T) { } } }`, - expectedTrailer: TrailerStyleCoAuthoredBy, + expectedTrailer: TrailerStyleAssistedBy, expectedGenerate: true, }, { @@ -74,7 +74,7 @@ func TestAttributionMigration(t *testing.T) { configJSON: `{ "options": {} }`, - expectedTrailer: TrailerStyleCoAuthoredBy, + expectedTrailer: TrailerStyleAssistedBy, expectedGenerate: true, }, } diff --git a/internal/config/config.go b/internal/config/config.go index 2adc45f050b46afb8788042035531c032159926e..5cc519c110476683928b8e329a0e4bf1e18c4074 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -177,7 +177,7 @@ const ( ) type Attribution struct { - TrailerStyle TrailerStyle `json:"trailer_style,omitempty" jsonschema:"description=Style of attribution trailer to add to commits,enum=none,enum=co-authored-by,enum=assisted-by,default=co-authored-by"` + TrailerStyle TrailerStyle `json:"trailer_style,omitempty" jsonschema:"description=Style of attribution trailer to add to commits,enum=none,enum=co-authored-by,enum=assisted-by,default=assisted-by"` CoAuthoredBy *bool `json:"co_authored_by,omitempty" jsonschema:"description=Deprecated: use trailer_style instead"` GeneratedWith bool `json:"generated_with,omitempty" jsonschema:"description=Add Generated with Crush line to commit messages and issues and PRs,default=true"` } diff --git a/internal/config/load.go b/internal/config/load.go index a766f838225692d0c4f732043f04613899e35a40..f4aec7bfbe3a08b3af3f78e8f1ebc6ce94e3328b 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -353,15 +353,19 @@ func (c *Config) setDefaults(workingDir, dataDir string) { if c.Options.Attribution == nil { c.Options.Attribution = &Attribution{ - TrailerStyle: TrailerStyleCoAuthoredBy, + TrailerStyle: TrailerStyleAssistedBy, GeneratedWith: true, } } else if c.Options.Attribution.TrailerStyle == "" { // Migrate deprecated co_authored_by or apply default - if c.Options.Attribution.CoAuthoredBy != nil && !*c.Options.Attribution.CoAuthoredBy { - c.Options.Attribution.TrailerStyle = TrailerStyleNone + if c.Options.Attribution.CoAuthoredBy != nil { + if *c.Options.Attribution.CoAuthoredBy { + c.Options.Attribution.TrailerStyle = TrailerStyleCoAuthoredBy + } else { + c.Options.Attribution.TrailerStyle = TrailerStyleNone + } } else { - c.Options.Attribution.TrailerStyle = TrailerStyleCoAuthoredBy + c.Options.Attribution.TrailerStyle = TrailerStyleAssistedBy } } if c.Options.InitializeAs == "" { diff --git a/schema.json b/schema.json index 3b9558fb5498b89f39959d8013b7095d051a7dfc..9fb49e12fa81d287832fbe5639420e1598711ad5 100644 --- a/schema.json +++ b/schema.json @@ -13,7 +13,7 @@ "assisted-by" ], "description": "Style of attribution trailer to add to commits", - "default": "co-authored-by" + "default": "assisted-by" }, "co_authored_by": { "type": "boolean",