Sometimes Linux blows my mind with how elegant it is. Sometimes I'm scratching my head as to why it's so clunky.
I can configure git to use my GPG key for signing with user.signingKey
. Great. But even if it has a key UID with a full name and email, git still needs my user.name
and user.email
which it's unable to infer (I don't want to provide it manually due to 2 divergent sources of truth). Okay, annoying, but I'll just make my own helper script to call git config
with parsed output from gpg. So I look up how to parse gpg's key listing output and I find out about --with-colons
which turns it into some weird csv hell but still not "parsed", so I further find out that awk can parse this stable output by doing gpg --with-colons -k <key> | awk -F: '$1=="uid" {print $10; exit}' but that STILL only yields John Doe (work-key) <johndoe@corpo.com>
meaning that I need to provide ANOTHER command to parse the name and email out of THAT output. Just fuck my shit up.