Re: v1.5.4 plans
- From
Jeff King <peff@peff.net>
- Date
- Dec 11, 2007, 06:39 UTC
- Message-ID
- <20071211063941.GB21718@coredump.intra.peff.net>
- In-Reply-To
- <7vzlwhhli5.fsf@gitster.siamese.dyndns.org>
On Mon, Dec 10, 2007 at 09:02:26PM -0800, Junio C Hamano wrote:
Show 5 quoted lines
> [PATCH] commit: do not add extra LF at the end of the summary. > > The scripted version relied on the nice "auto-strip the terminating LF" > behaviour shell gives to "var=$(cmd)" construct, but we have to roll > that ourselves.
This looks reasonable and generates the correct output as far as I can tell, but...
Show 9 quoted lines
> - log_tree_commit(&rev, commit);
> - printf("\n");
> + if (!log_tree_commit(&rev, commit)) {
> + struct strbuf buf = STRBUF_INIT;
> + pretty_print_commit(rev.commit_format, commit, &buf,
> + 0, NULL, NULL, 0, 0);
> + printf("%s\n", buf.buf);
> + strbuf_release(&buf);
> + }We are duplicating the "!shown && ..." conditional branch from log_tree_commit, which calls show_log. Why are we not calling show_log instead of pretty_print_commit (I understand that show_log should end up calling pretty_print_commit, but it is not immediately obvious that all of the extra code in show_log is going to be ignored).
-Peff