From: Antoine Pelisse Date: Wed, 12 Dec 2012 13:27:24 GMT Subject: Re: [PATCH 4/5] pretty: Use mailmap to display username and email Message-ID: In-Reply-To: <7vehiw6wc1.fsf@alter.siamese.dyndns.org> > 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. >> + 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.