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

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Fredrik Kuivinen <hidden>
Date: 2016-06-15 22:42:21

Signed-off-by: Fredrik Kuivinen <redacted>


---

 blame.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

aebef8969d11b04634b9ab7a6ae85a0844b2e4c7
diff --git a/blame.c b/blame.c
index 6dccae5..0fb30ee 100644
--- a/blame.c
+++ b/blame.c
@@ -235,6 +235,7 @@ static void print_patch(struct patch *p)
 }
 
 /* For debugging only */
+#if DEBUG
 static void print_map(struct commit *cmit, struct commit *other)
 {
 	struct util_info *util = cmit->object.util;
@@ -267,6 +268,7 @@ static void print_map(struct commit *cmi
 		printf("\n");
 	}
 }
+#endif
 
 // p is a patch from commit to other.
 static void fill_line_map(struct commit *commit, struct commit *other,
-- 
1.2.4.g4644-dirty

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

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:21


Fredrik,

Three comments on "git-blame":

 - you should use "-u -U 0" instead of "-u0" to avoid warnings from some 
   versions of GNU diff

 - Please default to HEAD so that you don't need to say it.

 - What I'd actually want to see is blame for a certain group of lines. 
   Ie, I'd like to see

	git-blame --line=50-56 filename

   which only shows those 7 lines. That would be wonderful for a visual 
   interface where you could mark off a few lines and say "follow these 
   backwards" kind of thing, and should make it more efficient than trying 
   to resolve the _whole_ file.

Hmm?

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help