add delstash command

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-07-11 08:19:37 -05:00
parent 5cddd9fd55
commit cf41612321

View file

@ -166,6 +166,18 @@ pop() {
git stash pop "$stash_ref" git stash pop "$stash_ref"
} }
delstash() {
local selection
selection=$(git stash list | \
fzf --prompt="Select stash to pop: " \
--preview="git stash show -p \$(echo {} | awk -F: '{print \$1}') | bat --color always --paging=never --style=plain -l diff")
[ -z "$selection" ] && echo "No stash selected." && return 1
local stash_ref
stash_ref=$(echo "$selection" | awk -F: '{print $1}')
echo "About to delete $stash_ref."
git stash drop "$stash_ref";;
}
# nix # nix
alias nixpkgs=nixpkg alias nixpkgs=nixpkg
nixpkg () { nixpkg () {