diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-10 21:02:26 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-11 00:38:46 -0800 |
commit | bf82a15095ed374496c2e98b6b672aa8c8c4d034 (patch) | |
tree | b85d282ca4fb5d022226bdbe70b4324a911ca637 /builtin-commit.c | |
parent | be15f50538afa4bfb912a86fa9d9f141010ad691 (diff) | |
download | git-bf82a15095ed374496c2e98b6b672aa8c8c4d034.tar.gz |
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>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index b6b81d531d..9cb7589ac6 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -660,12 +660,16 @@ 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; + format_commit_message(commit, "%h: %s", &buf); + printf("%s\n", buf.buf); + strbuf_release(&buf); + } } int git_commit_config(const char *k, const char *v) |