wednesday, march 15

you've got to remember
that a lot of your mind,
a lot of the systems that your mind
integrates with
live outside of your body as you conventionally
think of it
outside of the skin and bones, beyond
the fur and feathers, external to the
narrow motions and faculties of an isolated animal

you're on the bus, riding up the highway through
the grass and utility polls, past the houses
and herds and irrigation ditches
you're looking out the windows of a conveyance
borne on taxes and legislation and road projects
and the history of a whole place

you've got the wind in your hair and a watch on
your wrist telling time according to a system
with its roots centuries deep, date math grounded
somewhere in systems ancient now for millenia

you're writing on a device impossible
to build a decade back
in strings of glyphs with their roots in
phonecia, in rome

the birds are coming back and making nests
the grass and leaves are breaking out into the sun
you feel good when you step outside and breathe the air
the air is a product of a system well beyond your
understanding and control

and yet also a system that includes you and enfolds
your actions, encompasses whatever meaning your life
might have, travels through the circuits flickering
inside your head, your heart, your lungs and legs
and fingers walking on the keys

Saturday, March 11

git-do: execute commands in the top level of a git repo

tl;dr: Use git config --global alias.exec '!exec '. Or for some reason you could write a script like this one to execute commands in the root of a git repository.

This blog lives in a git repository with entries broken up by date. So, for example, when editing this entry, I might be in a path like so:

~/p1k3/archives/2017/3/11/

I also have a Makefile in the top level of the repo, which contains targets like render and publish. Since make expects to find a Makefile in the current working directory, I often found myself in a loop where I edit a blog entry, change to the top level of a repo, run a make command, and then need to change the blog entry again.

This seems silly, and generalizes to a bunch of different repositories.

Stack Overflow says that you can do git rev-parse --show-toplevel to get the root directory of the repository, which led me to something like:

$ git config --global alias.root "rev-parse --show-toplevel"
$ cd `git root` && make render && cd -

That works, but it’s a stupid amount of typing. There are a couple of solutions for this. One, from that SO post, is:

$ git config --global alias.exec '!exec '
$ git exec make render

This works because the leading ! on the command tells git to treat it as a shell command, and by default git executes aliases to shell commands from the top-level directory of the repo. This is probably good enough, but I didn’t notice it at first so I added a git subcommand called git-do to do pretty much the same. A very simple version looks like this:

#!/bin/sh

git_root=`git rev-parse --show-toplevel`
cd "$git_root"
$@

A slightly more “sophisticated” one uses git-sh-setup, which provides some boilerplate for shell scripts written as git subcommands:

#!/usr/bin/env bash

# Help messages:
USAGE="<command>"
LONG_USAGE="Executes <command> from the root of the repository."

# Tell git-sh-setup we're ok with being in a subdir:
SUBDIRECTORY_OK=1

source "$(git --exec-path)/git-sh-setup"

# Make sure we're in a working tree, jump to top level, do command:
require_work_tree_exists
cd_to_toplevel
$@

In both cases, $@ is a variable containing all of the arguments to the script, which run as shell commands.

linkdump

RT @sarahas_san: Ha. Via @WolfieChristl https://t.co/29mHZthKkY

end of an era

Xenu’s Paradox: The Fiction of L. Ron Hubbard and the Making of Scientology

Shtetl-Optimized » Blog Archive » Insert D-Wave Post Here — Daaaamn: "Anyway, I confess that I couldn’t resist adding a tiny snark—something about how, if these claims of amazing performance were found not to withstand an examination of the details, it would not be the first time in Volkswagen’s recent history."

By decathecting in "Should I press charges against my student?" on Ask MeFi

brennen pushed to escalation at brennen/bpb-kit

Phoenician alphabet - Wikipedia

Scsh Reference Manual

DigitalOcean's Writing Guidelines | DigitalOcean

brennen pushed to master at brennen/p1k3

No Pants Party - Winfield KS 2013-09-21 - YouTube

Shell Command Language

Writer’s Block