Support '--branch'
bubenkoff opened this issue · 8 comments
Hi
In my experience branches are more useful than snapshots.
During the development, usually people use branches, but snapshots are like commits,
which makes snapshot list so not so nice looking. Example
Can you implement branch-like snapshoting? where you can move between branches, and commit inside of them?
Sorry im not good at drawing, hope it's clear
yes sorry missed that i've already added an issue earlier :)
what do you think of it in general?
Well, I probably won't have time to implement this, but it's an interesting idea for someone to pick up.
First, it seems that the notion of consistent branch names (eg having MASTER or FEATURE always point to the latest in a branch) is separate from the idea of automatically cleaning up intermediate snapshots.
Deleting snapshots in virtualbox seems hopelessly slow, and I've even seen recommendations to clone a running VM and deleting the old one, in preference to deleting the snapshots one at a time. If that's important to you, perhaps you can make a base Vagrant box and then have multiple Vagrant projects, one for each branch?
As for the branch names idea, perhaps it could be implemented with the following:
vagrant snapshot take base
# create snapshot named base
vagrant snapshot take --branch master
# creates snapshot named master_123, where 123 is a timestamp
vagrant snapshot take
# creates snapshot master_124, where 124 is a timestamp
vagrant snapshot go base
# restores to snapshot base
vagrant snapshot take --branch featureOne
# creates snapshot featureOne_125, where 125 is a timestamp
vagrant snapshot go --branch master
# restores to snapshot master_124, since that is the latest snapshot matching master branch.
Thoughts?
How about
$ vagrant snapshot branch
shows list of branches with current one marked
$ vagrant snapshot branch
take snapshot marking it as new branch
$ vagrant snapshot commit
take snapshot under current branch
$ vagrant snapshot checkout
back to latest snapshot in current branch
$ vagrant snapshot checkout
go to latest snapshot in given branch
On 3 Sep 2013 21:40, "Alex Dergachev" notifications@github.com wrote:
Well, I probably won't have time to implement this, but it's an
interesting idea for someone to pick up.First, it seems that the notion of consistent branch names (eg having
MASTER or FEATURE always point to the latest in a branch) is separate from
the idea of automatically cleaning up intermediate snapshots.Deleting snapshots in virtualbox seems hopelessly slow, and I've even seen
recommendations to clone a running VM and deleting the old one, in
preference to deleting the snapshots one at a time. If that's important to
you, perhaps you can make a base Vagrant box and then have multiple Vagrant
projects, one for each branch?As for the branch names idea, perhaps it could be implemented with the
following:vagrant snapshot take base
create snapshot named base
vagrant snapshot take --branch master
creates snapshot named master_123, where 123 is a timestamp
vagrant snapshot take
creates snapshot master_124, where 124 is a timestamp
vagrant snapshot go base
restores to snapshot base
vagrant snapshot take --branch featureOne
creates snapshot featureOne_125, where 125 is a timestamp
vagrant snapshot go --branch master
restores to snapshot master_124, since that is the latest snapshot matching master branch.
Thoughts?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-23740803
.
Though I see the appeal of git nomenclature, it would have to be implemented in a separate plugin, since vagrant-vbox-snapshot is meant to be a thin wrapper on VBoxManage snapshot CLI.
Assuming we're keeping snapshot take
and snapshot go
(which should be called restore), we would have the following redundancies:
snapshot branch
duplicatessnapshot list
.snapshot branch <branch>
andsnapshot commit
duplicatesnapshot take
- requires #9 to be implemented
snapshot checkout
andsnapshot checkout <branch>
are duplicate ofsnapshot go
andsnapshot go <branch>
.- requires #3 to be implemented
To minimally modify the the current CLI with branch support:
$ vagrant snapshot take
# take snapshot with auto-generated name
# eg <last>_1234, where <last> would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot take <snapshot>
# create snapshot with name <snapshot>
$ vagrant snapshot take --branchb <branch>
# create snapshot with name <branch>_1234, where 1234 is a timestamp
$ vagrant snapshot take
# take snapshot with auto-generated name
# eg <last>_1234, where <last> would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot list
# shows list of snapshots; already minimally branch aware, since snapshot name contains branch name
$ vagrant snapshot go
# restore latest snapshot (currently implemented via `vagrant snapshot back`)
$ vagrant snapshot go <snapshot>
# restore snapshot with name exactly matching <snapshot>
$ vagrant snapshot go --branch <branch>
# restore the latest snapshot with branch name matching <branch>
For a first stab, here's what we'd have to implement:
- #9 -
vagrant snapshot take
with no arguments - #3 -
vagrant snapshot go
with no arguments - implement
vagrant snapshot take --branch <branch>
support - implement
vagrant snapshot go <branch>
support
Relatedly, we might also implement:
- rename
vagrant snapshot take
tovagrant snapshot restore
- improve formatting of
vagrant snapshot list
, to highlight branch names - #7 - include date in
vagrant snapshot list
Thoughts? Care to take a stab?
yes ideally i would like to see git-like everything :)
but as long as you don't want to add complexity... i see your point and
agree
in terms of help, i don't know ruby so good, but probably will try
something to implement, but looks like for branching everything is
dependent on #9
On 4 September 2013 17:55, Alex Dergachev notifications@github.com wrote:
Though I see the appeal of git nomenclature, it would have to be
implemented in a separate plugin, since vagrant-vbox-snapshot is meant to
be a thin wrapper on VBoxManage snapshot CLIhttp://www.virtualbox.org/manual/ch08.html#idp14525104.Assuming we're keeping snapshot take and snapshot go (which should be
called restore), we would have the following redundancies:
- snapshot branch duplicates snapshot list.
- snapshot branch and snapshot commit duplicate snapshot take
- requires #9https://github.com/dergachev/vagrant-vbox-snapshot/issues/9to be implemented
- snapshot checkout and snapshot checkout are duplicate of snapshot
go and snapshot go .- requires #3https://github.com/dergachev/vagrant-vbox-snapshot/issues/3to be implemented
To minimally modify the the current CLI with branch support:
$ vagrant snapshot take
take snapshot with auto-generated name
eg _1234, where would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot take
create snapshot with name
$ vagrant snapshot take --branchb
create snapshot with name _1234, where 1234 is a timestamp
$ vagrant snapshot take
take snapshot with auto-generated name
eg _1234, where would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot list
shows list of snapshots; already minimally branch aware, since snapshot name contains branch name
$ vagrant snapshot go
restore latest snapshot (currently implemented via
vagrant snapshot back
)$ vagrant snapshot go
restore snapshot with name exactly matching
$ vagrant snapshot go --branch
restore the latest snapshot with branch name matching
For a first stab, here's what we'd have to implement:
- #9 #9 - vagrant
snapshot take with no arguments- #3 #3 - vagrant
snapshot go with no arguments- implement vagrant snapshot take --branch support
- implement vagrant snapshot go support
Relatedly, we might also implement:
- rename vagrant snapshot take to vagrant snapshot restore
- improve formatting of vagrant snapshot list, to highlight branch
names- #7 #7 -
include date in vagrant snapshot listThoughts? Care to take a stab?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-23800893
.
Anatoly Bubenkov
Yep, I guess #9 would make a good first step if you wanted to try and contribute. :)
Alex Dergachev
Evolving Web, co-founder and lead developer
http://evolvingweb.ca :: web design & development
phone 514.844.4930 :: fax 514.807.7499
114-300 rue du Saint-Sacrement, Montréal, QC
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Wednesday, 4 September, 2013 at 12:24 PM, Anatoly Bubenkov wrote:
yes ideally i would like to see git-like everything :)
but as long as you don't want to add complexity... i see your point and
agree
in terms of help, i don't know ruby so good, but probably will try
something to implement, but looks like for branching everything is
dependent on #9On 4 September 2013 17:55, Alex Dergachev <notifications@github.com (mailto:notifications@github.com)> wrote:
Though I see the appeal of git nomenclature, it would have to be
implemented in a separate plugin, since vagrant-vbox-snapshot is meant to
be a thin wrapper on VBoxManage snapshot CLIhttp://www.virtualbox.org/manual/ch08.html#idp14525104.Assuming we're keeping snapshot take and snapshot go (which should be
called restore), we would have the following redundancies:
- snapshot branch duplicates snapshot list.
- snapshot branch and snapshot commit duplicate snapshot take
- requires #9https://github.com/dergachev/vagrant-vbox-snapshot/issues/9to be implemented
- snapshot checkout and snapshot checkout are duplicate of snapshot
go and snapshot go .- requires #3https://github.com/dergachev/vagrant-vbox-snapshot/issues/3to be implemented
To minimally modify the the current CLI with branch support:
$ vagrant snapshot take
take snapshot with auto-generated name
eg _1234, where would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot take
create snapshot with name
$ vagrant snapshot take --branchb
create snapshot with name _1234, where 1234 is a timestamp
$ vagrant snapshot take
take snapshot with auto-generated name
eg _1234, where would be the last snapshot name with with trailing timestamp removed
$ vagrant snapshot list
shows list of snapshots; already minimally branch aware, since snapshot name contains branch name
$ vagrant snapshot go
restore latest snapshot (currently implemented via
vagrant snapshot back
)$ vagrant snapshot go
restore snapshot with name exactly matching
$ vagrant snapshot go --branch
restore the latest snapshot with branch name matching
For a first stab, here's what we'd have to implement:
- #9 #9 - vagrant
snapshot take with no arguments- #3 #3 - vagrant
snapshot go with no arguments- implement vagrant snapshot take --branch support
- implement vagrant snapshot go support
Relatedly, we might also implement:
- rename vagrant snapshot take to vagrant snapshot restore
- improve formatting of vagrant snapshot list, to highlight branch
names- #7 #7 -
include date in vagrant snapshot listThoughts? Care to take a stab?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-23800893
.Anatoly Bubenkov
—
Reply to this email directly or view it on GitHub (#4 (comment)).
i have another KISS idea :)
what if when you GO to some snapshot, plugin will always select the latest snapshot with same name (for now it selects some 'random' one i think)
so basically this will only require knowledge of datetime of snapshots!