On Fri, Dec 21, 2007 at 12:32:28AM +0000, Junio C Hamano wrote: > I've tagged -rc1 last night. The changes are mostly fixes. There are > some remaining issues I'd like to see fixed/decided before 1.5.4. > > One important issue is to identify and fix regressions since 1.5.3 > series. No "rewrite scripted git-foo completely in C" can be regression > free, and we had quite a few internal changes during 1.5.4 cycle (not > just rewrite to C, but C level uses new and improved API such as strbuf > and parse-options). Currently I am aware of these regressions: > > * handling of options, "--abbrev 10 HEAD", "--abbrev=10 HEAD" and > "--abbrev HEAD". The last one does not work for commands that use > parse-options. Pierre is on top of this, I hope. Hmm now I'm confused, I believed we settled for the: --abbrev 10 HEAD is forbidden, --abbrev=10 HEAD works, and --abbrev HEAD too. This would introduce no regressions _yet_ as none of the commands that use parse-options and take --abbrev accepted the --abbrev 10 form before. I already sent this once, and assumed you took it, hence me being silent the last days. Here is it again then. Of course this does not affects other long options for which `--long-option arg` still works (if they do take an argument). I'd also like to see any kind of form of gitcli(5) be merged for 1.5.4 too, I believe the first version I ever sent. In the thread where I posted the proposal using `{}` the patch introducing it is the version formed using: * my first proposal for it ; * your english fixes squashed on top of it ; * a fix wrt the '--no-' prefix and Boolean options that we discussed. This version describes the current state of things properly IMHO. I can find the message id if you need, but I don't have the commit locally anymore atm. Cheers, From 37c7baaa82f36d16697fa190635f5d3efbe2a83d Mon Sep 17 00:00:00 2001 From: Pierre Habouzit <madcoder@xxxxxxxxxx> Date: Fri, 21 Dec 2007 11:41:41 +0100 Subject: [PATCH] Force the sticked form for options with optional arguments. Signed-off-by: Pierre Habouzit <madcoder@xxxxxxxxxx> --- parse-options.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parse-options.c b/parse-options.c index 574ed31..4f5c55e 100644 --- a/parse-options.c +++ b/parse-options.c @@ -89,7 +89,7 @@ static int get_value(struct optparse_t *p, *(const char **)opt->value = NULL; return 0; } - if (opt->flags & PARSE_OPT_OPTARG && (!arg || *arg == '-')) { + if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { *(const char **)opt->value = (const char *)opt->defval; return 0; } @@ -103,7 +103,7 @@ static int get_value(struct optparse_t *p, return (*opt->callback)(opt, NULL, 1); if (opt->flags & PARSE_OPT_NOARG) return (*opt->callback)(opt, NULL, 0); - if (opt->flags & PARSE_OPT_OPTARG && (!arg || *arg == '-')) + if (opt->flags & PARSE_OPT_OPTARG && !p->opt) return (*opt->callback)(opt, NULL, 0); if (!arg) return opterror(opt, "requires a value", flags); @@ -114,7 +114,7 @@ static int get_value(struct optparse_t *p, *(int *)opt->value = 0; return 0; } - if (opt->flags & PARSE_OPT_OPTARG && (!arg || !isdigit(*arg))) { + if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { *(int *)opt->value = opt->defval; return 0; } -- 1.5.4.rc1.1096.g37c7b
Attachment:
pgpCvCS4a0BAm.pgp
Description: PGP signature