git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] diff.c: fix a graph output bug
@ 2010-07-08 15:12 struggleyb.nku
  2010-07-09  0:15 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: struggleyb.nku @ 2010-07-08 15:12 UTC (permalink / raw)
  To: git; +Cc: gitster

From: Bo Yang <struggleyb.nku@gmail.com>

Ouput the line_prefix ahead of color sequence.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
---
 diff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index 3aa695d..17873f3 100644
--- a/diff.c
+++ b/diff.c
@@ -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)
-- 
1.7.0.2.273.gc2413.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] diff.c: fix a graph output bug
  2010-07-08 15:12 [PATCH] diff.c: fix a graph output bug struggleyb.nku
@ 2010-07-09  0:15 ` Junio C Hamano
  2010-07-09  0:57   ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2010-07-09  0:15 UTC (permalink / raw)
  To: struggleyb.nku; +Cc: git, gitster

struggleyb.nku@gmail.com writes:

> From: Bo Yang <struggleyb.nku@gmail.com>
>
> 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?

>
> Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
> ---
>  diff.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index 3aa695d..17873f3 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -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)
> -- 
> 1.7.0.2.273.gc2413.dirty
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] diff.c: fix a graph output bug
  2010-07-09  0:15 ` Junio C Hamano
@ 2010-07-09  0:57   ` Junio C Hamano
  2010-07-09  1:04     ` Nazri Ramliy
  2010-07-11  6:10     ` Bo Yang
  0 siblings, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2010-07-09  0:57 UTC (permalink / raw)
  To: struggleyb.nku; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> struggleyb.nku@gmail.com writes:
>
>> From: Bo Yang <struggleyb.nku@gmail.com>
>>
>> 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?
>>
>> Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>

Perhaps something like this?

From: Bo Yang <struggleyb.nku@gmail.com>
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.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 diff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
 ...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] diff.c: fix a graph output bug
  2010-07-09  0:57   ` Junio C Hamano
@ 2010-07-09  1:04     ` Nazri Ramliy
  2010-07-09  1:09       ` Junio C Hamano
  2010-07-11  6:10     ` Bo Yang
  1 sibling, 1 reply; 6+ messages in thread
From: Nazri Ramliy @ 2010-07-09  1:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: struggleyb.nku, git

On Fri, Jul 9, 2010 at 8:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
> reset at the end of line_prefix so it won't be effect anyway.

s/effect/affected/  ?

nazri

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] diff.c: fix a graph output bug
  2010-07-09  1:04     ` Nazri Ramliy
@ 2010-07-09  1:09       ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2010-07-09  1:09 UTC (permalink / raw)
  To: Nazri Ramliy; +Cc: Junio C Hamano, struggleyb.nku, git

Nazri Ramliy <ayiehere@gmail.com> writes:

> On Fri, Jul 9, 2010 at 8:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] diff.c: fix a graph output bug
  2010-07-09  0:57   ` Junio C Hamano
  2010-07-09  1:04     ` Nazri Ramliy
@ 2010-07-11  6:10     ` Bo Yang
  1 sibling, 0 replies; 6+ messages in thread
From: Bo Yang @ 2010-07-11  6:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi Junio,

On Fri, Jul 9, 2010 at 8:57 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Perhaps something like this?
>
> From: Bo Yang <struggleyb.nku@gmail.com>
> 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.
>
> Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  diff.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>  ...
>

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-11  6:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08 15:12 [PATCH] diff.c: fix a graph output bug struggleyb.nku
2010-07-09  0:15 ` Junio C Hamano
2010-07-09  0:57   ` Junio C Hamano
2010-07-09  1:04     ` Nazri Ramliy
2010-07-09  1:09       ` Junio C Hamano
2010-07-11  6:10     ` Bo Yang

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).