dotfiles-git/config

67 lines
2.1 KiB
Plaintext

# My personal git config. You're free to reuse any part of it.
# Some files are only relevent to me, and might contain private information
# (git forge URLs, which gpg keys to use, ...). They are encrypted using
# git-crypt to be extra safe.
# All of them are included under the file below. So, if you wish to reuse my
# config, you'll need to delete that setting. Otherwise git will complain.
[include]
path = personal_config
[core]
editor = nvim
quotepath = off
[init]
defaultBranch = main
[commit]
gpgsign = true
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[user]
useConfigOnly = true
[push]
default = upstream
[alias]
ck = "checkout"
s = "status"
b = "branch"
c = "commit"
# custom git log (inline)
lgi = "!f() { \
git log --graph --date=human --color $@ \
--format='%C(bold dim green)%h%C(auto) - %C(yellow)%cr %C(bold)→%C(reset) %s%C(reset bold yellow)%d <an>%an</an> <sig>%G?</sig> <sn>%GS</sn> %C(reset)' | \
sed \
-e 's#<an>\\(.*\\)</an> <sig>N</sig> <sn>.*</sn>#\\x1b[0;2;3;37m- \\1#' \
-e 's#<an>\\(.*\\)</an> <sig>E</sig> <sn>.*</sn>#\\x1b[1;33mMissing Key: \\x1b[0;2;3;37m\\1#' \
\
-e 's#<an>.*</an> <sig>\\([^N]\\)</sig>#<sig>\\1</sig>#' \
\
-e 's#<sig>G</sig>#\\x1b[0;1;32mGood:#' \
-e 's#<sig>R</sig>#\\x1b[1;32mGood (revoked since):#' \
-e 's#<sig>X</sig>#\\x1b[1;32mGood (expired since):#' \
-e 's#<sig>U</sig>#\\x1b[1;33mUnknown Trust:#' \
-e 's#<sig>Y</sig>#\\x1b[1;33mExpired Key:#' \
-e 's#<sig>B</sig>#\\x1b[1;31mBAD:#' \
-e 's#<sn>\\(.*\\)</sn>#\\x1b[0;2;3;37m\\1#'; \
}; f"
# custom git log (always opens in pager)
lg = "!f() { \
git lgi $@ | \
less --clear-screen --RAW-CONTROL-CHARS --chop-long-lines; \
}; f"
# Inspired by, then evolved from:
# https://www.micah.soy/posts/setting-up-git-identities/
identity = "!~/.config/git/scripts/identity.sh"