zimfw/git

the aliases of the module git clobber common commands such as grc

Konfekt opened this issue · 2 comments

How about checks such as

! command -v grc >/dev/null 2>&1 && alias grc='git ...'

to avoid unexpected results for the user; for example, he might have aliased a command to use grc.

Yeah, actually a LOT of commands are clobbered. See b2a2ffb

I was impressed to check how many actually shadow existing commands, using Ubuntu's command-not-found:

'gb'  : apt install gb
'gc'  : apt install graphviz
'gcp' : apt install gcp
'gcs' : apt install opengcs
'gcv' : apt install scotch
'gdc' : apt install gdc
'gfm' : apt install gfm
'gid' : apt install id-utils
'gld' : apt install postfix-gld
'gm'  : apt install graphicsmagick
'gmt' : apt install gmt
'gp'  : apt install pari-gp
'gpa' : apt install gpa
'gpp' : apt install gpp
'gpt' : apt install gpt
'grc' : apt install grc
'gri' : apt install gri
'gs'  : apt install ghostscript
'gsl' : apt install generator-scripting-language
'gss' : apt install libgss-dev
'gt'  : apt install genometools
'gtv' : apt install smpeg-gtv
'gwc' : apt install geneweb
'gwd' : apt install geneweb

Did you check https://github.com/zimfw/git/blob/58810c2/README.md#settings ?

I can think of these solutions, if we really want to have "sane defaults":

  1. Remove the git module from the installation template, so it's not installed by default.
  2. Change the default prefix in the git module to G. Also add a commented # zstyle ':zim:git' aliases-prefix 'g' to the installation template, so users can easily see they can choose a different prefix.

I'd go with option 2.

Thoughts? (👍 to vote in option 1, ❤️ to vote in option 2)

CC @Eriner, @hypnoglow, @@sebastianst, @well1791, @sQVe, @BrainMaestro, @Plloi

Done! 😅