Could we relax the requirement on clean git workspace for copier update ?
#2764
Shir0kamii
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I was wondering if having a clean git workspace (no dirty changes) was mandatory for the algorithm to work correctly. If not, could this be relaxed?
I don't know copier's internal workings at all, so this might be dumb but seeing the diagram in the documentation, I'm under the impression this requirement is only here to use git tools like
git difforgit merge. If that's the case, maybe we could get rid of the requirement for a versioned destination folder entirely?My idea would look like this:
I'm thinking of two use cases for this.
The first one comes from me working on a meta-template, to establish a baseline for my other templates, and which including
cttintegration and a justfile, among other things. I'd find it really useful (and really funny, I admit) to be able to apply this meta-template to itself, to keep it in line with what would be generated on other templates. I'm currently thinking on doing this in a separate commit after each new version, but I would love to be able to do that on every single commit. I'm not sure how that would work with the_commitin the answer file, but I guess that's another problem.The second one comes from an idea I haven't started to implement yet. I have a template that's starting to have more questions prompted than I'm confortable with, so I'd like to have only a few general prompts, and the ability to configure the rest through a yaml file, either through
external_dataor with adata-fileforwhen: falseprompts (assuming they can still be specified from CLI). Then that file would be dumped in the generated projects, and the user would be able to change it before updating the template, which would use the dirty version of the file. Maybe I can achieve a similar result using the new--askoption though, which I discovered during my research before creating this discussion.If it's not feasible or you think it's outside the scope of
copier, that's fine, but I was wondering what you thought about it.It might somewhat help with #2362 and the new algorithm you mention there.
Thank you for your time and for this splendid project that is
copier!All reactions