Provide a way to opt out of #166
Since #166, the generated template now has the same default branch name as the generated template. This sometimes can create some issues for templates stored in main branch that matches the code in main branch.
What I want to achieve:
- Templates in main branch matches crates in main branch. So GitHub Actions can be run to validate the templates on pull requests.
- Templates of the released version is copied to the
templatesbranch by GitHub Actions upon a release. Version numbers inside templates are modified by GitHub Actions automatically by appending to a Rhai script. (I want to leverage the create release page from GitHub to create a release. At that time GitHub already tags the release so templates cannot be modified anymore. It's also a burden for the user to know the latest tag in order to generate from a template.)
However, repositories generated from the templates branch will have their default branch set to templates.
Is it possible to provide a way to specify the default branch name?
e.g.:
[template.vcs]
type = "git"
default_branch = "main"
So doing cargo generate user/project --branch templates will still result in a template with the main branch being created.
If I understand you correct:
- given a template repo where templates live in the branch
templates - you want to ensure that after using this template repo, users will not remain on the
templatesbranch - further they instead should have the
mainas their active branch
is this correct?
And you are suggesting a configuration like so:
[template.vcs]
type = "git"
default_branch = "main"
in the template repo to configure the users "active" branch after they have used your template repo? Right?
@futursolo could you pls provide some clarity?