Lots of Unix tools use the GNU readline library so there
are a number of history files to collect. I already was collecting
all of them in
~/.history.d. In addition due to problems with
NFS mounted home dirs I’d long ago put the hostname in the names
of history files as a way to prevent file corruption.
That means it’s collection of files that won’t need merging but
might be nice to have. I used to connect to machines just to look
in history files to remember how I’d done a thing. With a
vcsh tracked home dir it was less common as I often turn
complicated things into scripts, but I still have the odd long
pipeline that doesn’t really lend itself to being a script but I
might need it a few times.
past repo now tracks all changes to
generally w/o me having to do anything. My
This will make sure to add any new histories and add when already
tracked histories grow. I also set the
past repo to do rebases
by default. There’s no real chance for complicated merges so it
saves a lot of merge commits.
This provides data for loads of really useful commands. The most
vcsh past grep 'command.*an-arg' ~ to look for history.
But the files are only so big, right? History files get truncated.
Except these ones don’t -
vcsh past log -S'command.*an-arg' will
find me the commits where that command last was. And both have
been useful in the past:
So far not useful enough that I’ve wrapped them in scripts, but certainly things that have helped me a lot over the past several years.
In a way it’s another step to making my home dir like a
Smalltalk workspace. I can save little snippets of
useful commands in
past, more fleshed out scripts in
home - as
well as configurations and a way to add in additional tools.
As I learn new tools I store those steps away so I can revisit/relearn