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

Re: [RFC/PATCH 1/4] builtin: add git-check-mailmap command

From
Antoine Pelisse <apelisse@gmail.com>
Date
Jul 11, 2013, 06:45 UTC
Message-ID
<CALWbr2zJTBSptGsOr6tqrr4KcVd2GOWCkgy4GgdZ2+0Vz7DU4w@mail.gmail.com>
In-Reply-To
<1373483041-27901-2-git-send-email-sunshine@sunshineco.com>
On Wed, Jul 10, 2013 at 9:03 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 16 quoted lines
> +static void check_mailmap(struct string_list *mailmap, const char *contact)
> +{
> +       const char *name, *mail;
> +       size_t namelen, maillen;
> +       struct ident_split ident;
> +       char term = null_out ? '\0' : '\n';
> +
> +       if (split_ident_line(&ident, contact, strlen(contact)))
> +               die(_("unable to parse contact: %s"), contact);
> +
> +       name = ident.name_begin;
> +       namelen = ident.name_end - ident.name_begin;
> +       mail = ident.mail_begin;
> +       maillen = ident.mail_end - ident.mail_begin;
> +
> +       map_user(mailmap, &mail, &maillen, &name, &namelen);

Would it be useful to check the return value of this function, to display a message when the name can't mapped ?

Show 6 quoted lines
> +       if (namelen)
> +               printf("%.*s <%.*s>%c",
> +                       (int)namelen, name, (int)maillen, mail, term);
> +       else
> +               printf("<%.*s>%c", (int)maillen, mail, term);
> +}
Previous: Duy NguyenNext: Eric Sunshine
Message 6 of 10 in “add git-check-mailmap command”
  1. 0/4 add git-check-mailmap commandEric Sunshine, Jul 10, 2013
  2. 1/4 builtin: add git-check-mailmap commandEric Sunshine, Jul 10, 2013
  3. Duy NguyenJul 11, 2013
  4. Eric SunshineJul 11, 2013
  5. Duy NguyenJul 11, 2013
  6. Antoine PelisseJul 11, 2013
  7. Eric SunshineJul 11, 2013
  8. 2/4 t4203: test check-mailmap command invocationEric Sunshine, Jul 10, 2013
  9. 3/4 t4203: test mailmap functionality directly rather than indirectlyEric Sunshine, Jul 10, 2013
  10. 4/4 t4203: consolidate test-repository setupEric Sunshine, Jul 10, 2013

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.