git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Bo Yang <struggleyb.nku@gmail.com>
Cc: <git@vger.kernel.org>, <gitster@pobox.com>
Subject: Re: [PATCH 7/7] Make --color-words work well with --graph.
Date: Mon, 17 May 2010 08:59:27 +0200	[thread overview]
Message-ID: <201005170859.28022.trast@student.ethz.ch> (raw)
In-Reply-To: <1273921331-32702-8-git-send-email-struggleyb.nku@gmail.com>

Bo Yang wrote:
> @@ -629,20 +640,39 @@ static void fn_out_diff_words_aux(void *priv, char *line, unsigned long len)
>  	} else
>  		plus_begin = plus_end = diff_words->plus.orig[plus_first].end;
>  
> -	if (diff_words->current_plus != plus_begin)
> -		fwrite(diff_words->current_plus,
> -				plus_begin - diff_words->current_plus, 1,
> -				diff_words->file);
> -	if (minus_begin != minus_end)
> -		color_fwrite_lines(diff_words->file,
> +	if (diff_words->current_plus != plus_begin) {
> +		if ((diff_words->current_plus == diff_words->plus.text.ptr &&
> +			diff_words->last_minus == 0) ||
> +			(diff_words->current_plus > diff_words->plus.text.ptr &&
> +			*(diff_words->current_plus - 1) == '\n')) {
> +			fputs(line_prefix, diff_words->opt->file);
> +			print = 1;

Are these border checks needed/the best solution?  If so, please can
you put an explanation in the commit message?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2010-05-17  6:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-15 11:02 [PATCH 0/7] Make git log --graph looks better with -p and other diff options Bo Yang
2010-05-15 11:02 ` [PATCH 1/7] Add a prefix output callback to diff output Bo Yang
2010-05-15 11:02   ` [PATCH 2/7] Change to call the new emit_line Bo Yang
2010-05-15 11:02     ` [PATCH 3/7] Output the graph columns at the end of the commit message Bo Yang
2010-05-15 11:02       ` [PATCH 4/7] diff.c: Output the text graph padding before each diff line Bo Yang
2010-05-15 11:02         ` [PATCH 5/7] Emit a whole line once a time Bo Yang
2010-05-15 11:02           ` [PATCH 6/7] Register a callback for graph output Bo Yang
2010-05-15 11:02             ` [PATCH 7/7] Make --color-words work well with --graph Bo Yang
2010-05-17  6:59               ` Thomas Rast [this message]
2010-05-17  6:57             ` [PATCH 6/7] Register a callback for graph output Thomas Rast
2010-05-17  6:52         ` [PATCH 4/7] diff.c: Output the text graph padding before each diff line Thomas Rast
2010-05-17  6:45     ` [PATCH 2/7] Change to call the new emit_line Thomas Rast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005170859.28022.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=struggleyb.nku@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).