jhillyerd / plugin-git

Git aliases plugin for the Fish shell (similar to oh-my-zsh git)
MIT License
607 stars 85 forks source link

ggp seems to be broken with Fish 3.3.1 #60

Closed Cellane closed 3 years ago

Cellane commented 3 years ago

After updating to Fish 3.3.1 earlier today, I noticed that the gpu alias (which expands to ggp --set-upstream) now throws an error:

~/.local/share/omf/pkg/git/functions/__git.current_branch.fish (line 5): Backgrounded commands can not be used as conditionals
  end ^/dev/null | sed -e 's|^refs/heads/||'
      ^
from sourcing file ~/.local/share/omf/pkg/git/functions/__git.current_branch.fish
        called on line 1 of file ~/.local/share/omf/pkg/git/functions/ggp.fish
in command substitution
        called on line 1 of file ~/.local/share/omf/pkg/git/functions/ggp.fish
in command substitution
        called on line 2 of file ~/.local/share/omf/pkg/git/functions/ggp.fish
in function 'ggp' with arguments '--set-upstream'
source: Error while reading file '/Users/Milan/.local/share/omf/pkg/git/functions/__git.current_branch.fish'
fish: Unknown command: __git.current_branch
in command substitution
        called on line 2 of file ~/.local/share/omf/pkg/git/functions/ggp.fish
in function 'ggp' with arguments '--set-upstream'
~/.local/share/omf/pkg/git/functions/ggp.fish (line 2): Unknown command
  git push origin (__git.current_branch) $argv
                  ^
in function 'ggp' with arguments '--set-upstream'
jhillyerd commented 3 years ago

Ah, I think this is because fish has removed the use of ^ for STDERR output redirection: https://fishshell.com/docs/current/language.html#id4

If you have the time, can you try replacing that ^/dev/null with 2>/dev/null (the s|^refs... part is correct)

Cellane commented 3 years ago

@jhillyerd That seems to be the fix, thank you! I wanted to open a PR but while doing so, I noticed that this was already fixed on master late last year (I think?), so I guess I should’ve tried updating the plugin first 😅 Sorry and thank you!