git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Donald R Laster Jr <laster@dlaster.com>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2 4/4] diff: use skip_to_optional_val_default()
Date: Mon, 04 Dec 2017 06:28:42 -0800	[thread overview]
Message-ID: <xmqqd13uo9d1.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171204125617.4931-4-chriscool@tuxfamily.org> (Christian Couder's message of "Mon, 4 Dec 2017 13:56:17 +0100")

Christian Couder <christian.couder@gmail.com> writes:

> -	} else if (!strcmp(arg, "--submodule"))
> -		options->submodule_format = DIFF_SUBMODULE_LOG;
> -	else if (skip_prefix(arg, "--submodule=", &arg))
> +	} else if (skip_to_optional_val_default(arg, "--submodule", &arg, "log"))
>  		return parse_submodule_opt(options, arg);

It may be annoying if we later diagnose that DIFF_SUBMODULE_LOG may
not be used in the context (e.g. together with some other optoins
that are set in "options" variable) and have to throw an error
message at the user.  parse_submodule_opt() would not know if that
string "log" came from the user or substituted by the helper, and in
the latter case, "don't use --submodule=log here" is a message that
is not quite appropriate.

This may be minor enough not matter in practice, but I dunno.  I
didn't look at other hunks in this step very carefully but I would
expect that whenever you use "default" to substitute, you'll have
the same information lossage.


  reply	other threads:[~2017-12-04 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 12:56 [PATCH v2 1/4] git-compat-util: introduce skip_to_optional_val() Christian Couder
2017-12-04 12:56 ` [PATCH v2 2/4] index-pack: use skip_to_optional_val() Christian Couder
2017-12-04 12:56 ` [PATCH v2 3/4] diff: " Christian Couder
2017-12-04 14:23   ` Junio C Hamano
2017-12-04 12:56 ` [PATCH v2 4/4] diff: use skip_to_optional_val_default() Christian Couder
2017-12-04 14:28   ` Junio C Hamano [this message]
2017-12-04 14:31 ` [PATCH v2 1/4] git-compat-util: introduce skip_to_optional_val() Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqd13uo9d1.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=laster@dlaster.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).