Wednesday, June 25, 2008

git-log --name-status

I've been using git for the past month (I just realized that today was my first whole month at work) and I'm very happy with it. I'm used to svn (and before that, CVS) and I'd gotten around the ugly (so much so that I never used the version discussed in the subversion book for versions below 1.5) merging in svn by using svnmerge (which, while not making merging painless, did make it sufficiently less painful that it was actually usable).

For a long time I looked at git but never actually dived in head first since casual acquaintance with git made me feel dumb. Now that I've been using it for a month though (well, with git-svn, since my current project uses svn), I'm getting used to it, I've got the basic workflow down and I'm slowly learning more advanced workflows.

For a long time too I didn't like git because I thought it didn't have an equivalent to "svn log -v", that is, show the revision number, author, message, and the affected files. git-log showed the first three, but not the last. I was probably looking at an early version of git though, this would have been in 2006 or so. Sometime in revision 1.4, git-log got --name-status, but I didn't notice. Anyway, it required -r if you wanted to see recursive changes. 1.5 has better behavior now. --name-status shows filenames and what was done to them (deleted, added, modified, etc), and the -r is implied.

There are still some things I'm not clear on (e.g., how to do the equivalent of svn:externals, which is probably a SMORTD, a simple matter of reading the documentation). But given that the main VCS at work is SVN, how to work with svn:externals with git and git-svn :-).

I'll get there though. Although it may take a while since, in fact, we don't use svn:externals or similar in our current projects (in fact, the reason I decided to use git and git-svn was because we don't have the regular trunk and branches structure either, and being the new guy, I didn't want to be creating a test branch for myself at the root of the svn tree :-).

In any case, git-reset and friends (i haven't tried the --interactive options to git-commit or git-rebase and friends yet, but I will, one of these days) are great helps and because of their (admittedly, simple) enhancements to my workflow, I'm not going to be switching back to pure svn.

Our project isn't so large that the git vs svn speed difference is a factor, but I have (at a previous job) worked with sufficiently large trees and branches that the speed of git would have been a huge help. On the other hand, as smart as my co-workers were, at that job, I think that pushing git into the organization would have been too big a challenge in the time I had. svn was certainly the better choice there (since svnmerge was available, before I learned svnmerge, I spent far too much time hand-merging between branches).

Sunday, June 08, 2008

Recovering, not so gracefully

My laptop's DVD-RW drive stopped working a month or two ago. I didn't mind much since it's not essential. I can always use my wife's laptop when we have DVDs for our son to watch. I ordered Ubuntu Hardy desktop and server CDs via shipit and I got those a few weeks ago. I did want to install Hardy, but it wasn't a big deal, so I waited until I could figure out how safely.

The only thing I really *needed* the DVD drive for was for booting rescue DVDs. I didn't want to try to do an online Hardy upgrade if I couldn't go into a rescue DVD if something broke and the laptop couldn't reboot (that's happened to me once or twice, on doing an online update).

I downloaded the RIPLinux iso and installed it to my USB flash drive. I thought I could use that for rescue. Unfortunately, when I tried to do some grub surgery on my laptop, I made it unbootable. Mainly, because I'm not intimately familiar with grub (I'm a lilo man, myself, and the only thing I really dislike about Ubuntu is that it's inherently grub-centric), but also because it thought my hard drive was at /dev/hdc but Ubuntu sees it at /dev/sda. I couldn't fix that either since RIPLinux would boot and assign the flash drive it was booting from to /dev/sda.

Fortunately, when I went to Pendrive Linux and saw a tutorial on how to install Hardy onto a USB drive FROM the ISO. The recipe there worked flawlessly and I've now got a flash drive that is an Ubuntu Hardy installer as well as a live Linux. If I go to an internet cafe, or someone else's computer, I can use it and not worry about the viruses they've got running around in their Windows installation.

So I've got Hardy installed now. I'll bring the laptop to work tomorrow, update, and install all the development packages I need that aren't on the default Desktop install. I work at Catalyst IT Limited. Online updates and apt-get are very fast at work since Catalyst hosts the New Zealand mirrors for Ubuntu and Debian (and a bunch of other distributions).

Next, I need to figure out how to install OpenSolaris from some device other than the install CD :-).