Posts

Showing posts from January, 2008

Switching Finks

One of the open-source projects I contribute to is Fink , a package manager for OS X; if you've used apt-get or yum on Linux, it provides a similar facility, allowing you to install, say, GnuPG by running fink install gnupg . It installs things into its own directory tree, rooted at /sw by default, to avoid interfering with things shipped by Apple ( / , /usr ) or manually installed by the user ( /usr/local .) That is, if you have Fink installed, your system will have /sw/bin , /sw/lib , /sw/etc , /sw/share/man , &c. So that you can run things installed in these nonstandard locations, Fink provides some shell commands in /sw/bin/init.sh which edit environment variables like PATH and MANPATH to include the /sw/* directories. Most Fink users have . /sw/bin/init.sh in their ~/.profile , so these commands will be invoked when their shell starts. Having my shell automatically pull in Fink at startup doesn't work for me, though. It's important to me to have a clea

For All Your Finger-Pointing Needs

While working with a large codebase, I often want to find the origin of a particular line. Subversion offers a tool, annotate (aka blame , aka praise ), which displays the author and revision for every line in a file, indicating who made the last change to a line. However, the last change is often not very useful; it was a minor change as a result of some other change you're not interested in, or the code was moved around due to refactoring, and you need to go back even further. When I need to do this, I find myself doing a sequence of: 1. svn blame FILE | less ; find the revision N where the line was last changed 2. svn log -r N FILE | less ; if the change is interesting, read the commit log for the file 3. svn blame FILE @ N-1 | less ; using Subversion's little-known pinned revision syntax, find the previous time the line was changed 4. Using N-1 as the new N , return to step 2. : Pretty much any Subversion command that takes a path argument can be given PATH @ REVIS