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

[PATCH] Better error message from checkout-cache for unmerged files.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 17, 2005, 09:00 UTC
Message-ID
<7vvf6lzsjn.fsf@assigned-by-dhcp.cox.net>

The checkout-cache command says "file is not in the cache" when an unmerged path is given. This patch adds code to distinguish the unmerged and the nonexistent cases and gives an appropriate error message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 checkout-cache.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

checkout-cache.c: e16619c9d099367c224fb485f5525d66267bbd92 --- checkout-cache.c +++ checkout-cache.c 2005-04-17 01:49:01.000000000 -0700

@@ -121,8 +121,15 @@
 {
 	int pos = cache_name_pos(name, strlen(name));
 	if (pos < 0) {
-		if (!quiet)
-			fprintf(stderr, "checkout-cache: %s is not in the cache\n", name);
+		if (!quiet) {
+			pos = -pos - 1;
+			fprintf(stderr,
+				"checkout-cache: %s is %s.\n",
+				name,
+				(pos < active_nr &&
+				 !strcmp(active_cache[pos]->name, name)) ?
+				"unmerged" : "not in the cache");
+		}
 		return -1;
 	}
 	return checkout_entry(active_cache[pos]);
Message 1 of 1 in “Better error message from checkout-cache for unmerged files.”
  1. Better error message from checkout-cache for unmerged files.Junio C Hamano, Apr 17, 2005

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.