aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-02-16 18:40:36 +0100
committerMartin Polden <mpolden@mpolden.no>2023-02-16 18:40:36 +0100
commitfe4b7c0c69c1b76e146d8170a4b7563d4e50618c (patch)
tree036814c2463e4350e1dcef018b3b3e5a5b568fab
parent5595f4dda16bf4f0a43c09860857684f5445e555 (diff)
git: preview commit via fzf
-rw-r--r--gitconfig3
1 files changed, 1 insertions, 2 deletions
diff --git a/gitconfig b/gitconfig
index a0ec5b1..b12a42f 100644
--- a/gitconfig
+++ b/gitconfig
@@ -26,8 +26,7 @@
ui = auto
[alias]
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
- lg-fzf = "!git lg --color=always | fzf --ansi --multi --reverse --delimiter=' - ' --nth=2.. | perl -lne '/ ([a-f0-9]+) - / && print $1'"
- show-fzf="!git lg-fzf | xargs -r git show"
+ fzf = "!git lg --color=always | fzf --ansi --multi --reverse --delimiter=' - ' --nth=2.. --preview='echo {} | grep -Eo \"[a-f0-9]{7,}\" | xargs -r git show --color=always' | grep -Eo '[a-f0-9]{7,}'"
s = status --short --branch
co = checkout
b = branch