Re: [PATCH 3/6 rebase-version] diff.c: Output the text graph padding before each diff line.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 26, 2010, 05:07 UTC
- Message-ID
- <7v7hmrqmi2.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1274778154-29976-4-git-send-email-struggleyb.nku@gmail.com>
Bo Yang <struggleyb.nku@gmail.com> writes:
Show 29 quoted lines
> Change -p/--dirstat/--binary/--numstat/--stat/--shortstat/
> --check/--summary to align with graph paddings.
> Thanks Jeff King <peff@peff.net> for reporting the '--summary' bug and his
> initial patch.
>
> Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
> ---
> diff.c | 201 +++++++++++++++++++++++++++++++++++++++++++++++-----------------
> 1 files changed, 148 insertions(+), 53 deletions(-)
>
> diff --git a/diff.c b/diff.c
> index e2f910a..b99a56c 100644
> --- a/diff.c
> +++ b/diff.c
> ...
> @@ -1289,10 +1329,20 @@ struct dirstat_dir {
> int alloc, nr, percent, cumulative;
> };
>
> -static long gather_dirstat(FILE *file, struct dirstat_dir *dir, unsigned long changed, const char *base, int baselen)
> +static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
> + unsigned long changed, const char *base, int baselen)
> {
> unsigned long this_dir = 0;
> unsigned int sources = 0;
> + assert(opt);
> + FILE *file = opt->file;
> + const char *line_prefix = "";
> + struct strbuf *msg = NULL;Yikes. Do we really need that assert? Also "FILE *file" is used only once and it would be easier to read without an extra variable. Besides, this introduces decl-after-statement error.
Other than that the series looked clean. Oh, please drop the final "." from all of your "Subject:"s.
Thanks.