Re: [PATCH 4/7] diff.c: Output the text graph padding before each diff line.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bo Yang wrote:
> diff --git a/diff.c b/diff.c
> index 9bd9063..4a10d16 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -487,6 +487,13 @@ static void emit_rewrite_diff(const char *name_a,
>  	char *data_one, *data_two;
>  	size_t size_one, size_two;
>  	struct emit_callback ecbdata;
> +	char *line_prefix = "";
> +	struct strbuf *msgbuf;
> +
> +	if (o && o->output_prefix) {
> +		msgbuf = o->output_prefix(o->file, 0, o->output_prefix_data);
> +		line_prefix = msgbuf->buf;
> +	}

Umm.  This snippet of code means that the callback can't to much
except return or print a string depending on the value of the second
argument, doesn't it?

So why not either make it explicit and just put a char* field there,
or make a more generic callback that replaces write() (or so) and
gets a chance to mangle the output in any way it likes?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]