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

[PATCH] Fix confusing git-update-ref error message

From
Petr Baudis <pasky@suse.cz>
Date
Nov 10, 2005, 19:55 UTC
Message-ID
<20051110195513.25573.31064.stgit@machine.or.cz>

When git-update-ref has hit the "Ref %s changed to %s" error, I just stare at it, left puzzled. This patch attempts to reword that to a more useful and less confusing error message.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 update-ref.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/update-ref.c b/update-ref.c
index 65dc3d6..d79dc52 100644
--- a/update-ref.c
+++ b/update-ref.c
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
 
 	if (oldval) {
 		if (memcmp(currsha1, oldsha1, 20))
-			die("Ref %s changed to %s", refname, sha1_to_hex(currsha1));
+			die("Ref %s is at %s but expected %s", refname, sha1_to_hex(currsha1), sha1_to_hex(oldsha1));
 		/* Nothing to do? */
 		if (!memcmp(oldsha1, sha1, 20))
 			exit(0);
Message 1 of 1 in “Fix confusing git-update-ref error message”
  1. Fix confusing git-update-ref error messagePetr Baudis, Nov 10, 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.