Skip to content

Runnning update twice improves merge conflict handling #2768

Description

@david-banon-tecnativa

Describe the problem

As title says, running copier update once as part of a CI job, we get a merge conflict:
copier update --trust -a .copier-answers.yml --defaults
But running it twice while resetting in betweeen makes some merge conflicts disapear.

copier update --trust -a .copier-answers.yml --defaults
git reset --hard
`copier update --trust -a .copier-answers.yml --defaults`

Also, this somehow happens only when running in CI, i guess because on dev machines we already run copier update many times, and whatever is being cached already exists.

Template

https://github.com/Tecnativa/doodba-copier-template

To Reproduce

Steps to reproduce:

copier copy https://github.com/Tecnativa/doodba-copier-template --trust -d postgres_version=18 -d odoo_version=18.0 --defaults odoo_testing --ref v9.4.1
docker run -it -v ./:/work:z ghcr.io/tecnativa/ci-base:edge bash
copier update --trust -a .copier-answers.yml --defaultst
cat test.yaml
# See how test.yaml has merge errors
git reset --hard
copier update --trust -a .copier-answers.yml --defaults
cat test.yaml
# Now merge errors are gone.

Expected behavior

Updating a template doesn't need to be run twice to get the best results.

Operating system

Linux

Operating system distribution and version

Debian trixie and ubuntu 26.04

Copier version

copier 9.17.0

Python version

Python 3.11.15

Installation method

pip+pypi

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageTrying to make sure if this is valid or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions