Re: v1.5.4 plans

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Jeff King <peff@xxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
>
> 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@xxxxxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux