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

Re: [PATCH 1/7] parse-options: Make callbacks take flags instead of boolean `unset`

From
Pierre Habouzit <madcoder@debian.org>
Date
Dec 17, 2007, 18:54 UTC
Message-ID
<20071217185416.GD22554@artemis.madism.org>
In-Reply-To
<1197915797-30679-2-git-send-email-madcoder@debian.org>
And of course here is the MadBug #1, to be squashed:
---
 builtin-rev-parse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 20d1789..3e8ee62 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -210,10 +210,10 @@ static int try_difference(const char *arg)
 	return 0;
 }
 
-static int parseopt_dump(const struct option *o, const char *arg, int unset)
+static int parseopt_dump(const struct option *o, const char *arg, int flags)
 {
 	struct strbuf *parsed = o->value;
-	if (unset)
+	if (flags & PARSE_OPT_UNSET)
 		strbuf_addf(parsed, " --no-%s", o->long_name);
 	else if (o->short_name)
 		strbuf_addf(parsed, " -%c", o->short_name);
-- 
1.5.4.rc0.1151.g102b0
Previous: Wayne Davison
Message 13 of 13 in “[proposal] make parse-options nicer wrt optional arguments (supersedes all my recent posts on the matter)”
  1. Pierre HabouzitDec 17, 2007
  2. 1/7 parse-options: Make callbacks take flags instead of boolean `unset`Pierre Habouzit, Dec 17, 2007
  3. 2/7 parse-options: allow callbacks to ignore arguments they don't need to use.Pierre Habouzit, Dec 17, 2007
  4. 3/7 parse-options: Let the integer/string cases be callbacks as well.Pierre Habouzit, Dec 17, 2007
  5. 4/7 parse-options: let OPT__ABBREV ignore arguments.Pierre Habouzit, Dec 17, 2007
  6. 5/7 parse-options: Add a gitcli(5) man page.Pierre Habouzit, Dec 17, 2007
  7. 6/7 parse-options: have a `use default value` wildcard.Pierre Habouzit, Dec 17, 2007
  8. 7/7 git-tag: fix -l switch handling regression.Pierre Habouzit, Dec 17, 2007
  9. Pierre HabouzitDec 17, 2007
  10. Pierre HabouzitDec 17, 2007
  11. Junio C HamanoDec 17, 2007
  12. Wayne DavisonDec 18, 2007
  13. Pierre HabouzitDec 17, 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.