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

Re: [PATCH] git-blame: Kill warning "print_map defined but not used"

From
Junio C Hamano <junkio@cox.net>
Date
Mar 5, 2006, 22:45 UTC
Message-ID
<7vmzg4ecjg.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0603051054330.13139@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
>  - you should use "-u -U 0" instead of "-u0" to avoid warnings from some 
>    versions of GNU diff
One liner here.
>  - Please default to HEAD so that you don't need to say it.
Fredrik's latest patch already does.
-- >8 --
Subject: [PATCH] blame: avoid "diff -u0".
As Linus suggests, use "diff -u -U 0" instead.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 blame.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
1f7d9585190c22a4c019487444d9e461e08baa0e
diff --git a/blame.c b/blame.c
index a3a8ddc..141e4c6 100644
--- a/blame.c
+++ b/blame.c
@@ -92,7 +92,7 @@ static struct patch *get_patch(struct co
 		die("write failed: %s", strerror(errno));
 	close(fd);
 
-	sprintf(diff_cmd, "diff -u0 %s %s", tmp_path1, tmp_path2);
+	sprintf(diff_cmd, "diff -u -U 0 %s %s", tmp_path1, tmp_path2);
 	fin = popen(diff_cmd, "r");
 	if (!fin)
 		die("popen failed: %s", strerror(errno));
-- 
1.2.4.gee5c7
Previous: Linus Torvalds
Message 3 of 3 in “git-blame: Kill warning "print_map defined but not used"”
  1. git-blame: Kill warning "print_map defined but not used"Fredrik Kuivinen, Mar 5, 2006
  2. Linus TorvaldsMar 5, 2006
  3. Junio C HamanoMar 5, 2006

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.