question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't checkout anything by default on local templates

See original GitHub issue

I’m currently translating a cookiecutter template to a copier one, and each time I change something, I have to commit the change for copier to pick it up. At first it was confusing (“why did files that I removed were copied??”), and now it’s annoying (a “wip” commit for every change, and then I’ll have to squash them or something).

I think it’s because copier tries to checkout the latest tag? I’d like it not to do anything if I don’t specify the -r, --vcs-ref option.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
yajocommented, Jun 15, 2021

As a user I want to be able to test templates quickly/iteratively using existing cli tool (not via pytest fixture)

Yes, well that makes sense indeed.

However, I cannot predict what you want to test. Is it a copy, a recopy or an update? Besides, when copying a non-git template, the results and features are different, so you could get to unexpected results when comparing your dev with production environments.

However I guess that we can make this assumption: if the template is a local directory and it is dirty, you’re developing the template, so you’re going to want to test those dirty changes, so Copier could take the freedom to do the wip commit dance automatically and print a warning so you are aware of that.

1reaction
pawamoycommented, Jun 15, 2021

Oh yes, thank you! I happen to have written my tests in a simple shell script though 😅

But I’ll use your fixture if I convert them to a pytest suite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up a library to require check out of files - Microsoft Support
Learn how to set up a library checkout to require people have to check out a document before they can edit it, and...
Read more >
Your local changes to the following files would be overwritten ...
Only run this if you want to discard local changes. I encountered the same problem and solved it by git checkout -f branch....
Read more >
Adding store policies - Shopify Help Center
Optional: If you don't have a Refund policy, Privacy policy, or Terms of service, then you can click Create from template to use...
Read more >
git-checkout Documentation - Git
If local modifications in a submodule would be overwritten the checkout will fail unless -f is used. If nothing (or --no-recurse-submodules ) is...
Read more >
Development guide for GitLab CI/CD templates
It usually should be used by itself in projects that don't have any other ... like image or before_script in a default section...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found