Re: Convert 'git blame' to parse_options()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 23, 2008, 12:28 UTC
- Message-ID
- <alpine.DEB.1.00.0806231326580.6440@racer>
- In-Reply-To
- <7vr6aoirqh.fsf@gitster.siamese.dyndns.org>
Hi,
On Sun, 22 Jun 2008, Junio C Hamano wrote:
Show 16 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
> > +static int blame_bottomtop_callback(const struct option *option, const char *arg, int unset)
> > +{
> > + const char **bottomtop = option->value;
> > + if (!arg)
> > + return -1;
> > + if (*bottomtop)
> > + die("More than one '-L n,m' option given");
> > + *bottomtop = arg;
> > + return 0;
> > +}
>
> Hmmmm. I actually wanted to eventually allow more than one -L so that we
> can blame two functions inside a file, for example. Would this make it
> even harder, I have to wonder...IMHO this would not change anything in the way of making it harder; it is just a matter of adding the pairs to a container. The more tricky thing is how to handle a bunch of intervals efficiently, without introducing too much ugliness.
Ciao, Dscho