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

Re: [PATCH 1/2] clone: do not ignore --no-hardlinks

From
Jeff King <peff@peff.net>
Date
Feb 27, 2009, 11:35 UTC
Message-ID
<20090227113558.GA19756@coredump.intra.peff.net>
In-Reply-To
<7vr61kmht9.fsf@gitster.siamese.dyndns.org>
On Thu, Feb 26, 2009 at 11:59:14PM -0800, Junio C Hamano wrote:
Show 5 quoted lines
> Except that it does not work.
> 
> Initializing option_local to -1 and then feeding it to parse_options() via
> OPT_BOOLEAN() is a cute idea, but when parse_options() sees a command line
> like this:

Ah, sorry. I didn't really test it thoroughly (though I did try --no-local, I obviously did not test --local with a hardlink failure).

> Damn it, it is called BOOLEAN, and naïvely I would think --option would
> set it to 1, --no-option would set it to 0, and not having --option nor
> --no-option would leave the associated variable alone, but apparently that
> is not what is happening.

That is exactly what I expected as a caller (and it sounds like you did, too), which perhaps argues in favor of changing it.

Upon seeing this, I guessed (as you did in the next email) that it was about bumping up levels of a boolean for things like verbosity. And I agree that sould not be OPT_BOOLEAN, but rather OPT_INCREMENT or whatever.

However, I did some grepping and it doesn't look like anybody is actually making use of the incrementing behavior (I was just looking for "verbose", though, so it's possible some unrelated boolean is using it). So it may be that the behavior can be changed now while no callers care, and we can get away without OPT_INCREMENT until somebody actually needs it.

-Peff
Previous: Daniel BarkalowNext: Johannes Schindelin
Message 12 of 13 in “clone: ignore --depth when cloning locally (implicitly --local)”
  1. clone: ignore --depth when cloning locally (implicitly --local)Johannes Schindelin, Feb 26, 2009
  2. Junio C HamanoFeb 26, 2009
  3. Johannes SchindelinFeb 26, 2009
  4. 0/2 shallow clone stuffJohannes Schindelin, Feb 26, 2009
  5. Junio C HamanoFeb 27, 2009
  6. 1/2 clone: do not ignore --no-hardlinksJohannes Schindelin, Feb 26, 2009
  7. Jeff KingFeb 27, 2009
  8. Junio C HamanoFeb 27, 2009
  9. Junio C HamanoFeb 27, 2009
  10. Junio C HamanoFeb 27, 2009
  11. Daniel BarkalowFeb 27, 2009
  12. Jeff KingFeb 27, 2009
  13. 2/2 clone: ignore --depth when cloning locally (implicitly --local)Johannes Schindelin, Feb 26, 2009

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.