[PATCH] Use "" instead of "<unknown>" for placeholders [was Re: [PATCH] Added a new placeholder '%cm' for full commit message]
Johannes Schindelin wrote:
Show 13 quoted lines
>On Fri, 21 Sep 2007, Michal Vitecek wrote:
>> Johannes Schindelin wrote:
>> >On Fri, 21 Sep 2007, Michal Vitecek wrote:
>> >
>> >> I have added a new placeholder '%cm' for a full commit message.
>> >
>> >You mean the raw message, including the headers? Why not use "%r" for
>> >that?
>>
>> No, sorry for the incorrect term. I meant the whole commit message
>> (subject + 2*\n + body).
>
>Ah, makes sense. In that case, "%M" maybe?
I think it's no longer needed if instead of "<undefined>" only "" will
be substituted.
Show 11 quoted lines
>> >> I made it because I want to use my own pretty format which currently
>> >> only allows '%s' for subject and '%b' for body. But '%b' is
>> >> substituted with <undefined> if the body is "missing" which I
>> >> obviously don't like :)
>> >
>> >Then you should fix %b not to show "<undefined>".
>>
>> I'll do it if it is okay. Shall I do the same for the other
>> placeholders as well?
>
>Yeah. Don't know why I did it that way.
Here comes the big patch :)
>From 2e4ba4e73bbcd19558039dd85fe45c7bbe7fd1c4 Mon Sep 17 00:00:00 2001
From: Michal Vitecek <fuf@mageo.cz>
Date: Fri, 21 Sep 2007 14:40:37 +0200
Subject: [PATCH] Use "" instead of "<unknown>" for placeholders
---
commit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/commit.c b/commit.c
index 99f65ce..7e90bc1 100644
--- a/commit.c
+++ b/commit.c
@@ -919,7 +919,7 @@ long format_commit_message(const struct commit *commit, const void *format,
table[IBODY].value = xstrdup(msg + i);
for (i = 0; i < ARRAY_SIZE(table); i++)
if (!table[i].value)
- interp_set_entry(table, i, "<unknown>");
+ interp_set_entry(table, i, "");
do {
char *buf = *buf_p;
--
1.5.3.1
--
fuf (fuf@mageo.cz)