aboutsummaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-05-26 18:27:49 -0400
committerJunio C Hamano <gitster@pobox.com>2011-05-26 15:56:47 -0700
commit6bf139440c192e157b9c0dab701fa2100fbb1e1e (patch)
treec323ffd9a154e3da23820da1302c92f42af88b78 /builtin/rev-list.c
parent8b8a53744f60274ef07e3a2a51995129c8d42f38 (diff)
downloadgit-6bf139440c192e157b9c0dab701fa2100fbb1e1e.tar.gz
git-6bf139440c192e157b9c0dab701fa2100fbb1e1e.tar.xz
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>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index ba27d39f9..0ec42fc75 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -108,7 +108,8 @@ static void show_commit(struct commit *commit, void *data)
struct pretty_print_context ctx = {0};
ctx.abbrev = revs->abbrev;
ctx.date_mode = revs->date_mode;
- pretty_print_commit(revs->commit_format, commit, &buf, &ctx);
+ ctx.fmt = revs->commit_format;
+ pretty_print_commit(&ctx, commit, &buf);
if (revs->graph) {
if (buf.len) {
if (revs->commit_format != CMIT_FMT_ONELINE)