Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

copier recopy --overwrite does not always overwrite #1978

Open
sthdev opened this issue Feb 21, 2025 · 0 comments
Open

copier recopy --overwrite does not always overwrite #1978

sthdev opened this issue Feb 21, 2025 · 0 comments
Labels
bug triage Trying to make sure if this is valid or not

Comments

@sthdev
Copy link

sthdev commented Feb 21, 2025

Describe the problem

I have a Git repository, which is based on a template. The repository was updated several times with copier update and some generated files were manually edited. Now, I want to overwrite all manual edits by running copier recopy --overwrite. However, this overwrites only some files but leaves other files as they are. See logs below.

Why are some files skipped? Why does it care about conflicts at all if the purpose of copier recopy in contrast to copier update is to simply overwrite everything with generated files from the template?

Even more astonishing is that copier recopy (without --overwrite) asks for some files if I want to overwrite them but other files are just skipped. See second log below.

Template

This does not seem to be related to a particular template.

To Reproduce

No response

Logs

copier recopy --skip-answered --overwrite

Copying from template version 0.13.6
  conflict  .prettierignore
 overwrite  .prettierignore
 identical  .github
  conflict  .github/CODEOWNERS
 overwrite  .github/CODEOWNERS
 identical  .github/workflows
  conflict  .github/workflows/enforce-repo-settings.yaml
 overwrite  .github/workflows/enforce-repo-settings.yaml
  conflict  .github/workflows/cleanup-pull-request.yaml
 overwrite  .github/workflows/cleanup-pull-request.yaml
  conflict  .github/workflows/main.yaml
 overwrite  .github/workflows/main.yaml
  conflict  .github/workflows/pull-request.yaml
 overwrite  .github/workflows/pull-request.yaml
  conflict  README.md
      skip  README.md
 identical  container
  conflict  container/Dockerfile
      skip  econtainer/Dockerfile
 identical  renovate.json
  conflict  .copier-answers.yml
 overwrite  .copier-answers.yml
  conflict  .pre-commit-config.yaml
 overwrite  .pre-commit-config.yaml
 identical  helm
 identical  helm/preview
  conflict  helm/preview/Chart.yaml
      skip  helm/preview/Chart.yaml
 identical  helm/preview/.helmignore
  conflict  helm/preview/values.yaml
      skip  helm/preview/values.yaml
 identical  helm/ehr-authentication-gateway
  conflict  helm/ehr-authentication-gateway/Chart.yaml
      skip  helm/ehr-authentication-gateway/Chart.yaml
 identical  helm/ehr-authentication-gateway/.helmignore
 identical  helm/ehr-authentication-gateway/templates
 identical  helm/ehr-authentication-gateway/templates/.gitignore
  conflict  helm/ehr-authentication-gateway/values.yaml
      skip  helm/ehr-authentication-gateway/values.yaml



copier recopy --skip-answered

Copying from template version 0.13.6
  conflict  .prettierignore
 Overwrite .prettierignore? [Y/n] 
 identical  .github
  conflict  .github/CODEOWNERS
 Overwrite .github/CODEOWNERS? [Y/n] 
 identical  .github/workflows
  conflict  .github/workflows/enforce-repo-settings.yaml
 Overwrite .github/workflows/enforce-repo-settings.yaml? [Y/n] 
  conflict  .github/workflows/cleanup-pull-request.yaml
 Overwrite .github/workflows/cleanup-pull-request.yaml? [Y/n] 
  conflict  .github/workflows/main.yaml
 Overwrite .github/workflows/main.yaml? [Y/n] 
  conflict  .github/workflows/pull-request.yaml
 Overwrite .github/workflows/pull-request.yaml? [Y/n] 
  conflict  README.md
      skip  README.md
 identical  container
  conflict  container/Dockerfile
      skip  container/Dockerfile
 identical  renovate.json
  conflict  .copier-answers.yml
 overwrite  .copier-answers.yml
  conflict  .pre-commit-config.yaml
 Overwrite .pre-commit-config.yaml? [Y/n]

Expected behavior

copier recopy --overwrite should not care about conflicts and just overwrite all files with the ones generated from the templates.

Screenshots/screencasts/logs

No response

Operating system

Linux

Operating system distribution and version

Ubuntu 24.04 (devcontainer)

Copier version

9.5.0

Python version

3.12.3

Installation method

pipx+pypi

Additional context

Manual edits occurred in both kinds of files, those that are overwritten by copier and those that are skipped.

@sthdev sthdev added bug triage Trying to make sure if this is valid or not labels Feb 21, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug triage Trying to make sure if this is valid or not
Projects
None yet
Development

No branches or pull requests

1 participant