When you write code to remind yourself of things, make it identify itself explicitly, because you know you're expecting to have forgotten about it.
This week I attempted a 'git push' at work and got a strange message:
$ git push
Push attempted to branch head 'refs/heads/foo'
on Gerrit remote URL 'ssh://[hostname]/[repo]'!
Set GERRIT_SAFETY_CATCH=EXTREME_DANGER if you really meant it.
I had no idea where that message had come from. But the wording made it look like my own work, because the combination of 'safety catch' and 'extreme danger' is an obscure Hitchhikers reference which I'm fond of. So probably it was something I'd set up myself, on purpose, long enough ago to forget about it completely?
After some searching, I tracked it down to a pre-push hook that I'd installed precisely to protect myself against this mistake. (In Gerrit you often want to push to a weird secondary ref name rather than a normal branch head.)
Well done, Past Me, for two things:
1. Installing the safety catch at all, which did prevent me making a mistake.
2. Putting a distinctive joke in it which at least allowed me to recognise it as probably my own work, rather than some new feature in git itself, or a message forwarded from the Gerrit server.
But here's what I _should_ have done as well:
3. Instead of the joke (or as well), write "This message is from Simon's personal safety-catch script". I only identified it as my own work by the luck of recognising my own sense of humour. I could have made it _deliberately_ identifiable.
4. Mention the _pathname_ of the script in the error message! Then I wouldn't have had to _search_ for it – I could have gone straight there.