* Document how to update when changing a multiselect base answer
The documentation to update, changing only one answer when the question is a multi-select base choice, is missing.
This is from https://github.com/copier-org/copier/issues/1474#issuecomment-2328522026, but it also indicate to create the `.yaml` file in another directory (to avoid error `Destination repository is dirty; cannot continue. Please commit or stash your local changes and retry.`).
* style: autoformat with pre-commit
* docs: adapt to global copywriting style
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
Previously, paths that matched a pattern in `skip_if_exists` and that were deleted in the generated project were recreated during each update. This was expected, because the file now didn't exist, and thus it's considered new. However, it might be surprising to some, so docs are updated and a test now makes that an officially supported use case.
For the rest of files, they shouldn't be recreated, even if the template changed. A user that deletes the file is kind of expressing their will to ignore that file from now on. To recover it, they can just recopy the template.
BREAKING CHANGE: If you delete a file in your subproject, it will not be recreated if it changes in the template and you update the subproject. Recopy if you need it back.
- there was a inconsistence between the inline and rej default. as it's inline I changed the value in the corrected section
- as users won't need the 2 options at once, I split the 2 hooks.
- specified that both repos can be used at once
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
Docs were a bit repetitive and unclear.
Targets https://github.com/copier-org/copier/issues/1170. It could even fix it?
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Co-authored-by: Sigurd Spieckermann <2206639+sisp@users.noreply.github.com>
Now that the inline mode is out of experimental, it turns out to provide a better default behavior than the good old rej mode. Mostly when context is increased to 3 lines or more.
BREAKING CHANGE: The default update conflict mode is now `inline` instead of `rej`.
BREAKING CHANGE: By default, updates now consider 3 lines of context instead of just 1.
This new command allows to reapply a template, keeping old answers but discarding subproject evolution.
It is useful when there are bugs replaying an old version of the template, or when the subproject has drifted too much from the template and you need to reset it.
BREAKING CHANGE: All CLI calls to Copier must now include the subcommand as the 1st argument. For example, `copier` must become now `copier update`; also `copier ./tpl ./dst` must become `copier copy ./tpl ./dst`.
BREAKING CHANGE: All flags must go after the subcommand now. For example, `copier -r HEAD update ./dst` must now become `copier update -r HEAD ./dst` or `copier update ./dst -r HEAD`.
BREAKING CHANGE: Automatic mode removed. Since now subcommands are required, the automatic mode is removed.
BREAKING CHANGE: Deprecated `copier.copy` function is removed. Use `copier.run_copy`, `copier.run_update` or `copier.run_recopy` explicitly as needed.
Fix https://github.com/copier-org/copier/issues/1081
Close https://github.com/copier-org/copier/issues/1082
Fixes#613
Based on #627, but:
* Supports both old (`.rej` files) and new (inline markers) conflict behavior
* Update a test to test both rej and inline conflict resolution
* Update some tests to explicitly specify "rej" conflict mode
* Add documentation for the two conflict modes
* keeping only 3-way merge
Co-authored-by: Oleh Prypin <oprypin@users.noreply.github.com>
Co-authored-by:
Thierry Guillemot <tguillemot@users.noreply.github.com>
Co-authored-by: Barry Hart <barry.hart@zoro.com>
Co-authored-by: Jairo Llopis <yajo.sk8@gmail.com>
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
Try to answer a good question: when you upgrade one subproject from template v1 to v2, the template itself needs to be properly rendered in v1 to be compared to the subproject and extract the diff... well, we all know this at this point. But if Copier 6 renders differently the template v1 as compared to how Copier 5 would, then the template developer is on big trouble: How to evolve a subproject from a Copier v5-only template to a Copier v6-only template?
Fix https://github.com/copier-org/copier/issues/348
Mkdocs uses `python-markdown`, and [they say](https://python-markdown.github.io/#differences):
> The syntax rules clearly state that when a list item consists of multiple paragraphs, “each subsequent paragraph in a list item must be indented by either 4 spaces or one tab” (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.
As we were using 2 spaces for markdown files (which looks better in source code), some indented lists were not displaying properly in the docs page.
Thus I change the setting to 4 spaces. Prettier will now enforce them, and mkdocs will display things properly.