djui / alias-tips

An oh-my-zsh plugin to help remembering those aliases you defined once
786 stars 50 forks source link

Reveal git aliases #45

Open fiunchinho opened 6 years ago

fiunchinho commented 6 years ago

Hey! This plugin is almost exactly what I was looking for! Kudos 👍 But I'm missing something, which is the "reveal used alias" feature for git aliases.

After adding export ZSH_PLUGINS_ALIAS_TIPS_REVEAL=1, it works fine for regular aliases

$ ll
Alias for: ls -G -lh
total 64
drwxr-xr-x   16 jose.armesto  staff   512B 30 mar 21:49 .
drwxr-xr-x+ 125 jose.armesto  staff   3,9K 31 mar 12:37 ..
drwxr-xr-x   16 jose.armesto  staff   512B 31 mar 12:37 .git
-rw-r--r--    1 jose.armesto  staff   105B 23 may  2016 .gitignore
-rw-r--r--    1 jose.armesto  staff   4,8K 30 mar 21:39 CONTRIBUTING.md
-rw-r--r--    1 jose.armesto  staff   1,2K 30 mar 21:39 LICENSE.txt
-rw-r--r--    1 jose.armesto  staff   9,1K 30 mar 21:39 README.md

But it doesn't for git aliases

$ git dm
Alias tip: g dm
$ g dm
Alias for: git dm

I'd like to see this output

$ git dm
Alias for: !git branch --merged | grep -v '\*' | xargs -n 1 git branch -d

Since these are my git aliases

$ git alias
Alias tip: g alias
alias=!git config -l | grep ^alias | cut -c 7- | sort
amend=commit --amend --no-edit
dm=!git branch --merged | grep -v '\*' | xargs -n 1 git branch -d

Any ideas?

pradyunsg commented 6 years ago

Any ideas?

This seems like a nice idea. I don't have the time to implement this right now, so, if anyone else wants to pick this up and implement this, I'll be happy to review (and merge too if @djui won't mind). :)