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

[PATCH v2 2/2] merge: use help_unknown_ref

From
Vikrant Varma <vikrant.varma94@gmail.com>
Date
May 4, 2013, 00:04 UTC
Message-ID
<1367625860-20746-3-git-send-email-vikrant.varma94@gmail.com>
In-Reply-To
<1367625860-20746-1-git-send-email-vikrant.varma94@gmail.com>

Use help.c:help_unknown_ref instead of die to provide a friendlier error message before exiting, when one of the refs specified in a merge is unknown.

Signed-off-by: Vikrant Varma <vikrant.varma94@gmail.com>
---
 builtin/merge.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index 3e2daa3..2ebe732 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1054,7 +1054,8 @@ static struct commit_list *collect_parents(struct commit *head_commit,
 	for (i = 0; i < argc; i++) {
 		struct commit *commit = get_merge_parent(argv[i]);
 		if (!commit)
-			die(_("%s - not something we can merge"), argv[i]);
+			help_unknown_ref(argv[i], "merge",
+					 "not something we can merge");
 		remotes = &commit_list_insert(commit, remotes)->next;
 	}
 	*remotes = NULL;
-- 
1.7.10.4
Previous: Vikrant Varma
Message 5 of 5 in “Show suggested refs when ref unknown”
  1. 0/2 Show suggested refs when ref unknownVikrant Varma, May 4, 2013
  2. 1/2 help: add help_unknown_refVikrant Varma, May 4, 2013
  3. Junio C HamanoMay 8, 2013
  4. Vikrant VarmaMay 9, 2013
  5. 2/2 merge: use help_unknown_refVikrant Varma, May 4, 2013

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.