mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
Merge branch 'rs/maint-shortlog-foldline'
* rs/maint-shortlog-foldline: shortlog: handle multi-line subjects like log --pretty=oneline et. al. do
This commit is contained in:
commit
b4147b3af2
|
@ -29,6 +29,9 @@ static int compare_by_number(const void *a1, const void *a2)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *format_subject(struct strbuf *sb, const char *msg,
|
||||||
|
const char *line_separator);
|
||||||
|
|
||||||
static void insert_one_record(struct shortlog *log,
|
static void insert_one_record(struct shortlog *log,
|
||||||
const char *author,
|
const char *author,
|
||||||
const char *oneline)
|
const char *oneline)
|
||||||
|
@ -40,6 +43,7 @@ static void insert_one_record(struct shortlog *log,
|
||||||
size_t len;
|
size_t len;
|
||||||
const char *eol;
|
const char *eol;
|
||||||
const char *boemail, *eoemail;
|
const char *boemail, *eoemail;
|
||||||
|
struct strbuf subject = STRBUF_INIT;
|
||||||
|
|
||||||
boemail = strchr(author, '<');
|
boemail = strchr(author, '<');
|
||||||
if (!boemail)
|
if (!boemail)
|
||||||
|
@ -85,9 +89,8 @@ static void insert_one_record(struct shortlog *log,
|
||||||
while (*oneline && isspace(*oneline) && *oneline != '\n')
|
while (*oneline && isspace(*oneline) && *oneline != '\n')
|
||||||
oneline++;
|
oneline++;
|
||||||
len = eol - oneline;
|
len = eol - oneline;
|
||||||
while (len && isspace(oneline[len-1]))
|
format_subject(&subject, oneline, " ");
|
||||||
len--;
|
buffer = strbuf_detach(&subject, NULL);
|
||||||
buffer = xmemdupz(oneline, len);
|
|
||||||
|
|
||||||
if (dot3) {
|
if (dot3) {
|
||||||
int dot3len = strlen(dot3);
|
int dot3len = strlen(dot3);
|
||||||
|
|
4
pretty.c
4
pretty.c
|
@ -486,8 +486,8 @@ static void parse_commit_header(struct format_commit_context *context)
|
||||||
context->commit_header_parsed = 1;
|
context->commit_header_parsed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *format_subject(struct strbuf *sb, const char *msg,
|
const char *format_subject(struct strbuf *sb, const char *msg,
|
||||||
const char *line_separator)
|
const char *line_separator)
|
||||||
{
|
{
|
||||||
int first = 1;
|
int first = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue