k4rthik / git-cal

github like contributions calendar on terminal
MIT License
1.12k stars 61 forks source link

Author argument doesn't appear to work. #12

Closed donatj closed 11 years ago

donatj commented 11 years ago
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse\ Donat                                                                                                  1↵ 17:24:32
fatal: ambiguous argument 'Donat': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author="Jesse Donat"                                                                                                 2↵ 17:24:47
fatal: ambiguous argument 'Donat': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author="Jesse Donat" -- .                                                                                            2↵ 17:24:56
fatal: bad revision 'Donat'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse Donat -- .                                                                                              2↵ 17:25:14
fatal: Donat do not exists
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ » git-cal --author=Jesse\ Donat -- .                                                                                             2↵ 17:25:24
fatal: bad revision 'Donat'
fatal: git-cal failed to get the git log
jessed > JesseDonat-MBP ~CIL ±2.0.2⚡ »                                                                                                                                
davidzchen commented 11 years ago

I ran into this problem at first too. The following will work though:

$ git cal --author="Jesse\ Donat"

It would be nice to have the argument to author be parsed correctly when it is a string with unescaped spaces enclosed by quotes.

donatj commented 11 years ago

Oh weird. I've never seen spaces need to be quoted in strings in arguments like that

davidzchen commented 11 years ago

Yeah, intuitively, we shouldn't need to escape spaces in a string that is enclosed in quotes, but I have a feeling that this might be a limitation of Getopt.

It would be nice to have strings with spaces handled properly when enclosed in quotes though..

k4rthik commented 11 years ago

Yes, it is an issue with Getopt::Long. May be it is better to get rid of it, i'll patch this soon.

igamid commented 11 years ago

Actually, the Getopt::Long works fine. The is issue with how extra args are passed to the git and I've fixed this (see pull request #22). Thank you.

k4rthik commented 11 years ago

Cool, Merged it. Thank you.