March 3, 2009

The Right Tool For The Job

Traceability

A couple of days ago, I was talking with a colleague about an interesting customer call. A bug report had been filed, but I couldn't remember its ID. I wanted to check and make sure its release number had been recorded correctly, so I needed to find it. We use the Perforce "Jobs" subsystem to keep track of reported bugs and enhancement requests, so I knew right were to go. The only question was: how to get there?

There are 3 different tools I use every day to deal with Perforce jobs. Each is designed to be used in a particular context, and each takes a slightly different view of a Perforce depot.

The command line client, "p4", is often my reflexive choice. I spend at least half of my day in terminal windows scattered across my workstation, so the p4 command is always right at my fingertips. A quick "p4 jobs -e" command will instantly get me what I need most of the time.

But sometimes I do need more, and sometimes I'm not even sure, at first, exactly what I'm going to want to find out. I could still use the command line client to explore the jobs system, but, I confess, I need to fall back to the "p4 help" command before I've gotten very far, and that really slows me down.

When all I know is that I'm probably going to want to know more, P4V is the way to go.  I can click an icon on my desktop and have an instance of P4V running immediately, with the main window configured just as it was when I left off the last time. It's easy to find the job I'm looking for, and I can see any change submissions that are associated with it, including all of the files touched by each change, and I can even examine the text of the files themselves, and see exactly how each was modified.

I use P4V quite a lot, but there's another GUI that often comes in handy: P4Web. There's a handy link on our intranet home page that points to our local P4Web instance, and since I always have a browser open to our home page, P4Web is always right there, one mouse click away. And although P4Web doesn't give me quite as much flexibility in defining my search as P4V, it does give me instant access to a fairly tunable view of the data.

What's the best tool for mining information from a Perforce depot? I'll have to take a page from the consultants' handbook and answer: It depends. For me, it depends on what I know and what I want to find out. It depends on what else I happen to be working on at the moment, and which window has the focus. It depends on something I can't even define, some momentary whim that draws me to one tool rather than another.

In the case that started this, all I wanted was to see the job report. I could find it with a few keystrokes in the terminal window where I was already working, so the command line client was the way to go that time.