git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] branch: don't mix --edit-description

From
Denton Liu <liu.denton@gmail.com>
Date
Jun 15, 2020, 11:53 UTC
Message-ID
<1d0eebd1ecf24db0241801af31d904a19ad391a8.1592221875.git.liu.denton@gmail.com>
In-Reply-To
<cover.1592221875.git.liu.denton@gmail.com>

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

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)
-- 
2.27.0.132.g321788e831
Previous: Denton LiuNext: Junio C Hamano
Message 4 of 6 in “branch and t3200 cleanup”
  1. 0/3 branch and t3200 cleanupDenton Liu, Jun 15, 2020
  2. 1/3 t3200: rename "expected" to "expect"Denton Liu, Jun 15, 2020
  3. 2/3 t3200: test for specific errorsDenton Liu, Jun 15, 2020
  4. 3/3 branch: don't mix --edit-descriptionDenton Liu, Jun 15, 2020
  5. Junio C HamanoJun 17, 2020
  6. Junio C HamanoJun 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.