summaryrefslogtreecommitdiff
path: root/builtin-shortlog.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-17 23:05:23 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-17 23:05:23 -0800
commitb4147b3af24852250632ec4ed7e41c608aa8c6a3 (patch)
treea20e1efd64bc2cdb5ab5b575ddd02f2540c9a876 /builtin-shortlog.c
parent8f5707f9a9ac9e1f5afe6f415731fb46ea2da8ff (diff)
parentcec08717cca468c66eb454c7201fd35f54b48a58 (diff)
downloadgit-b4147b3af24852250632ec4ed7e41c608aa8c6a3.tar.gz
Merge branch 'rs/maint-shortlog-foldline'
* rs/maint-shortlog-foldline: shortlog: handle multi-line subjects like log --pretty=oneline et. al. do
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r--builtin-shortlog.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 90e76ae420..5f9f3f09b1 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -29,6 +29,9 @@ static int compare_by_number(const void *a1, const void *a2)
return -1;
}
+const char *format_subject(struct strbuf *sb, const char *msg,
+ const char *line_separator);
+
static void insert_one_record(struct shortlog *log,
const char *author,
const char *oneline)
@@ -40,6 +43,7 @@ static void insert_one_record(struct shortlog *log,
size_t len;
const char *eol;
const char *boemail, *eoemail;
+ struct strbuf subject = STRBUF_INIT;
boemail = strchr(author, '<');
if (!boemail)
@@ -85,9 +89,8 @@ static void insert_one_record(struct shortlog *log,
while (*oneline && isspace(*oneline) && *oneline != '\n')
oneline++;
len = eol - oneline;
- while (len && isspace(oneline[len-1]))
- len--;
- buffer = xmemdupz(oneline, len);
+ format_subject(&subject, oneline, " ");
+ buffer = strbuf_detach(&subject, NULL);
if (dot3) {
int dot3len = strlen(dot3);