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