Friday, April 24, 2009

Versioning, and Versioning on Windows

I'm currently using git for my versioning needs, specifically msysgit on Vista. I got spoiled on distributed version control systems when I was running Ubuntu on my desktop. Bazaar was my choice then, especially since it ran just fine on Windows, too.

I've moved onto git since then, mostly because it looks like it has the most momentum. Now that I've made the switch, I'm happy. It is nice to finally have a tool which fits whatever workflow you want to throw at it, instead of having to adjust your workflow for it.

I've been a proponent of VCS as an IT goon for a long time. They aren't just useful for versioning code, they are useful for versioning all kinds of files. Some of the easiest deployment environments I've worked in and built had their production content under version control. Rollbacks were trivial, the "what changed" question was easily answered, revision numbers were part of change management.

Making a copy of everything isn't versioning, it is only rollback. Copies are just backup. It is good enough, but it isn't particularly smart.

Distributed version control is even cooler than the old fashioned (like, a couple of years ago!) centralized VCS. The previous generation required a centralized server, even if it was one user on the same machine. DVCS lets you start versioning on-the-fly.

Having things versioned makes it easy to fix your mistakes, giving you the freedom to experiment. When you screw up, you just go back to where you started. Or you can see exactly what you changed that might've screwed things up, so you can fix it faster. Are you building up a text document describing whatever it is you're working on, even just as notes? Version it. Seriously.

Of course, on Windows this all sucks. There is a GUI for git, and it is adequate, but it doesn't really unleash the Power of Git. The tools are good enough that there isn't really a reason for not using them, though.

Microsoft's versioning story is very weak. Team Foundation Server ain't gonna cut it. We need it a little bit more integrated. And free. I mean, really, when people are happily giving away the next-gen technology, you can count that part of the product as "obsolete". I'm not holding out for something at the file system level. Yet. (nor network aware, yet, either - but if they want to be better, they've got to get ahead of this)

So, in the meantime, I have a couple of Powershell aliases to help me out. I want to spend more time writing better ones, but to really get into it, I'd need to write it as a cmdlet, and I don't have the time. And I shouldn't have to - something like this should be shipped in the OS. It should be pretty, it should be easy, it should be powerful, and it should be programmable. That's just to catch up.

Here's what I'm using in $profile (I've got gvim installed for my editor. Suck it, notepad):
$vimexe = $env:USERPROFILE + '\sys\vim72\gvim.exe'
new-alias -name vi -value $vimexe

$gitexe = $env:USERPROFILE + '\sys\git\bin\git.exe'
new-alias -Name git -Value $gitexe
# git wants a HOME
$env:HOME = $env:USERPROFILE
$env:EDITOR=$vimexe

I know, not much to go with. More complex aliases are prohibitive, and functions look like functions, parenthesis and all. As I get a better understanding of how best to use git, I'm coming up with what it will take to simplify my own specific workflow. I'll share them as I do them.

No comments:

Post a Comment