Co-authoring Github commits with pixi
Seth Larson has a nice short post on handling co-authors on Github without
public emails, basically using jq to generate the noreply email address.
For systems without jq or administrative access, augmenting this with pixi
as the shebang works well 1:
1#!/usr/bin/env -S pixi exec --spec jq -- bash
2
3# From https://sethmlarson.dev/easy-github-co-authored-by
4# xref: https://github.com/awesomebytes/pixibang
5
6login="$@"
7read id display_name < <(echo $(curl -s "https://api.github.com/users/$login" | jq -r '.id, .name'))
8echo "Co-authored-by: $display_name <$id+$login@users.noreply.github.com>"
Which works as expected:
1ghcoauthby HaoZeke
2Co-authored-by: Rohit Goswami <4336207+HaoZeke@users.noreply.github.com>
3# more practically
4git commit -m 'feat(mta): add amazing thing' \
5 --trailer '$(coauthoredby HaoZeke)'
now managed by
chezmoiwithin my Dotfiles ↩︎
Comments
