Skip to content
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 starter plugin version feature (Addresses Issue #166) #234

Closed
wants to merge 4 commits into from
Closed

add starter plugin version feature (Addresses Issue #166) #234

wants to merge 4 commits into from

Conversation

skotchpine
Copy link

@skotchpine skotchpine commented Oct 3, 2017

Plugin Versioning

This isn't a finished product, but a first draft. It adds a versions to plugin-add via git branches. With this change, plguin-add takes an optional third argument <git-branch>. If a branch is given and is not master, then the plugin is cloned to <plugin-name>-<git-branch> instead of <plugin-name>.

@@ -28,7 +35,7 @@ plugin_add_command() {
display_error "Plugin named $plugin_name already added"
exit 1
else
if ! git clone "$source_url" "$plugin_path"; then
if git clone -b "$plugin_branch" "$source_url" "$plugin_path"; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you removed the ! un-intentionally, the script should fail if it's not able to clone the repo.

@tomdavidson
Copy link

@skotchpine why branches rather than tags?

@skotchpine
Copy link
Author

@tomdavidson No reason. Why tags rather than branches?

@skotchpine skotchpine closed this Nov 12, 2017
@tomdavidson
Copy link

Why closed? Vendoring the plugins would be great.

Branches just point to HEAD and are a moving target. In many cases tags vendor strong enough that a separate artifact registry is not needed. SCMs typically have built in features for tags https://github.com/asdf-vm/asdf/releases and there is an whole ecosystems of semver'd git tagged releases.

@theoretick
Copy link

theoretick commented Dec 16, 2020

Any chance we can get this PR re-opened? Or happy to open a fresh one if the original author is unwilling.

Having some basic version locking would be great in order to prevent failures due to plugins being updated. In the meantime we have to use something a bit hackier like cding to the installation path and checking out a given SHA

Branches just point to HEAD and are a moving target. In many cases tags vendor strong enough that a separate artifact registry is not needed. SCMs typically have built in features for tags https://github.com/asdf-vm/asdf/releases and there is an whole ecosystems of semver'd git tagged releases.

the above code should work fine for tags as well given -b can handle tags, so I guess that's more of a question of clarifying the help text but functionally should work.

@jthegedus
Copy link
Contributor

If this were to be reopened, I would like to lookup the default branch of the repo instead of assuming master given the recent changes to GitHub et al moving to main.

I need to finish #800 before we modify any of this too.

@theoretick
Copy link

@jthegedus great to see #800 has been merged! I took a look at it and AFAICT in order to get this one ready it sounds like we should be good to omit the else condition here and rely on a clone from the remote's default branch, wdyt?

We'd love to get this change into a release, so if you think that's the right direction happy to look into this more.

@jthegedus
Copy link
Contributor

@theoretick Yes please! Initial install being either remote HEAD, remote or remote is (I think) enough dials to satisfy people.

If you want to open a new PR I will happily review, extra points for tests ;)

theoretick added a commit to theoretick/asdf that referenced this pull request Apr 5, 2021
Allows user to specify version along with URL when adding plugin to lock
to a specific version instead of always relying on HEAD.

Relates to asdf-vm#234
@theoretick
Copy link

Sorry for the delay! Opened #916 as follow-up with a relevant test

theoretick added a commit to theoretick/asdf that referenced this pull request Apr 5, 2021
Allows user to specify version along with URL when adding plugin to lock
to a specific version instead of always relying on HEAD.

Relates to asdf-vm#234
theoretick added a commit to theoretick/asdf that referenced this pull request Aug 8, 2021
Allows user to specify version along with URL when adding plugin to lock
to a specific version instead of always relying on HEAD.

Relates to asdf-vm#234
theoretick added a commit to theoretick/asdf that referenced this pull request Aug 8, 2021
Allows user to specify version along with URL when adding plugin to lock
to a specific version instead of always relying on HEAD.

Relates to asdf-vm#234
theoretick added a commit to theoretick/asdf that referenced this pull request Aug 21, 2021
Allows user to specify version along with URL when adding plugin to lock
to a specific version instead of always relying on HEAD.

Relates to asdf-vm#234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants