Skip to content

feat: Support --diff3 flag in update command#2488

Draft
ytausch wants to merge 1 commit intocopier-org:masterfrom
ytausch:diff3
Draft

feat: Support --diff3 flag in update command#2488
ytausch wants to merge 1 commit intocopier-org:masterfrom
ytausch:diff3

Conversation

@ytausch
Copy link
Contributor

@ytausch ytausch commented Feb 5, 2026

Background

We want to use mergiraf with copier update in an automated copier update workflow. Mergiraf cannot be directly configured as a merge driver for our use case because copier update uses git merge-file internally. Hence, we rely on executing mergiraf in interactive mode after copier update has been run. We need diff3-style conflict markers for this. git merge-file cannot be globally configured to generate diff3-styled conflict markers; hence copier needs to pass the --diff3 flag to it.

I am aware of #2376, but this PR implements a quicker solution for immediate use with mergiraf.

Summary

  • Add --diff3 flag to the copier update command that produces diff3-style conflict markers including the base version (from last update)
  • This makes conflict resolution easier by showing what the original content was before both local and template changes
  • Particularly useful for semantic merge tools like mergiraf

AI Note

I generated this PR with assistance from Claude Code, but reviewed it manually.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.34%. Comparing base (9bed140) to head (6916d22).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2488      +/-   ##
==========================================
+ Coverage   97.33%   97.34%   +0.01%     
==========================================
  Files          55       55              
  Lines        6405     6432      +27     
==========================================
+ Hits         6234     6261      +27     
  Misses        171      171              
Flag Coverage Δ
unittests 97.34% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ytausch
Copy link
Contributor Author

ytausch commented Feb 5, 2026

@ytausch ytausch marked this pull request as draft February 5, 2026 19:39
@ytausch
Copy link
Contributor Author

ytausch commented Feb 5, 2026

Setting to draft because in the thread linked above, the core maintainer of git (Junio C Hamano) replied that they are willing to accept a patch that would enable the git merge-file behaviour to be configured globally. This would make this PR redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant