Subject: Re: [PATCH 3/3] Rework pretty_print_commit to use strbufs instead of custom buffers.

From: René Scharfe <[email-masked]>
Date: Sat, 08 Sep 2007 20:40:08 +0200

Pierre Habouzit schrieb:
>   Also remove the "len" parameter, as:
>   (1) it was used as a max boundary, and every caller used ~0u
>   (2) we check for final NUL no matter what, so it doesn't help for speed.
> 
>   As a result most of the pp_* function takes 3 arguments less, and we need
> a lot less local variables, this makes the code way more readable, and
> easier to extend if needed.
> 
>   This patch also fixes some spacing and cosmetic issues.
> 
> Signed-off-by: Pierre Habouzit <[email-masked]>
> ---
>  builtin-branch.c      |   15 +--
>  builtin-log.c         |   12 +-
>  builtin-rev-list.c    |   13 +-
>  builtin-show-branch.c |   13 +-
>  commit.c              |  330 ++++++++++++++++++-------------------------------
>  commit.h              |    6 +-
>  log-tree.c            |   56 +++------
>  7 files changed, 171 insertions(+), 274 deletions(-)

Nice!  I wonder if we should #include strbuf.h from git-compat-util.h
(just like e.g. string.h) instead of from commit.h, in order to have
strbuf available everywhere in git.

Please be aware of the changes to commit.c already in next which your
patch conflicts with: format_commit_message() has been exported and is
used in builtin-archive.c there.

René