CVS goodies

I use CVS (Concurrent Versioning System; CVS in wikipedia) regularly to track software, user’s guides, and technical papers that I write. The ability to track different versions, and roll back when absolutely necessary, is a wonderful safety net to have. When collaborating with others, the fact that we can all be working on our own copies at the same time is a productivity boon. I also like being able to review log messages covering a given file’s evolutionary history. (And no, I am not going to discuss the merits of CVS versus SVN (Subversion); there’s plenty of that all over the net for you to enjoy.)

Today, thanks to a co-worker’s presentation and some ensuing research, I learned some new CVS tricks that promise to make it an even more useful tool for me:

cvs admin -m rev:msg

Update the log message for revision “rev” to be “msg”. While some might wince at the potential for revisionist (*snerk*) activity, this will be oh-so-handy for fixing those typos you notice only after hitting enter on your cvs commit -m "My messge goes hre".

cvs checkout -D "1 hour ago"

(Or, ye gads, -D “1 week ago”, depending on the level of panic you’re experiencing with oh-my-god-it’s-BROKEN!) Check out the version of each file that was current as of the specified date. You can use absolute dates, too, but the relative thing is pretty darn cool!

cvs tag -D "6/5/07" tag last_known_good

Tag all files as of the specified date (relative dates good here, too!) with the “last_known_good” tag. Ultra-useful if you need to go back in time and tag a release that you meant to tag before you went and modified a bunch of files.

cvs annotate filename

Annotate each line of “filename” with the last revision in which it was modified. Also shows who was the modifier. Fun pipeline:
cvs annotate filename | cut -f2 -d'(' | cut -f1 -d' ' | sort | uniq -c
This will show a count next to each author indicating how many of the “most recent changes” they are responsible for.

cvs watch add filename

Receive email whenever “filename” is modified by someone. Note: cvs watch on filename is quite different; it turns on read-only checkouts of “filename”. Developers would then need to issue cvs edit filename to get a writeable version of “filename”, which alerts others to their actions. Also, they then are listed when cvs editors filename is issued.

What are your favorite CVS commands?

Victory over Spotlight

Mac OS 10.4 has a nifty built-in fast-search feature called Spotlight, which supports deep searches (into the contents of a file), not just filename searches. To do this, it maintains an index of all of the files on your hard drive. This is handy.

It is less handy if, like me, you periodically connect an external hard drive for the purposes of backing up your system. As soon as I connect the drive, the BounceBack software I use auto-starts a backup of my (100 GB) Mac hard drive. Spotlight wakes up and starts trying to add the contents of the (300 GB) backup drive to its index… which is stored on the Mac’s hard drive. The first time I noticed this, I also started getting unexplained “I/O permission” errors from BounceBack for a small subset of my backed-up files. I don’t know if that’s the cause, but either way, I definitely don’t want Spotlight to index the backup drive (the utility of doing this is almost nil).

Spotlight’s preferences do permit you to exempt certain files, folders, or drives from being indexed. See System Preferences->Spotlight->Privacy. However, frustratingly, it “forgets” about my exemption of the backup drive each time it is disconnected. This was driving me nuts! Finally, today, I found a solution, courtesy of a comment made nearly two years ago by Systems Boy (thank you Google!).

You can permanently disable Spotlight indexing via:
sudo mdutil -i off /Volumes/YourFireWireDrive

Another possibly useful hint came from an equally old comment by Neil Lee:

The other thing to remember is if you want to add something to Spotlight’s Privacy tab, Spotlight needs to have completely indexed it at least once before it can be added.

I have not tested the latter, since disabling it with mdutil as suggested above seems to have worked like a charm.

What’s in my inbox

Lately, I’ve been engaged in a duel with my inbox. I’m trying to get it down as low as possible. It’s trying to expand without limit. We usually manage an uneasy balance that involves me going through spurts of filing and deleting and it going, “You’ve got mail!” (No, it’s not audible. Email is distracting enough without an interrupting beep.)

At any rate, I realized one day that I didn’t even have a clear idea of the true magnitude of the problem. How much email was I receiving each day? And what kinds of messages were they?

I decided to track incoming email for a week. The graphic at right (click to enlarge) shows the fractional breakdowns between spam and non-spam, and then a further breakdown of the non-spam in terms of what I did with it (not always accomplished on the day it arrived).

Here’s what I learned:

  • I receive an average of 88.67 messages per day: 38.67 are spam and 50 are non-spam.
  • The spam filter in my Mac OS X Mail.app is really, really good. Not shown in this graphic is the fact that I also tracked how many spam messages I had to manually mark. This ended up being 4 messages over six days, or just 0.67 messages per day. I’m impressed!
  • The most common action I take is to delete messages (19.83 per day). This suggests an obvious means for reducing the number of messages I receive: get off of mailing lists. Unfortunately, there’s only one I’m subscribed to, so this won’t help a lot. It was interesting to discover how much of my email serves only an informative purpose, requiring neither an answer nor to be filed.
  • I send a short answer to 13.33 messages per day, and I file (without answering) 11.5 additional messages. If I answered it, I probably filed it too. Therefore my mail files grow by at least 38.13 messages per day, because I usually file my response as well. It’s actually more, because I send a lot of messages that aren’t replies to incoming messages (thereby adding to someone else’s email inbox problem. Go me!).
  • Most worrying, perhaps, is the “no action” category (5 messages per day). These are net increases in the size of my inbox. And that’s after reducing the number when I deal with that day’s messages on subsequent days, too. Sometimes I conclude my day with 15 or 20 “no action” emails, which just have to be processed later. This is where I’d like to really take corrective action. But if I file email prematurely (before I do whatever needs doing with respect to its contents), then I forget about it (and the task doesn’t get done). I’ve tried moving these items to a separate (small) “Action” folder, but then I forget about that folder. Any suggestions on how to deal with this?

