mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <>
To: Jeff King <>
Cc: Jacob Keller <>,
	Git mailing list <>
Subject: Re: git commit file completion recently broke
Date: Thu, 7 Dec 2017 09:14:31 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Dec 7, 2017 at 1:56 AM, Jeff King <> wrote:

> I think we'd do better to just assign NULL when there's "=", so we can
> tell the difference between "--relative", "--relative=", and
> "--relative=foo" (all of which are distinct).
> I think that's possible with the current scheme by doing:
>   else if (skip_to_optional_val_default(arg, "--relative", &arg, NULL)) {
>         options->flags.relative_name = 1;
>         if (arg)
>                 options->prefix = arg;
>   }

Yeah, that is a possible fix.

> IOW, the problem isn't in the design of the skip function, but just how
> it was used in this particular case.

I agree.

> I do think it may make sense for
> the "short" one to use NULL, like:
>   skip_to_optional_val(arg, "--relative, &arg)
> but maybe some other callers would be more inconvenienced (they may have
> to current NULL back into the empty string if they want to string
> "--foo" the same as "--foo=").

I discussed that with Junio and yeah there are many callers that want
"--foo" to be the same as "--foo=".

By the way I wonder if "--relative=" makes any sense, and if we should
emit a warning or just die in this case.

  parent reply	other threads:[~2017-12-07  8:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 23:53 git commit file completion recently broke Jacob Keller
2017-12-07  0:01 ` Jacob Keller
2017-12-07  0:08   ` Jacob Keller
2017-12-07  0:22   ` Jeff King
2017-12-07  0:24     ` Jeff King
2017-12-07  0:38       ` Jacob Keller
2017-12-07  0:56         ` Jeff King
2017-12-07  1:04           ` Jacob Keller
2017-12-07  1:08             ` Jeff King
2017-12-07  8:14           ` Christian Couder [this message]
2017-12-07  8:19             ` Jeff King
2017-12-07 15:24             ` Junio C Hamano
2017-12-07 18:57               ` Jacob Keller

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:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 read-only IMAP folder(s) and NNTP newsgroup(s).