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

Re: [PATCH] Use parseopts in builtin-fetch

From
Pierre Habouzit <madcoder@debian.org>
Date
Nov 5, 2007, 19:48 UTC
Message-ID
<20071105194816.GA8939@artemis.corp>
In-Reply-To
<7vir4gqzdu.fsf@gitster.siamese.dyndns.org>
On Mon, Nov 05, 2007 at 07:13:33PM +0000, Junio C Hamano wrote:
Show 19 quoted lines
> Pierre Habouzit <madcoder@debian.org> writes:
> 
> > On Mon, Nov 05, 2007 at 03:35:34AM +0000, Daniel Barkalow wrote:
> >> I mostly did this and the next one for practice with the API. I'm 
> >> impressed that "git fetch -vv" is even handled correctly without anything 
> >> special.
> >
> >   About that: OPTION_BOOLEAN increments the associated variable, to
> > support this case specifically.
> >
> >   The last thing that really miss in parse-options is a way to recurse
> > into a sub-array of struct option, to be able to port the generic diff
> > and revision arguments.
> 
> Another micronit is I found lacking is that it is a bit too
> cumbersome to accept only a subset of integer as a value
> (e.g. "this option takes a positive integer, not zero nor
> negative").  The caller can set up a callback to handle that,
> though.

As a general rule we may want to have some kind of "ranged" integers. but like you said the callback is always here for that, and if we begin to have dozens of those we may consider creating a new type for those if needed.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Junio C Hamano
Message 8 of 8 in “Use parseopts in builtin-fetch”
  1. Use parseopts in builtin-fetchDaniel Barkalow, Nov 5, 2007
  2. Pierre HabouzitNov 5, 2007
  3. Daniel BarkalowNov 5, 2007
  4. Pierre HabouzitNov 5, 2007
  5. Kristian HøgsbergNov 5, 2007
  6. Daniel BarkalowNov 5, 2007
  7. Junio C HamanoNov 5, 2007
  8. Pierre HabouzitNov 5, 2007

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.