git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] parse_options: Add flag to prevent errors for further processing

From
Jeff King <peff@peff.net>
Date
Jun 18, 2008, 03:30 UTC
Message-ID
<20080618033010.GA19657@sigill.intra.peff.net>
In-Reply-To
<7v1w2v2zsh.fsf@gitster.siamese.dyndns.org>
On Tue, Jun 17, 2008 at 08:21:50PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Shawn Bohrer <shawn.bohrer@gmail.com> writes:
> 
> > This adds the PARSE_OPT_NO_ERROR_ON_UNKNOWN flag which prevents
> > parse_options() from erroring out when it finds an unknown option,
> > and leaves the original command and unknown options in argv.
> 
> I have to say that this conceptually is broken.  How would you tell
> without knowing what "--flag" is if the thing in argv[] after that is a
> parameter to that option or the end of the options?

Agreed. I was just about to write the same thing. As it happens, I think in the case of git-shortlog that there is not likely to be such a parameter. The only three I see looking over setup_revisions are "-n" (which is masked by shortlog anyway), "--default", and "-U" (which one would never need with shortlog).

However I am still opposed to the concept, since its presence as a parseopt flag implies that it isn't fundamentally broken.

I think the only right way to accomplish this is to convert the revision and diff parameters into a parseopt-understandable format.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 5 of 17 in “[RFC] convert shortlog to use parse_options”
  1. Shawn BohrerJun 18, 2008
  2. 1/2 parse_options: Add flag to prevent errors for further processingShawn Bohrer, Jun 18, 2008
  3. 2/2 git shortlog: Modify to use parse_optionsShawn Bohrer, Jun 18, 2008
  4. Junio C HamanoJun 18, 2008
  5. Jeff KingJun 18, 2008
  6. Jeff KingJun 18, 2008
  7. Junio C HamanoJun 18, 2008
  8. Johannes SchindelinJun 18, 2008
  9. Junio C HamanoJun 18, 2008
  10. Shawn BohrerJun 19, 2008
  11. Johannes SchindelinJun 22, 2008
  12. Junio C HamanoJun 23, 2008
  13. Jeff KingJun 23, 2008
  14. Junio C HamanoJun 23, 2008
  15. Johannes SchindelinJun 23, 2008
  16. Pierre HabouzitJun 22, 2008
  17. Junio C HamanoJun 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.