December 2007


Git is split up into a whole bunch of executables like git-commit and git-status, but you can also run them by doing git commit and git status. Cool, right? But it doesn’t work with your own scripts, so you can’t just put git-wip in your PATH and have it work. To fill this need I cooked up a Zsh function that does what git should be doing itself:

    git() {
      for p in $(echo $PATH | tr ':' '\n'); do
        if [[ -x "$p/git-$1" ]]; then
          eval "$p/git-$1 $argv[2,-1]" && return
        fi
      done

      eval "/usr/bin/env git $argv"
    }

Update: The above function has the annoying side-effect that if the git command fails or any valid reasons (such as canceling a commit by not providing any message), it’ll try to run it again. For that reason, and since Coda showed me how to shell out with git aliases, I recommend not using this function.

Now that I’ve had Leopard for a while I think I’ve settled the dispute between Time Machine and File Vault. Time Machine won out.

The problem was that FileVault works by setting up an encrypted disk image that is mounted in the /Users directory, rather than /Volumes where things you mount yourself (like DMGs) go. This allows you to pretty much transparently interact with your files, blissfully unaware that they’re being encrypted/decrypted on the fly, however to Time Machine your whole home folder is just one file. So while I’ve heard something about being able to access stuff by digging around in the bowels of the directory structure that Time Machine sets up on the external hard drive, you can’t use Finder’s interactive file restore system, making it much less useful IMO. After all, backup is an old problem that has solutions, but the whole point of Time Machine is to make it easy enough to actually use.

So my solution was to instead put everything that I wanted encrypted into an actual encrypted disk image that I just mount myself. This also had the benefit of slightly speeding up my system, especially login.