author | Jeff King <peff@peff.net> | |
Thu, 26 May 2011 22:27:49 +0000 (18:27 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 26 May 2011 22:56:47 +0000 (15:56 -0700) | ||
commit | 6bf139440c192e157b9c0dab701fa2100fbb1e1e | |
tree | c323ffd9a154e3da23820da1302c92f42af88b78 | tree | snapshot |
parent | 8b8a53744f60274ef07e3a2a51995129c8d42f38 | commit | diff |
clean up calling conventions for pretty.c functions
We have a pretty_print_context representing the parameters
for a pretty-print session, but we did not use it uniformly.
As a result, functions kept growing more and more arguments.
Let's clean this up in a few ways:
1. All pretty-print pp_* functions now take a context.
This lets us reduce the number of arguments to these
functions, since we were just passing around the
context values separately.
2. The context argument now has a cmit_fmt field, which
was passed around separately. That's one less argument
per function.
3. The context argument always comes first, which makes
calling a little more uniform.
This drops lines from some callers, and adds lines in a few
places (because we need an extra line to set the context's
fmt field). Overall, we don't save many lines, but the lines
that are there are a lot simpler and more readable.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We have a pretty_print_context representing the parameters
for a pretty-print session, but we did not use it uniformly.
As a result, functions kept growing more and more arguments.
Let's clean this up in a few ways:
1. All pretty-print pp_* functions now take a context.
This lets us reduce the number of arguments to these
functions, since we were just passing around the
context values separately.
2. The context argument now has a cmit_fmt field, which
was passed around separately. That's one less argument
per function.
3. The context argument always comes first, which makes
calling a little more uniform.
This drops lines from some callers, and adds lines in a few
places (because we need an extra line to set the context's
fmt field). Overall, we don't save many lines, but the lines
that are there are a lot simpler and more readable.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c | diff | blob | history | |
builtin/merge.c | diff | blob | history | |
builtin/rev-list.c | diff | blob | history | |
builtin/shortlog.c | diff | blob | history | |
commit.h | diff | blob | history | |
log-tree.c | diff | blob | history | |
pretty.c | diff | blob | history |