Last active
July 22, 2025 10:55
-
-
Save jakobhellermann/bfeb9f449d8a3195edda5348a63293b5 to your computer and use it in GitHub Desktop.
jj team configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [custom] | |
| coauthors = ["John Doe <doe@company.com>"] | |
| [aliases] | |
| team = ['util', 'exec', 'sh', '--', '-c', ''' | |
| set -euo pipefail | |
| coauthorsfile="$(dirname $(jj config path --user))/coauthors.json" | |
| if [[ $# -eq 0 ]]; then | |
| jj config list --color never | rg 'custom.coauthors' | head -n1 | cut -d= -f2 | jq -r .[] | |
| exit 0 | |
| fi | |
| if [[ "$1" == "--help" || "$1" == "-h" ]]; then | |
| echo "jj team alias1 alias2" | |
| echo "jj team # show current" | |
| echo "jj team disable" | |
| exit 0 | |
| fi | |
| if [[ "$1" == "list" ]]; then | |
| jq '.' "$coauthorsfile" | |
| exit 0 | |
| fi | |
| if [[ "$1" == "disable" ]]; then | |
| jj config set --user custom.coauthors "[]" | |
| exit 0 | |
| fi | |
| coauthors=$(jq --compact-output '. as $coauthors | $ARGS.positional | map($coauthors[.])' "$coauthorsfile" --args "$@") | |
| jj config set --user custom.coauthors "$coauthors" | |
| ''', ''] | |
| [template-aliases] | |
| default_commit_description = ''' | |
| surround("\n\n", "\n", config("custom.coauthors").as_string_list().map(|author| "Co-Authored-By: " ++ author).join("\n")) | |
| ''' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jj team doe medrano # configure active coauthors | |
| jj commit # this will add `Co-Authored-By: ` lines for every coauthor | |
| jj team # show current config | |
| jj team list # show all coauthors | |
| jj team disable # remove all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment