Skip to content

Commit

Permalink
Merge branch 'rs/maint-shortlog-foldline' into maint
Browse files Browse the repository at this point in the history
* rs/maint-shortlog-foldline:
  shortlog: handle multi-line subjects like log --pretty=oneline et. al. do
  • Loading branch information
Junio C Hamano committed Jan 24, 2009
2 parents 67b175b + cec0871 commit 46cdcc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions builtin-shortlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -41,6 +44,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)
Expand Down Expand Up @@ -89,9 +93,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);
Expand Down
4 changes: 2 additions & 2 deletions pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ static void parse_commit_header(struct format_commit_context *context)
context->commit_header_parsed = 1;
}

static const char *format_subject(struct strbuf *sb, const char *msg,
const char *line_separator)
const char *format_subject(struct strbuf *sb, const char *msg,
const char *line_separator)
{
int first = 1;

Expand Down

0 comments on commit 46cdcc6

Please sign in to comment.