A friend of mine has been retweeting great paintings from Twitter accounts like
@HenryRothwell
, which I’ve greatly enjoyed. E.g.
Good morning - I hope you slept like a caddis-fly larvae-stuffed miller's thumb. I'm starting with 'Winter Landscape', Valerius de Saedeleer, oil on canvas, 1930s. pic.twitter.com/hk6RUFh794
— Henry Rothwell (@HenryRothwell) December 18, 2022
In a similar vein, I’ve started embedding painting images in the description of every pull request I open. E.g.
I create pull requests with:
git createpr
where createpr
is an alias to hub pull-request
with pre-populated
options:
# ~/.gitconfig
createpr = !hub pull-request --draft --browse --edit
--message=\"$(pull-request-title)\"
--message=\"$(pull-request-summary)\"
--message=\"$(random-picture)\"
The pull request body is built by joining the --message
options separated by a
blank line. Each message component has its own script:
-
pull-request-title
is a Bash script that uses the OpenAI API to summarise the commit messages into a pull request title. I haven’t quite found the right prompt text to work here — that’s a work-in-progress. -
pull-request-summary
is a simple Python script that combines all the commit messages and removes the hard line wrapping1. The output will generally need some editing before it’s suitable (hence the--edit
option in the alias) but it’s a good starting point. -
random-picture
is a Python script that plucks a randomly selected image from a set of Twitter accounts and prints the appropriate markdown.
This works nicely — the painting images even unfurl elegantly in Slack.
-
Commit messages are hard-wrapped at 72 characters but pull request descriptions shouldn’t be hard wrapped. ↩︎