Re: [PATCH] Add an optional argument for --color options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 14, 2010 at 09:58:58AM -0500, Mark Lodato wrote:

> > Hmm...the only one I see that silently ignores is "--submodule=bogus".
> > But it seems that "git log -Bfoobar" fails but does not print a useful
> > message.  Probably both should be fixed, and your option should follow
> > the same convention as those.
> 
> Just wondering, why does diff use a separate option parsing mechanism
> than the rest of the code?  Would it be worthwhile to switch to
> parse_opt?  This may make the code cleaner, and it would definitely
> make the command-line interface more consistent with the rest of the
> suite.  From a user's point of view, the biggest win would be "-h"
> printing all of the options, like all the non-diff commands do.

It's historical. The diff option parser predates parse-options by quite
a bit, and was never converted. Pierre made some attempts at converting
it and the revision parser some time back, and we ended up with the more
iterative approach (you can step through each argument with
parse-options, and then alternatively feed it to the revision and diff
options parser).

I don't remember if there were any technical limitations, though (e.g.,
places where the revision parser does not conform to parse-options
standards or needs some special treatment). You'd have to search the
list archives to see what actually happened.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]