-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add git provider as a source for templates #305
Comments
I'm curious to what the assumptions and thoughts for this feature might be
|
@motowilliams thanks for the comments. We have just started thinking about this, we don't have very specific plans but I can let you know what I'm currently thinking. These are all just my initial thoughts, if you have any concerns or ideas please chime in as none of this is set in stone.
For the first release I'm thinking that the git repository should contain 1 or more After the repository is cloned we should have a command like
I think there are 2 high level ways we can add support for git.
There are pros/cons to both approaches here. The advantage of using git on the path is that we would be able to leverage auth flows like ssh/https easily if they have already been configured. Without this I think we'll need to spend a lot of time on enabling all the scenarios and that could be a big time investment.
See above comment about git on path versus using git libraries. I think if we used git on the path it makes it easy to support both public and private repos. We would certainly want support for both here.
There is nothing specific to github here, just git.
With sharing templates if we add git support we will have three providers; folder, nuget and git. Here is how I view the primary user scenarios for each.
For git there are two things to remember here.
At least for the first release I'd like to keep it simple. At most we could consider adding support for branch, but I'd like to avoid that as well. If you're sharing a template with git, I'd like for the guidance from us to be: have your templates setup in the main branch and instruct users to invoke
Version would not apply to the git case. It would be ignored, or we would throw an error if passed in. I think error is preferred but not sure.
See my comment above about update.
See my comment above about git on the path versus git libraries.
If the user invokes |
+1 on not having a stict predefined folder structure. How does updating from a NuGet package work currently? If I install a template NuGet package, then release a new version, does it automatically get updated then next time I try to use it? Is there a As a template author, I always want my users to have the latest version of my template and 99% of the time so do my users, who want the latest hotness and fixes. That's why I kind of feel that having to manually |
IMO it would be ideal if you could look at the version numbers in Git tags for the package to download similar to how Swift resolves which Git dependency to use. So if the user specifies a major version it will get the most recent tag/release for that major version otherwise it uses the latest tag/release. If there are no tags then you could fetch the master branch although using tags/releases ensures the developer is in control of which templates users get. |
Given that NuGet provider already supports version, it'd be a good thing to also support that in Git provider, where "version" should be inteded as "tag". So possible examples: # download latest from Git repo (also works as an update)
> dotnet new --install https://somegit.com/someUser/someTemplates.git
> dotnet new --install https://somegit.com/someUser/someTemplates.git::*
# download specific version (tag) from Git repo
> dotnet new --install https://somegit.com/someUser/someTemplates.git --tag some-tag
> dotnet new --install https://somegit.com/someUser/someTemplates.git::some-tag Maybe not as a first start, but in the medium term it should be possible to pick a specific version. Of course, the If there has to be a "convention" on branches, just consider If template version is supported (whether from Nuget or Git), there should also be a way to see what version you currently got installed on machine, so HTH |
I hope I'm wrong (or just can't find it / figure it out) but it seems libgit2sharp doesn't easily support SSH. Not a big deal if there are no plans to support SSH but I assume that would be a use case (it would be for me). |
I think adding a git provider would be absolutely killer. I'd love to just have to push to git, with a tag, to release a new template. Adding a nuget, just for the sake of being a delivery mechanism is going to add fluff in order to create and maintain these templates. Realistically you'd need to setup a build script to create these for you, to remove the manual labor |
This is being worked on in #660 |
Looks like #660 has stalled. What is going to be the method of standing up a project ala |
@motowilliams I've commented on the remaining work in #660. Also note that this is an installation case, not a direct invocation of new on an URL pointing to a repo as the template specification - that work is not planned. |
closing as the last activity was over 2 years ago. Please reopen if this is still desired. |
Currently for sources we have Folder and Zip style packages. We should investigate what it would take to add git as a provider. I think this will make creating and sharing templates for the community drop dead simple. Let's discuss more soon.
The text was updated successfully, but these errors were encountered: