Re: [RFC] Re: Convert 'git blame' to parse_options()
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jun 23, 2008, 18:20 UTC
- Message-ID
- <alpine.LFD.1.10.0806231114180.2926@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.1.10.0806231027210.2926@woody.linux-foundation.org>
On Mon, 23 Jun 2008, Linus Torvalds wrote:
Show 5 quoted lines
> > Umm. Helloo, reality.. There are actually very few options that take a > flag for their arguments. In particular, the option parsing we really > _care_ about (revision parsing - see builtin-blame.c which is exactly > where I wanted to convert things) very much DOES NOT.
Actually, I guess "--default" does, but if you try to mix that up with (a) a default head that starts with a dash and (b) git-blame, you're doing something pretty odd.
And yes, "-n" does too, but if you pass it negative numbers you get what you deserve.
The point being, we really _do_ have a real-life existing case for PARSE_OPT_CONTINUE_ON_UNKNOWN, which is hard to handle any other way. Currently you can literally do
git blame --since=April -b Makefile
and while it's a totally made-up example, it's one I've picked to show exactly what does *not* work with my patch that started this whole thread.
And guess what you need to fix it?
If you guessed PARSE_OPT_CONTINUE_ON_UNKNOWN, you win a prize.
Linus