Overall, this was an interesting exercise, and now I have a better idea of how much email I need to deal with on a daily basis, and where my energies need to be focused. I got to claim a minor victory today: for the first time in months (maybe even years), my work inbox got below 100 messages. Yay!

Tips on how to de-stress

I tend to run at a medium-to-high stress level for a variety of reasons, so anytime I come across good advice for managing stress, I’m all ears.

Lifehacker pointed me to this excellent resource: a list of “52 Proven Stress Reducers”. This list is so full of great stuff that if I were to excerpt all of the ones I agree with and would like to practice, this post would be one big plagiarism. Instead, I’ll highlight my top five favorites:

  1. Be prepared to wait. A paperback can make a wait in a post office line almost pleasant. [Or knitting, or a journal, or the How to Think Like Leonardo da Vinci Notebook.]
  2. Don’t put up with something that doesn’t work right. If your alarm clock, wallet, shoe laces, windshield wipers–whatever–are a constant aggravation, get them fixed or get new ones.
  3. Relax your standards. The world will not end if the grass doesn’t get mowed this weekend.
  4. Do something for somebody else.
  5. Do one thing at a time. When you are with someone, be with that person and with no one or nothing else. When you are busy with a project, concentrate on doing that project and forget about everything else you have to do.

Many of these are, really, common sense — but they get forgotten enough that the reminder alone has value. I manage to be continually surprised by how effective #4 is, not just at reducing stress but also at making your day a fabulous one. Really, it works!

There are a couple of techniques I’ve found effective that did not appear on this list.

  • Get some physical exercise (like ballroom dancing or hiking, for me). Inevitably, after a dance class or a dance evening or a hike in the San Gabriels, I simply *cannot* feel stressed or unhappy. There’s too much good endorphin stuff flowing through the body to permit fretting or fussing.

  • Spend more time on processing. Most of my time is spent on input (reading books, watching movies, attending classes, studying papers, browsing the web, etc.) or output (writing papers, writing email, posting to this weblog, talking to people, etc.). I recently realized that there’s an important third category, which for lack of a better word I refer to as “processing.” This is time when you’re neither taking input or producing output, but just chewing over things that you’ve already observed. Some people call this meditation or contemplation or daydreaming. It has powerful anti-stress properties.

  • Refresh your perspective every four weeks. Each time I get a significant break from my day-to-day routine (e.g., a week visiting family or a train ride to Santa Barbara), I am suddenly able to step back and re-assess my priorities and highlight what really matters. Focusing on those items immediately de-stresses me. For whatever reason, after a few weeks I start to lose touch with it, and I’m again consumed with daily demands on my time. I can’t pull myself back far enough without a real separation of some sort (time or space). I’m finding that these breaks are so useful as to be something I should consciously plan for.

Any other de-stressing tips you can offer? I’d love to hear ’em!

How to search for email content in Pine

The mouse has its uses: surfing the web, editing images in GIMP, and doing layout in OmniGraffle are all far more convenient with point-and-click interactivity. But when I’m working with text, I have a definite keyboard-bias. I want to be able to keep my hands on the home row so that I can alternate between entering text and “meta” activities (file opening, file saving, moving text around, searching, copying, pasting, etc.) without having to move a hand to the mouse. This bias may also go back to my early college days, when Internet access came by dialing in over a modem, with a terminal connection (no SLIP yet!), so I learned to edit files using emacs (sans menus) and to send or receive email using Pine. Today, I find that working in graphical apps that were designed to take the place of these text-based options slows me down significantly. I can’t get around in Word without shifting over to the mouse or the arrow keys; I can’t save emails to folders without clicking and dragging.

The email problem has been particularly thorny. I use Pine when I want to file messages away from my inbox and into folders. I would just use Pine all the time, except that I really need to be able to search for messages with certain content, and I didn’t know how to do this with Pine. The w key lets you search through the current message, or the current folder listing, but it doesn’t search across a whole folder’s contents.

But yesterday that all changed. I learned how to search with Pine! And here it is:

Hit ; (select) then t (text) then a (all text), and then your search phrase. All matching messages are marked with an “X” and, since they are selected, can be “zoomed” by hitting z. This restricts the display to the selected subset of (matching) messages. Hitting z again zooms back out to the full folder.

I love this. It’s so amazingly fast! It feels like flying! I can zero in on the messages I want with ease and speed. And there are options: instead of [a]ll text, you can restrict the search to the To/From/CC/Subject/etc. fields. You can even go up to your list of folders and search across all of them, or [z]oom in on a subset and search those, etc. I’d used the select facility in Pine before, but only for selecting groups of messages for mass filing or deleting (also very handy), which meant selecting by Number or Date. I’m thrilled to have learned how to select by Text (content).

Update: I forgot to mention that for the ; key to work, you have to go into your Pine preferences (from the main menu, [s]etup, [c]onfig), page down to “Advanced Command Preferences” (or [w]hereis ‘aggregate’, to let Pine find it for you), and check the box next to “enable-aggregate-command-set”).

« Newer entries · Older entries »