holygeek / git-number

Use numbers for dealing with files in git
ISC License
281 stars 25 forks source link

Git number do not work if some arguments are passed to git #39

Closed KES777 closed 6 years ago

KES777 commented 6 years ago
alias gn="git-number"
alias gd="gn -c git diff -b -w --ignore-blank-lines --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'"
$ gd .
sh: 1: Syntax error: word unexpected
KES777 commented 6 years ago

How to write right:

alias gd="gn -c \"git diff -b -w --ignore-blank-lines --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'\""
holygeek commented 6 years ago

You don't really have to use the -c option, since by default git number runs git, so your alias can be simplified like so:

alias gd="gn diff -b -w --ignore-blank-lines --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'"