git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Denton Liu <liu.denton@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 3/3] branch: don't mix --edit-description
Date: Wed, 17 Jun 2020 11:09:44 -0700	[thread overview]
Message-ID: <xmqqv9jpva1j.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <1d0eebd1ecf24db0241801af31d904a19ad391a8.1592221875.git.liu.denton@gmail.com> (Denton Liu's message of "Mon, 15 Jun 2020 07:53:20 -0400")

Denton Liu <liu.denton@gmail.com> writes:

> `git branch` accepts `--edit-description` in conjunction with other
> arguments. However, `--edit-description` is its own mode, similar to
> `--set-upstream-to`, which is also made mutually exclusive with other
> modes. Prevent `--edit-description` from being mixed with other modes.

Makes sense.  Do we have some "these options are mutually exclusive"
test?

It makes me wonder if this can/should be switched to OPT_CMDMODE()
so that we do not have to write this if statement in the first
place.


> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  builtin/branch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index accb61b1aa..99633ad004 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -693,7 +693,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>  		list = 1;
>  
>  	if (!!delete + !!rename + !!copy + !!new_upstream + !!show_current +
> -	    list + unset_upstream > 1)
> +	    list + edit_description + unset_upstream > 1)
>  		usage_with_options(builtin_branch_usage, options);
>  
>  	if (filter.abbrev == -1)

  reply	other threads:[~2020-06-17 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 11:53 [PATCH 0/3] branch and t3200 cleanup Denton Liu
2020-06-15 11:53 ` [PATCH 1/3] t3200: rename "expected" to "expect" Denton Liu
2020-06-15 11:53 ` [PATCH 2/3] t3200: test for specific errors Denton Liu
2020-06-15 11:53 ` [PATCH 3/3] branch: don't mix --edit-description Denton Liu
2020-06-17 18:09   ` Junio C Hamano [this message]
2020-06-17 18:12 ` [PATCH 0/3] branch and t3200 cleanup 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=xmqqv9jpva1j.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.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).