holygeek / git-number

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

Can not call aliases with -c #4

Closed kotnik closed 8 years ago

kotnik commented 12 years ago

I have complicated line I've put in shell alias, and can not use it with the -c option. Any time to implement this?

holygeek commented 12 years ago

If you give a reproducible example, I'll look into it.

kotnik commented 12 years ago

A simple reproducible example:

$ git n -c ls 1
ls README.txt
README.txt

But when I use an alias:

$ alias sl='ls'
$ git n -c sl 1
sl README.txt
Can't exec "sl": No such file or directory at /home/kotnik/bin/git-number line 111.
holygeek commented 12 years ago

Now I see the problem. I can't think of an elegant way to make it work. The following are workarounds (albeit a bit ugly :):

  1. Assuming that you are using bash:

    $ git n -c bash -c sl 1

  2. Create a shell script that does the same thing as your alias and use that as the argument to git number's -c option.