Skip to content

Commit

Permalink
commit: do not add extra LF at the end of the summary.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 11, 2007
1 parent be15f50 commit bf82a15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf82a15

Please sign in to comment.