Monthly Archives: April 2015

Out, damned spot!

Right now I've got a file open in Vim.

Screen Shot 2015-04-24 at 7.48.14 PM

The little plus down there means that the buffer is dirty — I've got unsaved changes. So we need to save those before they're actually on disk.

Screen Shot 2015-04-24 at 7.53.16 PM
Oops. My clean state itself is dirty — the disk has changes not reflected in the code, so lets save those disk changes into the buffer view, then make the changes, then commit those changes to disk. So we should be good now.

Screen Shot 2015-04-24 at 8.00.43 PM


Now git is dirty. So I commit. Now, how many steps am I from actually running this code? It depends. If I'm just loading it through a "file:///" style URL, the browser will check the cached version against when it was last updated — dirt! dirt! dirt! — update the cached version if necessary, and load it up.

If I'm running it in production, who knows how much dirt is left. If I'm using a reasonable deployment setup, I'm probably going to have to push to a central repository (unpushed local changes are dirty), then the script will sync the dirt from the central repository to its own copy, then check whether any dirt has been added or removed in the dependencies file, then serve it up with an accurate Expires header so the browser will know when to check for filth, and maybe an etag so it can do a spot check for the browser.

I do this whole process tens of times a day and I think of it as one step. I'm amazed it all works.