diff --git a/pkgs/by-name/gi/git-worktree-switcher/disable-update.patch b/pkgs/by-name/gi/git-worktree-switcher/disable-update.patch index 2763ab3a3fe1..d3b0459f8037 100644 --- a/pkgs/by-name/gi/git-worktree-switcher/disable-update.patch +++ b/pkgs/by-name/gi/git-worktree-switcher/disable-update.patch @@ -1,18 +1,18 @@ diff --git a/wt b/wt -index 60999f2..5687822 100755 +index 7166bf2..cdbebab 100755 --- a/wt +++ b/wt -@@ -27,7 +27,6 @@ help_message() { - echo -e "\twt: go to the main worktree" - echo -e "\twt : search for worktree names and change to that directory." +@@ -48,7 +48,6 @@ help_message() { + echo -e "\twt -i: interactively select a worktree using fzf." + echo -e "\twt list: list out all the git worktrees." echo -e "\twt names: list out only the git worktree names." - echo -e "\twt update: update to the latest release of worktree switcher." echo -e "\twt version: show the CLI version." echo -e "\twt init : print the init script for ." echo -e "\twt help: shows this help message." -@@ -163,9 +162,6 @@ case "${args[0]}" in - names) - worktree_list_names +@@ -189,9 +188,6 @@ names) + echo -e '\033[0;31mThe '\''names'\'' option is deprecated and will be removed in future versions.\033[0m' >&2 + echo -e '\033[0;31mUse '\''list'\'' instead.\033[0m' >&2 ;; -update) - update @@ -20,11 +20,11 @@ index 60999f2..5687822 100755 help) help_message ;; -@@ -176,7 +172,6 @@ init) +@@ -202,7 +198,6 @@ init) init ;; *) - auto_check_update - directory=$(git worktree list --porcelain 2> /dev/null | sed -n '/'"${arg:-.}"'/{s/^worktree\s*//p;q}') - ;; - esac + if [[ "$is_interactive" == true ]]; then + directory=$(git worktree list --porcelain | + awk '/worktree/ {wt=$2} /branch/ {sub("refs/heads/", "", $2); print wt " [" $2 "]"}' | diff --git a/pkgs/by-name/gi/git-worktree-switcher/package.nix b/pkgs/by-name/gi/git-worktree-switcher/package.nix index eed927c03043..6bd44b5b0b81 100644 --- a/pkgs/by-name/gi/git-worktree-switcher/package.nix +++ b/pkgs/by-name/gi/git-worktree-switcher/package.nix @@ -6,22 +6,24 @@ installShellFiles, git, jq, + fzf, }: stdenv.mkDerivation (finalAttrs: { pname = "git-worktree-switcher"; - version = "0.2.6"; + version = "0.2.8"; src = fetchFromGitHub { owner = "mateusauler"; repo = "git-worktree-switcher"; tag = "${finalAttrs.version}-fork"; - hash = "sha256-vPnAXiizCU5nXce+aE2x2G5ei+7A+eBTUpxcGleSSa8="; + hash = "sha256-OXUVIL4bIqqxnLLwdO0+8gxCDMqA4TPvjIc2i8BeBmw="; }; buildInputs = [ - jq + fzf git + jq ]; nativeBuildInputs = [ @@ -39,6 +41,7 @@ stdenv.mkDerivation (finalAttrs: { cp wt $out/bin wrapProgram $out/bin/wt --prefix PATH : ${ lib.makeBinPath [ + fzf git jq ]