summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be15f50)
raw | patch | inline | side by side (parent: be15f50)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Dec 2007 05:02:26 +0000 (21:02 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Dec 2007 08:38:46 +0000 (00:38 -0800) |
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>
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 | patch | blob | history |
diff --git a/builtin-commit.c b/builtin-commit.c
index b6b81d531d8b560315298353e5b0ae377581c566..9cb7589ac68172591ae458a20031e7dedd65adee 100644 (file)
--- a/builtin-commit.c
+++ b/builtin-commit.c
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)