git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Pelisse <apelisse@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>, Rich Midwinter <rich.midwinter@gmail.com>
Subject: Re: [PATCH 4/5] pretty: Use mailmap to display username and email
Date: Wed, 12 Dec 2012 14:27:24 +0100	[thread overview]
Message-ID: <CALWbr2w65iAnegu-VSLWo1Ckh9q8291aVVjchcXaz1A24bLcEA@mail.gmail.com> (raw)
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.

  reply	other threads:[~2012-12-12 13:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-11 22:21 [PATCH 0/5] Allow git log to use mailmap file Antoine Pelisse
2012-12-11 22:21 ` [PATCH 1/5] Use split_ident_line to parse author and committer Antoine Pelisse
2012-12-11 22:21 ` [PATCH 2/5] mailmap: Remove buffer length limit in map_user Antoine Pelisse
2012-12-11 22:21 ` [PATCH 3/5] mailmap: Add mailmap structure to rev_info and pp Antoine Pelisse
2012-12-11 22:21 ` [PATCH 4/5] pretty: Use mailmap to display username and email Antoine Pelisse
2012-12-11 22:46   ` Junio C Hamano
2012-12-12 13:27     ` Antoine Pelisse [this message]
2012-12-11 22:21 ` [PATCH 5/5] log: Add --use-mailmap option Antoine Pelisse
2012-12-12 11:58   ` Antoine Pelisse
2012-12-12 17:58     ` Junio C Hamano
2012-12-11 22:33 ` [PATCH 0/5] Allow git log to use mailmap file Junio C Hamano
2012-12-11 22:41   ` Rich Midwinter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALWbr2w65iAnegu-VSLWo1Ckh9q8291aVVjchcXaz1A24bLcEA@mail.gmail.com \
    --to=apelisse@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rich.midwinter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).