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

Ability to create a snapshot of current plugin versions and be able to restore from such a snapshot #32

Closed
sharat87 opened this issue Sep 20, 2012 · 6 comments
Labels

Comments

@sharat87
Copy link
Member

I propose an antigen-snapshot and antigen-restore (names not final) as described below.

antigen-snapshot — Create a snapshot file with all the information required to be able to restore all plugins, theme and whatever else, exactly at the versions they are.

antigen-restore — Given a snapshot file created by antigen-snapshot, it will restore the plugins and theme exactly as they were when the snapshot was taken.

The snapshot file could be used to reproduce your exact setup on a different machine. Currently, there is no sane way to do this.

You could put a snapshot file that you know works well, in a git repo or in a gist perhaps.

Still brainstorming on this one. What do you guys think?

@Tarrasch
Copy link
Contributor

I have for some time thought on something just like this. I like the names antigen-snapshot and antigen-restore. I definitely think this is a good next step for antigen, since what I like with pathogen (compared to vundle) is that with pathogen+gitmodules you commit your submodule hashes when you know that it will work because you have used it. I haven't tried Vundle yet, but afaik it's like antigen now. You don't have information about the versions of the submodules across your dotfiles repository.

An idea I had was to let antigen-snapshot not take any arguments. It could create something like the .gitmodules file and let antigen-snapshot read from that standard file and checkout those revisions. But there is really no "default" place to put such a file (I guess everyone doesn't have a dotfiles repository). So yea, I guess one should do as you said, that is to just provide the desired snapshot path as argument. Then the user can then decide weather they wanna check it in or just put it in a gist somewhere.

So yea, I agree with everything you said, it makes sense and I like the naming.

@GUIpsp
Copy link
Contributor

GUIpsp commented Sep 20, 2012

Easiest way to do this IMHO is a newline separated pair of the location of origin and the hash

@sharat87
Copy link
Member Author

@Tarrasch, you're right. Let's seeif Vundle ends up taking inspiration from antigen on this feature, that would be so much win :)

I haven't thought of the arguments to those commands, but come to think of it, what you say sounds good.

@GUIpsp, true. That is how the antigen-revert command is currently implemented. It should be fairly easy to bring that in to these commands.

@Tarrasch
Copy link
Contributor

As for antigen-revert, I think antigen-revert could be a one-liner provided we have antigen-{snapshot,restore}. We can let antigen-update just internally do a antigen-snapshot on some file and let antigen-revert be an alias for antigen-restore that-file. Would this work? If so it could save us some code duplication.

@sharat87
Copy link
Member Author

Yep, that's how it will be done.

@sharat87
Copy link
Member Author

Okay, I just pushed a quick implementation and I got to go now. There is also a test which is very lacking, IMO. Please check it out and let me know what you think.

I still have to change antigen-update and antigen-revert to use these new commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants