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

[PATCH] Improve error message: not a valid branch name

From
Jari Aalto <jari.aalto@cante.net>
Date
Aug 26, 2007, 15:28 UTC
Message-ID
<y7fyfh7x.fsf@cante.net>

(create_branch): Extend die message from 'is not a valid branch name' to '...(see git-check-ref-format)'.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 builtin-branch.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index 7408285..1006a85 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -431,7 +431,8 @@ static void create_branch(const char *name, const char *start_name,
 
 	snprintf(ref, sizeof ref, "refs/heads/%s", name);
 	if (check_ref_format(ref))
-		die("'%s' is not a valid branch name.", name);
+		die("'%s' is not a valid branch name "
+                    "(see git-check-ref-format)", name);
 
 	if (resolve_ref(ref, sha1, 1, NULL)) {
 		if (!force)
@@ -502,13 +503,15 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 		die("Old branchname too long");
 
 	if (check_ref_format(oldref))
-		die("Invalid branch name: %s", oldref);
+		die("Invalid branch name: %s "
+                    "(see git-check-ref-format)", oldref);
 
 	if (snprintf(newref, sizeof(newref), "refs/heads/%s", newname) > sizeof(newref))
 		die("New branchname too long");
 
 	if (check_ref_format(newref))
-		die("Invalid branch name: %s", newref);
+		die("Invalid branch name: %s "
+                    "(see git-check-ref-format)", newref);
 
 	if (resolve_ref(newref, sha1, 1, NULL) && !force)
 		die("A branch named '%s' already exists.", newname);
-- 
1.5.3.rc5
Next: Junio C Hamano
Message 1 of 4 in “Improve error message: not a valid branch name”
  1. Improve error message: not a valid branch nameJari Aalto, Aug 26, 2007
  2. Junio C HamanoAug 26, 2007
  3. Jari AaltoAug 26, 2007
  4. J. Bruce FieldsAug 26, 2007

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.