git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Bo YangNext: Jeff King
Message 8 of 13 in “Make git log --graph looks better with -p and other diff options”
  1. 0/6 Make git log --graph looks better with -p and other diff optionsBo Yang, May 25, 2010
  2. 1/6 Add a prefix output callback to diff output.Bo Yang, May 25, 2010
  3. 2/6 Output the graph columns at the end of the commit message.Bo Yang, May 25, 2010
  4. 3/6 diff.c: Output the text graph padding before each diff line.Bo Yang, May 25, 2010
  5. 4/6 Emit a whole line once a time.Bo Yang, May 25, 2010
  6. 5/6 Register a callback for graph output.Bo Yang, May 25, 2010
  7. 6/6 Make --color-words work well with --graph.Bo Yang, May 25, 2010
  8. Junio C HamanoMay 26, 2010
  9. Jeff KingMay 25, 2010
  10. Bo YangMay 25, 2010
  11. Jeff KingMay 25, 2010
  12. Bo YangMay 25, 2010
  13. Jeff KingMay 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.