From 77d99ff65513a58bf814386bd053b768b9f3e94c Mon Sep 17 00:00:00 2001 From: kalmenn Date: Fri, 22 Dec 2023 00:34:31 +0100 Subject: [PATCH] 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 --- config | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/config b/config index 66ca3fb..b70b105 100644 --- a/config +++ b/config @@ -27,10 +27,14 @@ useConfigOnly = true [alias] - lg-inline = "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)%G?%GS%C(reset cyan)%d%C(reset)'" + ck = "checkout" + s = "status" + + # custom git log (inline) # sed part courtesy of: https://stackoverflow.com/a/32038784 - lg = "!f() { \ - git lg-inline $@ |\ + 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)%G?%GS%C(reset cyan)%d%C(reset)' | \ sed \ -e 's#G#Good Signature: #' \ -e 's#B#\\x1b[31mBAD#' \ @@ -39,11 +43,15 @@ -e 's#Y#\\x1b[33mExpired Key#' \ -e 's#R#\\x1b[31mRevoked#' \ -e 's#E#\\x1b[33mMissing Key#' \ - -e 's#N##' | \ + -e 's#N##'; \ + }; f" + + # custom git log (always opens in pager) + lg = "!f() { \ + git lgi $@ | \ less -cr; \ - }; f" - ck = "checkout" - s = "status" + }; f" + # Inspired by, then evolved from: # https://www.micah.soy/posts/setting-up-git-identities/ identity = "!~/.config/git/scripts/identity.sh"