Re: Problem with "dashless options"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, that was a strange error. I applied the patch, but could not reproduce the error any more. Also, Gustaf Hendeby built git directly from the git distribution (not via MacPorts) on my machine, and could not reproduce the error. Then I simply tried to clean and build the git from MacPorts again, and voila!, now it works. Something very strange must have happened during the previous build.

I am sorry for taking your time.


Henrik

On 9Sep , 2009, at 16:34 , Jeff King wrote:

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)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]