dotfiles/.local/bin/git-aliases
Alexander Hess 721c2fd905
Add configuration for git
- Add .config/git/config
  + Define aliases
  + Configure default behavior in various situations
  + Add user information with signing key
- Add .config/git/commit_msg_template.txt
- Add .config/git/ignore
- Integrate `git` aliases into the shell
2026-09-29 13:10:16 +02:00

35 lines
600 B
Shell
Executable file

#!/bin/sh
# List the names of all `git` aliases, one per line
#
# With the "--real" flag, only the "real" aliases are listed,
# which are those with less than 7 characters in their name
# as defined under "[alias]" in ~/.config/git/config
#
# Usage: git aliases [--real]
set -eu
_max_length=999
for arg in "$@"; do
case "$arg" in
--real)
_max_length=7
;;
*)
echo 'Usage: git aliases [--real]' >&2
exit 2
;;
esac
done
git --list-cmds=alias \
| awk -v max="$_max_length" 'length($0) < max' \
| sort