From: Jeff King <peff@peff.net>
To: Henrik Tidefelt <tidefelt@isy.liu.se>
Cc: git@vger.kernel.org
Subject: Re: Problem with "dashless options"
Date: Wed, 9 Sep 2009 10:34:55 -0400 [thread overview]
Message-ID: <20090909143455.GA10092@sigill.intra.peff.net> (raw)
In-Reply-To: <D69FA890-4249-4DC9-B8AE-C9F105F1AD3B@isy.liu.se>
On Wed, Sep 09, 2009 at 03:21:30PM +0200, Henrik Tidefelt wrote:
> Yesterday I installed a fresh git (1.6.4.2) on my system using
> MacPorts. Some of the git sub-commands work fine (for instance,
> checkout, status, remote), while push gives an error as follows:
>
> $ git push isy next
> fatal: BUG: dashless options don't support arguments
Hmm. Very strange. The only code path that triggers this is an option
declared with PARSE_OPT_NODASH but not PARSE_OPT_NOARG. But there are
only two options in all of git that use PARSE_OPT_NODASH, and:
1. They are in git grep, not git push.
2. They correctly have PARSE_OPT_NOARG set.
Which leads me to believe that something is writing random cruft on top
of the options struct. Either a stack overflow, or some issue related to
your compiler (either a bug in the compiler, or something non-portable
we are doing).
Can you try applying the patch below which will at least give us a bit
more information about the offending option?
Also, does 1.6.4.1 work OK? Or any other earlier version? If so, can you
try bisecting?
diff --git a/parse-options.c b/parse-options.c
index f7ce523..e93eb67 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -275,7 +275,15 @@ static int parse_nodash_opt(struct parse_opt_ctx_t *p, const char *arg,
continue;
if ((options->flags & PARSE_OPT_OPTARG) ||
!(options->flags & PARSE_OPT_NOARG))
- die("BUG: dashless options don't support arguments");
+ die("BUG: dashless options don't support arguments\n"
+ "buggy option is:\n"
+ " type: %d\n"
+ " short_name: %c\n"
+ " long_name: %s\n"
+ " flags: %d\n",
+ options->type, options->short_name,
+ options->long_name, options->flags
+ );
if (!(options->flags & PARSE_OPT_NONEG))
die("BUG: dashless options don't support negation");
if (options->long_name)
next prev parent reply other threads:[~2009-09-09 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 13:21 Problem with "dashless options" Henrik Tidefelt
2009-09-09 14:34 ` Jeff King [this message]
2009-09-09 16:26 ` Henrik Tidefelt
2009-09-09 16:30 ` Pierre Habouzit
2009-09-09 21:12 ` Henrik Tidefelt
2009-09-09 22:49 ` Pierre Habouzit
2010-04-27 17:55 ` Problem with "dashless options" Christopher Cameron
2010-04-27 21:28 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090909143455.GA10092@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=tidefelt@isy.liu.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).