Skip to contentSkip to conversation

diff.c: fix a graph output bug

PATCH In review [email protected] 3 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 diff.c: fix a graph output bug

From: Bo Yang <[email protected]>

Ouput the line_prefix ahead of color sequence.

---
 diff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff.c +1 -2
index 3aa695d..17873f3 100644
@@ -2627,8 +2627,7 @@ static void fill_metainfo(struct strbuf *msg,
 			    (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two)))
 				abbrev = 40;
 		}
-		strbuf_addf(msg, "%s%sindex %s..", set,
-			    line_prefix,
+		strbuf_addf(msg, "%s%sindex %s..", line_prefix, set,
 			    find_unique_abbrev(one->sha1, abbrev));
 		strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev));
 		if (one->mode == two->mode)
Signature · 1 line
1.7.0.2.273.gc2413.dirty
#1 lore raw
Quoted 3 lines · [email protected] writes:

From: Bo Yang <[email protected]>

Ouput the line_prefix ahead of color sequence.

Justification for the patch, and/or a better bug description ("when run with this combination of options, X gets painted in that color that is not meant to be used for X") please?

Quoted 27 lines
---
 diff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff.c +1 -2
index 3aa695d..17873f3 100644
@@ -2627,8 +2627,7 @@ static void fill_metainfo(struct strbuf *msg,
 			    (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two)))
 				abbrev = 40;
 		}
-		strbuf_addf(msg, "%s%sindex %s..", set,
-			    line_prefix,
+		strbuf_addf(msg, "%s%sindex %s..", line_prefix, set,
 			    find_unique_abbrev(one->sha1, abbrev));
 		strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev));
 		if (one->mode == two->mode)
Signature · 6 lines
1.7.0.2.273.gc2413.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 11 lines · Junio C Hamano
Quoted 3 lines · [email protected] writes:

From: Bo Yang <[email protected]>

Ouput the line_prefix ahead of color sequence.

Justification for the patch, and/or a better bug description ("when run with this combination of options, X gets painted in that color that is not meant to be used for X") please?

Quoted 2 lines

Perhaps something like this?

From: Bo Yang <[email protected]>
Date: Thu, 8 Jul 2010 23:12:34 +0800
Subject: [PATCH] diff.c: fix a graph output bug

When --graph is in effect, the line-prefix typically has colored graph line segments and ends with reset. The color sequence "set" given to this function is for showing the metainfo part of the patch text and
(1) it should not be applied to the graph lines, and (2) it will be reset at the end of line_prefix so it won't be effect anyway.

---
 diff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

...

#3 lore raw
Quoted 1 line · Junio C Hamano

reset at the end of line_prefix so it won't be effect anyway.

s/effect/affected/ ?

nazri

#4 lore raw
Quoted 4 lines · Nazri Ramliy
Quoted 1 line · Junio C Hamano

reset at the end of line_prefix so it won't be effect anyway.

s/effect/affected/ ?

Thanks for spotting. I meant to say "won't be in effect".

author
#5 lore raw
In reply to Junio C Hamano

Hi Junio,

Quoted 12 lines · Junio C Hamano

Perhaps something like this?

From: Bo Yang <[email protected]>
Date: Thu, 8 Jul 2010 23:12:34 +0800
Subject: [PATCH] diff.c: fix a graph output bug

When --graph is in effect, the line-prefix typically has colored graph line segments and ends with reset.  The color sequence "set" given to this function is for showing the metainfo part of the patch text and
(1) it should not be applied to the graph lines, and (2) it will be reset at the end of line_prefix so it won't be effect anyway.

Quoted 7 lines

---
 diff.c |    3 +--

 1 files changed, 1 insertions(+), 2 deletions(-)

 ...

Hmm, your description is great, thanks a lot! And please apply this patch, thanks!

Signature · 5 lines
Regards!
Bo
----------------------------
My blog: http://blog.morebits.org
Why Git: http://www.whygitisbetterthanx.com/