From cf41612321fdd17ffa1bbd63c393b16302ce9745 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Fri, 11 Jul 2025 08:19:37 -0500 Subject: [PATCH] add delstash command --- common/general/shell/common.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/general/shell/common.sh b/common/general/shell/common.sh index 81a3328..8ede42d 100644 --- a/common/general/shell/common.sh +++ b/common/general/shell/common.sh @@ -166,6 +166,18 @@ pop() { 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 alias nixpkgs=nixpkg nixpkg () {