git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 4/5] pretty: Use mailmap to display username and email

From
Antoine Pelisse <apelisse@gmail.com>
Date
Dec 12, 2012, 13:27 UTC
Message-ID
<CALWbr2w65iAnegu-VSLWo1Ckh9q8291aVVjchcXaz1A24bLcEA@mail.gmail.com>
In-Reply-To
<7vehiw6wc1.fsf@alter.siamese.dyndns.org>
Show 14 quoted lines
> Or it might be better to make those two strbufs output-only
> parameter, e.g.
>
>         map_user(struct string_list *mailmap,
>                 const char *name, size_t namelen,
>                 const char *mail, size_t maillen,
>                 struct strbuf *name_out, struct strbuf *mail_out);
>
> then after split_ident_line(), this caller could feed two pointers
> into the original "line" as name and mail parameter, without making
> any copies (the callee has to make a copy but it has to be done
> anyway when the name/mail is mapped).  I suspect it would make this
> caller simpler, but I do not know how invasive such changes are for
> other callers of map_user().

It makes a lot of sense. blame.c::get_commit_info() hard code the length shortlog.c::insert_one_record() hard code the length pretty.c::format_person_part() hard code the length

I don't think it will be invasive.
> Such an update can be left outside of this series, of course.

I will try to make it at the beginning of the series. It will avoid unnecessary conflicts.

Show 7 quoted lines
>> +             strbuf_addch(sb, ' ');
>> +             strbuf_addch(sb, '<');
>> +             strbuf_add(sb, person_mail, strlen(person_mail));
>> +             strbuf_addch(sb, '>');
>>               strbuf_addch(sb, '\n');
>
> Is that strbuf_addf(sb, " <%s>\n", person_mail)?
Of couse ;) Fixed.
Previous: Junio C HamanoNext: Antoine Pelisse
Message 7 of 12 in “Allow git log to use mailmap file”
  1. 0/5 Allow git log to use mailmap fileAntoine Pelisse, Dec 11, 2012
  2. 1/5 Use split_ident_line to parse author and committerAntoine Pelisse, Dec 11, 2012
  3. 2/5 mailmap: Remove buffer length limit in map_userAntoine Pelisse, Dec 11, 2012
  4. 3/5 mailmap: Add mailmap structure to rev_info and ppAntoine Pelisse, Dec 11, 2012
  5. 4/5 pretty: Use mailmap to display username and emailAntoine Pelisse, Dec 11, 2012
  6. Junio C HamanoDec 11, 2012
  7. Antoine PelisseDec 12, 2012
  8. 5/5 log: Add --use-mailmap optionAntoine Pelisse, Dec 11, 2012
  9. Antoine PelisseDec 12, 2012
  10. Junio C HamanoDec 12, 2012
  11. Junio C HamanoDec 11, 2012
  12. Rich MidwinterDec 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.