dotfiles-git/config
kalmenn 77d99ff655
config: changed git lg-inline to git lgi
git lg(i) now always uses sed to display clearer GPG verification
messages. The only difference between the two aliases now being that git
lg always displays its result in a pager
2023-12-22 00:34:31 +01:00

58 lines
1.8 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
[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
[alias]
ck = "checkout"
s = "status"
# custom git log (inline)
# sed part courtesy of: https://stackoverflow.com/a/32038784
lgi = "!f() { \
git log --graph --branches --all --date=human --color $@ \
--format='%C(bold dim green)%h%C(auto) - %C(yellow)%<(12)%cr %C(bold)→%C(reset) %s%C(dim white) - %an %C(bold green)<sig>%G?</sig>%GS%C(reset cyan)%d%C(reset)' | \
sed \
-e 's#<sig>G</sig>#Good Signature: #' \
-e 's#<sig>B</sig>#\\x1b[31mBAD#' \
-e 's#<sig>U</sig>#\\x1b[33mUnknown Trust: #' \
-e 's#<sig>X</sig>#Good | Expired#' \
-e 's#<sig>Y</sig>#\\x1b[33mExpired Key#' \
-e 's#<sig>R</sig>#\\x1b[31mRevoked#' \
-e 's#<sig>E</sig>#\\x1b[33mMissing Key#' \
-e 's#<sig>N</sig>##'; \
}; f"
# custom git log (always opens in pager)
lg = "!f() { \
git lgi $@ | \
less -cr; \
}; f"
# Inspired by, then evolved from:
# https://www.micah.soy/posts/setting-up-git-identities/
identity = "!~/.config/git/scripts/identity.sh"