Re: v1.5.4 plans
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2007, 05:02 UTC
- Message-ID
- <7vzlwhhli5.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <7vtzmqhvgq.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Jeff King <peff@peff.net> writes: > >> A few regressions that you did not mention, but I think should be >> addressed before 1.5.4: >> >> - extra newline in builtin-commit output. You found a case that >> needs it, but fixing it is non-trivial, and I wanted to get your >> input before preparing a patch. See >> >> http://mid.gmane.org/20071203075357.GB3614@sigill.intra.peff.net > > I am actually becoming somewhat fond of the newline that makes the end > of a session that led to a commit stand out ;-). IOW, I was wondering if > we can have another for a merge commit case. > > But I suspect that it amounts to the change in the same area and of > similar complexity.
-- >8 -- [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.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- builtin-commit.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c index b6b81d5..e5a972c 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -660,12 +660,17 @@ static void print_summary(const char *prefix, const unsigned char *sha1) rev.verbose_header = 1; rev.show_root_diff = 1; rev.commit_format = get_commit_format("format:%h: %s"); - rev.always_show_header = 1; + rev.always_show_header = 0; printf("Created %scommit ", initial_commit ? "initial " : ""); - 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); + } } int git_commit_config(const char *k, const char *v)
-- 1.5.3.7-1149-g591a