Add 'fgdiff' and 'fglog' scripts

This commit is contained in:
samedami 2020-05-16 20:46:04 +02:00
parent fbc555bdc7
commit 7b8b96ac03
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894
2 changed files with 13 additions and 0 deletions

6
.local/bin/scripts/fgdiff Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Fuzzy Git uncommited files changes browser.
git status | awk '/modified/ { print $2 }' | fzf --preview \
'git diff --color=always {}'

7
.local/bin/scripts/fglog Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Fuzzy Git commits browser.
git log --no-decorate --format=short | awk '/^commit|^ /' |
sed 's/ //g; s/commit //g' | paste -d " " - - | fzf --preview \
'git log -n 1 {1}; printf "\n" && git diff --color=always {1}~ {1}'