Summary
gh aw compile rewrites the consuming repository's .gitattributes to append merge=ours to the lock-file entry. merge=ours is not a built-in git merge driver, so without a merge.ours.driver configuration it has no effect — while implying that generated-file conflicts are handled automatically.
Environment
- gh-aw: observed on v0.84.3; code path still present on
main (v0.85.1)
- OS: macOS
Actual
Running gh aw compile changed an existing repository-owned line from:
.github/workflows/*.lock.yml linguist-generated=true
to:
.github/workflows/*.lock.yml linguist-generated=true merge=ours
No merge.ours.driver is defined anywhere by gh-aw, and nothing in the docs instructs users to define one.
Verification that the attribute is inert
mkdir /tmp/mergetest && cd /tmp/mergetest && git init -q .
echo "*.lock.yml merge=ours" > .gitattributes
echo a > f.lock.yml && git add -A && git commit -qm base
git checkout -qb feat && echo feat > f.lock.yml && git commit -qam feat
git checkout -q main && echo main > f.lock.yml && git commit -qam main
git merge feat
Result:
Auto-merging f.lock.yml
CONFLICT (content): Merge conflict in f.lock.yml
Automatic merge failed; fix conflicts and then commit the result.
Git has an ours merge strategy (-s ours) and an ours conflict-resolution option (-X ours), but no built-in merge driver named ours. merge=ours requires git config merge.ours.driver true in each clone to do anything.
Code pointers (on main)
pkg/constants/constants.go: const WorkflowsLockYmlGitAttributesEntry = WorkflowsLockYmlGlob + " linguist-generated=true merge=ours"
pkg/cli/git.go → ensureGitAttributes() actively rewrites pre-existing entries that start with the lock-yml glob to this exact string ("Updating old .gitattributes entry format"), so it overwrites deliberate repository policy rather than only appending when absent.
- Invoked from
pkg/cli/compile_infrastructure.go, pkg/cli/compile_file_operations.go, pkg/cli/add_workflow_compilation.go, pkg/cli/init.go.
Impact
- Repositories may believe generated lock-file conflicts are auto-resolved when they are not.
- Compilation mutates unrelated repository policy that the repo owner may have set intentionally, producing recurring diff churn on every compile.
Suggested behavior
- Do not add
merge=ours (keep linguist-generated=true only), or
- If gh-aw needs deterministic conflict handling for generated files, ship a mechanism that actually works from repository-owned configuration (e.g. a documented
merge.ours.driver setup step, or a documented regeneration-on-conflict workflow) and document it.
- In either case, do not silently rewrite a pre-existing lock-yml
.gitattributes line that the repository already owns.
Summary
gh aw compilerewrites the consuming repository's.gitattributesto appendmerge=oursto the lock-file entry.merge=oursis not a built-in git merge driver, so without amerge.ours.driverconfiguration it has no effect — while implying that generated-file conflicts are handled automatically.Environment
main(v0.85.1)Actual
Running
gh aw compilechanged an existing repository-owned line from:to:
No
merge.ours.driveris defined anywhere by gh-aw, and nothing in the docs instructs users to define one.Verification that the attribute is inert
Result:
Git has an
oursmerge strategy (-s ours) and anoursconflict-resolution option (-X ours), but no built-in merge driver namedours.merge=oursrequiresgit config merge.ours.driver truein each clone to do anything.Code pointers (on
main)pkg/constants/constants.go:const WorkflowsLockYmlGitAttributesEntry = WorkflowsLockYmlGlob + " linguist-generated=true merge=ours"pkg/cli/git.go→ensureGitAttributes()actively rewrites pre-existing entries that start with the lock-yml glob to this exact string ("Updating old .gitattributes entry format"), so it overwrites deliberate repository policy rather than only appending when absent.pkg/cli/compile_infrastructure.go,pkg/cli/compile_file_operations.go,pkg/cli/add_workflow_compilation.go,pkg/cli/init.go.Impact
Suggested behavior
merge=ours(keeplinguist-generated=trueonly), ormerge.ours.driversetup step, or a documented regeneration-on-conflict workflow) and document it..gitattributesline that the repository already owns.