Re: [PATCH v2 3/8] status: support --porcelain[=<version>]
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Jul 25, 2016, 19:51 UTC
- Message-ID
- <57966DDF.5020301@gmail.com>
- In-Reply-To
- <1469474750-49075-4-git-send-email-jeffhost@microsoft.com>
W dniu 2016-07-25 o 21:25, Jeff Hostetler pisze:
Show 20 quoted lines
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -144,6 +144,21 @@ static struct strbuf message = STRBUF_INIT;
>
> static enum wt_status_format status_format = STATUS_FORMAT_UNSPECIFIED;
>
> +static int opt_parse_porcelain(const struct option *opt, const char *arg, int unset)
> +{
> + enum wt_status_format *value = (enum wt_status_format *)opt->value;
> + if (unset)
> + *value = STATUS_FORMAT_NONE;
> + else if (!arg)
> + *value = STATUS_FORMAT_PORCELAIN;
> + else if (!strcmp(arg, "v1"))
> + *value = STATUS_FORMAT_PORCELAIN;
> + else
> + die("unsupported porcelain version");
> +
> + return 0;
> +}Presumably it is not something hard to find, but perhaps it would be better to print the version that were given (for example "1" instead of "v1")?
-- Jakub Narębski