fuzzy git reset

This commit is contained in:
Noah Masur 2020-11-26 14:28:05 -05:00
parent 7970d36fa9
commit 59160eb247

View File

@ -22,8 +22,8 @@ function gittools
--height 50% \
--preview 'git show --color=always (echo {} | cut -d" " -f4)' \
)
and set commit (echo $commitline | cut -d" " -f1)
and git checkout $commit
and set commit (echo $commitline | cut -d" " -f4)
and echo $commit
end
function git-checkout-fuzzy
@ -87,6 +87,13 @@ function gittools
echo "Not a fuzzy option."
return 1
end
case "reset"
set commit (git-commits)
and if test "$argv[2]" = "--hard"
git reset --hard $commit
else
git reset $commit
end
case "*"
echo "No fuzzy option."
return 1