From fbbbd6510e3dd8c2134147c4e3b698e4e6465e3d Mon Sep 17 00:00:00 2001 From: pegasust Date: Sun, 24 Sep 2023 22:01:51 -0700 Subject: [PATCH] feat: git-lola and git-lol now has time --- nix/repo/home-configs/default.nix | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/nix/repo/home-configs/default.nix b/nix/repo/home-configs/default.nix index 69586b6..bf085bb 100644 --- a/nix/repo/home-configs/default.nix +++ b/nix/repo/home-configs/default.nix @@ -74,6 +74,40 @@ in { home.username = "hungtran"; home.homeDirectory = "/Users/hungtran"; home.stateVersion = "23.11"; + repo.shells.shellAliases = { + git-lol = '' + git log --graph --decorate --color=always --abbrev-commit \ + --pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' | + while IFS= read -r line; do + # Format the relative time + line=$(echo "$line" | sed -e 's/ minute/ min/' \ + -e 's/ week/ wk/' \ + -e 's/ hour/ hr/' \ + -e 's/ month/ mo/' \ + -e 's/ year/ yr/' \ + -e 's/ ago//') + + # Print the formatted line + echo "$line" + done | less -R + ''; + git-lola = '' + git log --graph --decorate --color=always --abbrev-commit --all\ + --pretty=format:'%C(auto)%h %d %C(cyan)%s %C(green)(%cr)%C(reset)' | + while IFS= read -r line; do + # Format the relative time + line=$(echo "$line" | sed -e 's/ minute/ min/' \ + -e 's/ week/ wk/' \ + -e 's/ hour/ hr/' \ + -e 's/ month/ mo/' \ + -e 's/ year/ yr/' \ + -e 's/ ago//') + + # Print the formatted line + echo "$line" + done | less -R + ''; + }; } ]; };