diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-06-11 00:34:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-13 00:41:21 -0700 |
commit | 80583c0ef61cc966c7eee79cf3623a83197e19b8 (patch) | |
tree | 91afec821a568d3f96ecd3da5c2a80022dc36dda /builtin-rev-list.c | |
parent | 90ac368afd75c9a53c6d953a693380369a41f8db (diff) | |
download | git-80583c0ef61cc966c7eee79cf3623a83197e19b8.tar.gz |
Lift 16kB limit of log message output
Traditionally we had 16kB limit when formatting log messages for
output, because it was easier to arrange for the caller to have
a reasonably big buffer and pass it down without ever worrying
about reallocating.
This changes the calling convention of pretty_print_commit() to
lift this limit. Instead of the buffer and remaining length, it
now takes a pointer to the pointer that points at the allocated
buffer, and another pointer to the location that stores the
allocated length, and reallocates the buffer as necessary.
To support the user format, the error return of interpolate()
needed to be changed. It used to return a bool telling "Ok the
result fits", or "Sorry, I had to truncate it". Now it returns
0 on success, and returns the size of the buffer it wants in
order to fit the whole result.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r-- | builtin-rev-list.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c index ebf53f5944..813aadf596 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -92,11 +92,13 @@ static void show_commit(struct commit *commit) putchar('\n'); if (revs.verbose_header) { - static char pretty_header[16384]; + char *buf = NULL; + unsigned long buflen = 0; pretty_print_commit(revs.commit_format, commit, ~0, - pretty_header, sizeof(pretty_header), + &buf, &buflen, revs.abbrev, NULL, NULL, revs.date_mode); - printf("%s%c", pretty_header, hdr_termination); + printf("%s%c", buf, hdr_termination); + free(buf); } fflush(stdout); if (commit->parents) { |