-
Notifications
You must be signed in to change notification settings - Fork 26
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
Pin a specific commit of a plugin #1
Comments
Are there any blockers to this feature being implemented? I'd like to help, if possible |
No blockers - I've always thought of it as a pretty easy feature. I haven't done it yet because there hasn't been a lot of interest in it before now, and I just need some volunteers to test it. My take on implementing the feature is this:
Any other relevant features you'd like me to consider as part of this feature? |
Adding a layer that could convert tags to commit SHAs, as I have a few plugins that I version using tags. I'd make it so that the pin annotation would support |
@obvionaoe It's not pretty but for tags you can already do this:
Doesn't give you the guarantees that pinning a SHA-256 commit ref would give you of course. |
Related: #171 |
@mattmc3 Does there happen to an update to this issue? |
It's on my short list to address this feature in the next release. No ETA, but planning for a release fairly soon. In the mean time, there's a pretty simple workaround if you want to revert to a plugin to an older SHA: # make sure antidote is loaded, and then set these vars to whatever you need
source /path/to/antidote.zsh
GIT_WORKING_SHA=cfc3fd9a75d0577aa9d65e35849f2d8c2719b873
GIT_DIR=$(antidote path marlonrichert/zsh-autocomplete)
# revert Zsh plugin managed by antidote to a prior SHA
git -C "$GIT_DIR" fetch --unshallow
git -C "$GIT_DIR" checkout $GIT_WORKING_SHA |
It will be great if pinning can be supported in the static plugin file, and it supports pinning by git commit or git branch. Maybe reusing the existing query string used by git, like |
This is also an important security feature against supply chain attack. Imagine if a plugin maintainer's account is hacked and the hacker injects malicious code into the latest commit. Since the plugin is open source, hopefully within a few days people will find out. (unless it is too unpopular or extremely covert.) Hence, there's a common software engineering practice that delays dependency update for a few days if the dependency comes straight from the upstream developer. However, there's no defense line for antidote users. IMHO, zsh plugins are a sweet spot to attack: There are a lot of people using them, but not too many so that security measurements (such as in antidote) aren't quite geared up. There is an interesting example of an overt supply chain attack, leading to vuejs/vue-cli#7054 , which is totally avoidable by the wisdom of delaying updates for a few days. |
Per getantibody/antibody#386:
The text was updated successfully, but these errors were encountered: