gazorby / fish-abbreviation-tips

💡 Help you remembering your abbreviations
MIT License
291 stars 7 forks source link

Weird buggy behavior #21

Closed simonmandlik closed 2 years ago

simonmandlik commented 2 years ago

Upon a fresh install with fisher, I get a strange behaviour:

~
❯ fisher install gazorby/fish-abbreviation-tips
fisher install version 4.3.0
Fetching https://codeload.github.com/gazorby/fish-abbreviation-tips/tar.gz/HEAD
Installing gazorby/fish-abbreviation-tips
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_bind_newline.fish
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_bind_space.fish
           /Users/simon.mandlik/.config/fish/functions/__abbr_tips_init.fish
           /Users/simon.mandlik/.config/fish/conf.d/abbr_tips.fish
Installed 1 plugin/s

~
❯

~
❯ git status
fatal: not a git repository (or any of the parent directories): .git

─────
Hint: ga => git

~
❯ git commit
fatal: not a git repository (or any of the parent directories): .git

─────
Hint: ga => git

~
❯ echo $__ABBR_TIPS_KEYS
g ga gaa gap gapa gau gb gbD gba gban gbd gbl gbs gbsb gbsg gbsr gbss gc gc! gca gca! gcam gcan! gcav gcav! gcb gcf gcfx gcl gclean gclean! gclean!! gcm gcn! gco gcod gcom gcount gcp gcpa gcpc gcv gd gdca gds gdsc gdto gdw gdwc gf gfa gfb gfbs gfbt gff gffs gfft gfh gfhs gfht gfm gfo gfp gfr gfrs gfrt gfs gfss gfst ggp! gignore gl glg glgg glgga gll glo glod glog glom gloo glr gm gmom gmt gp gp! gpo gpo! gpu gpv gpv! gr gra grb grba grbc grbd grbdi grbdia grbi grbm grbmi grbmia grbs grev grh grhh grhpa grm grmc grmv grrm grs grset grss grst grup grv gscam gsd gsh gsr gss gst gsta gstd gstl gstp gsts gsu gsur gsuri gsw gswc gts gtv gunignore gup gupa gupav gupv gwch a__cat a__fish_key_reader a__juliap a__rm a__vim

~
❯ echo $__ABBR_TIPS_VALUES
' git ' 'git add' ' 'git add --all' ' 'git apply' ' 'git add --patch' ' 'git add --update' ' 'git branch -vv' ' 'git branch -D' ' 'git branch -a -v' ' 'git branch -a -v --no-merged' ' 'git branch -d' ' 'git blame -b -w' ' 'git bisect' ' 'git bisect bad' ' 'git bisect good' ' 'git bisect reset' ' 'git bisect start' ' 'git commit -v' ' 'git commit -v --amend' ' 'git commit -v -a' ' 'git commit -v -a --amend' ' 'git commit -a -m' ' 'git commit -v -a --no-edit --amend' ' 'git commit -a -v --no-verify' ' 'git commit -a -v --no-verify --amend' ' 'git checkout -b' ' 'git config --list' ' 'git commit --fixup' ' 'git clone' ' 'git clean -di' ' 'git clean -dfx' ' 'git reset --hard; and git clean -dfx' ' 'git commit -m' ' 'git commit -v --no-edit --amend' ' 'git checkout' ' 'git checkout develop' ' 'git checkout (__git.default_branch)' ' 'git shortlog -sn' ' 'git cherry-pick' ' 'git cherry-pick --abort' ' 'git cherry-pick --continue' ' 'git commit -v --no-verify' ' 'git diff' ' 'git diff --cached' ' 'git diff --stat' ' 'git diff --stat --cached' ' 'git difftool' ' 'git diff --word-diff' ' 'git diff --word-diff --cached' ' 'git fetch' ' 'git fetch --all --prune' ' 'git flow bugfix' ' 'git flow bugfix start' ' 'git flow bugfix track' ' 'git flow feature' ' 'git flow feature start' ' 'git flow feature track' ' 'git flow hotfix' ' 'git flow hotfix start' ' 'git flow hotfix track' ' 'git fetch origin (__git.default_branch) --prune; and git merge FETCH_HEAD' ' 'git fetch origin' ' 'git flow publish' ' 'git flow release' ' 'git flow release start' ' 'git flow release track' ' 'git flow support' ' 'git flow support start' ' 'git flow support track' ' 'ggp --force-with-lease' ' 'git update-index --assume-unchanged' ' 'git pull' ' 'git log --stat' ' 'git log --graph' ' 'git log --graph --decorate --all' ' 'git pull origin' ' 'git log --oneline --decorate --color' ' 'git log --oneline --decorate --color develop..' ' 'git log --oneline --decorate --color --graph' ' 'git log --oneline --decorate --color (__git.default_branch)..' ' git\ log\ --pretty=format:\'\%C\(yellow\)\%h\ \%Cred\%ad\ \%Cblue\%an\%Cgreen\%d\ \%Creset\%s\'\ --date=short ' 'git pull --rebase' ' 'git merge' ' 'git merge origin/(__git.default_branch)' ' 'git mergetool --no-prompt' ' 'git push' ' 'git push --force-with-lease' ' 'git push origin' ' 'git push --force-with-lease origin' ' 'ggp --set-upstream' ' 'git push --no-verify' ' 'git push --no-verify --force-with-lease' ' 'git remote -vv' ' 'git remote add' ' 'git rebase' ' 'git rebase --abort' ' 'git rebase --continue' ' 'git rebase develop' ' 'git rebase develop --interactive' ' 'git rebase develop --interactive --autosquash' ' 'git rebase --interactive' ' 'git rebase (__git.default_branch)' ' 'git rebase (__git.default_branch) --interactive' ' 'git rebase (__git.default_branch) --interactive --autosquash' ' 'git rebase --skip' ' 'git revert' ' 'git reset' ' 'git reset --hard' ' 'git reset --patch' ' 'git rm' ' 'git rm --cached' ' 'git remote rename' ' 'git remote remove' ' 'git restore' ' 'git remote set-url' ' 'git restore --source' ' 'git restore --staged' ' 'git remote update' ' 'git remote -v' ' 'git commit -S -a -m' ' 'git svn dcommit' ' 'git show' ' 'git svn rebase' ' 'git status -s' ' 'git status' ' 'git stash' ' 'git stash drop' ' 'git stash list' ' 'git stash pop' ' 'git stash show --text' ' 'git submodule update' ' 'git submodule update --recursive' ' 'git submodule update --recursive --init' ' 'git switch' ' 'git switch --create' ' 'git tag -s' ' 'git tag' ' 'git update-index --no-assume-unchanged' ' 'git pull --rebase' ' 'git pull --rebase --autostash' ' 'git pull --rebase --autostash -v' ' 'git pull --rebase -v' ' 'git whatchanged -p --abbrev-commit --pretty=medium' ' bat ' /usr/local/Cellar/fish/3.3.1/bin/fish_key_reader ' 'julia --project=@.' ' trash ' nvim

The only relevant thing I have in my config.fish is `set -x ABBR_TIPS_PROMPT "...".

mainrs commented 2 years ago

Same behavior on my machine. It have a lot of git abbreviations and it always shows me the same one.

  34   │ abbr --add --global -- ga 'git add'
  35   │ abbr --add --global -- gaa 'git add --all .'
  36   │ abbr --add --global -- gb 'git branch'
  37   │ abbr --add --global -- gbd 'git branch -D'
  38   │ abbr --add --global -- gcl 'gh repo clone'
  39   │ abbr --add --global -- gcm 'git checkout main'
  40   │ abbr --add --global -- gco 'git checkout'
  41   │ abbr --add --global -- gcob 'git checkout -b'
  42   │ abbr --add --global -- gd 'git diff'
  43   │ abbr --add --global -- gds 'git diff --cached'
  44   │ abbr --add --global -- gm 'git commit -m'
  45   │ abbr --add --global -- gma 'git commit --amend'
  46   │ abbr --add --global -- gman 'git commit --amend --no-edit'
  47   │ abbr --add --global -- gp 'git push'
  48   │ abbr --add --global -- gpoh 'git push origin HEAD'
  49   │ abbr --add --global -- gpohu 'git push origin HEAD -u'
  50   │ abbr --add --global -- gpom 'git pull origin main'
  51   │ abbr --add --global -- gpt 'git push --tags'
  52   │ abbr --add --global -- gpuh 'git push upstream HEAD'
  53   │ abbr --add --global -- gs 'git status'
  54   │ abbr --add --global -- gw 'gh repo view -w'
$ git status
<output>
gbd => git

$ git checkout main
<output>
gdb => git
fish version: 3.3.1
fish-abbreviation-tips: 75f7f66ca092d53197c1a97c7d8e93b1402fdc15
system: Linux 5.10.88 NixOS x86_64 GNU/Linux
mainrs commented 1 year ago

@gazorby Could you cut a new release for this fix, please?

gazorby commented 1 year ago

@gazorby Could you cut a new release for this fix, please?

This should have been fixed already, did you update the plugin?

mainrs commented 1 year ago

Yes. I was asking if you could create a new tag for that fix :) I am a package maintainer, and having to deal with tags instead of commits is easier :)

gazorby commented 1 year ago

It's just that I'm not used to pin my fish plugins ;)

Btw I just pushed v0.6.0 so we are up-to-date now