TVC - Terrible Version Control¶ ↑
What TVC Is:¶ ↑
TVC is a really terrible pseudo-remake of git in Ruby. It should never really be used; its creation was a joke and a learning experience. It will always be inferior to git. I read a blog post called The Git Parable, and wrote it based on some of the explanations given there. It’s not a terribly well written piece of code, just a script I hacked together in the span of about a day. I’m slowly adding to and revising it, but don’t expect much. If you’re the version control police, please don’t arrest me. It was all meant as good fun, I swear!
Also, this is the first real thing I’ve written in Ruby. It’s not going to be pretty, and I’m pretty sure I’m not doing things “the Ruby way” or whatever. Be gentle.
However, you might find it interesting to look at. It works in limited situations: if you only want a local repository, and you don’t need a whole lot of features or quality, well, it might do.
Features (if you can call them that):¶ ↑
-
Storing versions
-
Branching
-
Merging (but it’s a pretty terrible merge right now, don’t trust it!)
-
Viewing a list of commits for the branch you’re on
-
Pulling a previous revision
What You Need:¶ ↑
-
Ruby 1.9
-
The desire to use sub-par code
What To Do:¶ ↑
Well, if you’re still reading after all my warnings, I guess you want to try this out. You’re crazy.
First, install the TVC gem.
% gem install tvc
Go to where you want your repository and type: % tvc init This will initialize the repository. After that, commit like so:
% tvc commit “some message about committing” And of course, it’s going to be the same anytime you want to commit changes to the repository. To branch, type:
% tvc branch <some name for the branch> If no name is specified, it will list all current branches. To move to a branch, type:
% tvc checkout <name of a branch> Now you’re on that branch, ready to modify it. Once you’ve committed changes to the branch and want to merge them in somewhere else (say, for instance, the master branch), type:
% tvc checkout <branch you want to merge into> % tvc merge <branch you want to merge from> By now, you’ve noticed each commit has a corresponding SHA-2 hash. If you want to pull the files from a revision, type: % tvc replace <the hash of the commit you want> You don’t have to type the whole hash, you can type just a few characters off the front of it. You run the risk of messing up, I suppose. Be careful. If you want to roll back your repository to how it was at a specific commit, type: % tvc rollback <the hash of the commit you want> And if you want to just reset everything to how it was before you screwed everything up, you can go back to the last commit by typing:
% tvc reset
To get a list of all commits up the tree from where you currently are, type:
% tvc history To see a list of what has changed since the last commit to the repository, type:
% tvc status And, if you ever forget these few commands, they’re accessible by typing:
% tvc or
% tvc help
Things That Might Happen Eventually:¶ ↑
-
Better status information.
-
Unit tests. Probably should have started with those, but oh well.
-
The ability to work with external repositories (push, pull, users, blah blah blah)