git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Emma Brooks <me@pluvano.com>
Cc: "Git List" <git@vger.kernel.org>, "Jakub Narębski" <jnareb@gmail.com>
Subject: Re: [PATCH v2] gitweb: map names/emails with mailmap
Date: Mon, 10 Aug 2020 01:41:27 -0400	[thread overview]
Message-ID: <CAPig+cT2dFLHp6YhUmD7SeGBy3u1mQMhTTCefRzSfz3sTC0OhA@mail.gmail.com> (raw)
In-Reply-To: <20200810031123.GA3565@pluvano.com>

On Sun, Aug 9, 2020 at 11:12 PM Emma Brooks <me@pluvano.com> wrote:
> On 2020-08-09 20:49:59-0400, Eric Sunshine wrote:
> > On Sun, Aug 9, 2020 at 7:06 PM Emma Brooks <me@pluvano.com> wrote:
> > > +mailmap::
> >
> > Is this setting global or per-repository? (I ask because documentation
> > for other options in this section document whether they can be set
> > per-repository.)
>
> Global. I'll add a note that it cannot be set per-project, or I could
> add support for setting it per-project if that's wanted.

If it's not much extra work, it might make sense to support
per-project, if for no other reason, to be consistent with other
nearby options.

> > Should there be any sort of support for functionality similar to the
> > "mailmap.file" and "mailmap.blob" configuration options in Git itself?
> > (Genuine question, not a demand for you to implement such support.)
>
> Yes, that would be useful and should probably be supported.

I don't insist upon it. It can always be added later if someone needs
it. I was asking about it now because it might have an affect on the
design or type of value which the 'mailmap' option you added above can
accept, and I was concerned about getting locked into a design without
taking these other possibilities into account. For instance, rather
than being a simple boolean, perhaps the 'mailmap' option you added
could be more expressive, eventually allowing support for an explicit
file or blob. This is another reason why I asked if 'mailmap' can be
per-project, since an explicit mailmap file, and especially a blob,
would belong to a particular project. It's just something to think
about. (Then again, I'm not a gitweb user, nor am I familiar with its
configuration, so take my observations with a grain of salt.)

> > > +       open my $fd, '-|', quote_command(
> > > +               git_cmd(), 'cat-file', 'blob', 'HEAD:.mailmap') . ' 2> /dev/null'
> > > +               or die_error(500, 'Failed to read mailmap');
> >
> > Am I reading this correctly that this will die if the project does not
> > have a .mailmap file? If so, that seems like harsh behavior since
> > there are many projects in the wild lacking a .mailmap file.
>
> No, this error message is misleading. The die_error is called if there
> is a problem executing git cat-file, but not if cat-file returns an
> error. I'll revise this message to be more accurate.

Okay, that makes sense.

> > > +       return \%mailmap if eof $fd;
> > > +       foreach (split '\n', <$fd>) {
> >
> > If the .mailmap has no content, then the 'foreach' loop won't be
> > entered, which means the early 'return' above it is unneeded, correct?
> > (Not necessarily asking for the early 'return' to be removed, but more
> > a case of checking that I'm understanding the logic.)
>
> The early return is intended to catch when there is no mailmap, so $fd
> does not get initialized. Without it, you would get an error when you
> try to split $fd's content:
>
>     Use of uninitialized value $fd in split at [the foreach]

Right. This follows from my misunderstanding what happened if .mailmap
was missing.

  reply	other threads:[~2020-08-10  5:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  4:12 [RFC PATCH] gitweb: Map names/emails with mailmap Emma Brooks
2020-07-30 16:20 ` Junio C Hamano
2020-07-31  1:01 ` Jeff King
2020-07-31  2:10   ` Junio C Hamano
2020-08-08 21:34 ` [PATCH] " Emma Brooks
2020-08-09 23:04   ` [PATCH v2] gitweb: map " Emma Brooks
2020-08-10  0:49     ` Eric Sunshine
2020-08-10  3:12       ` Emma Brooks
2020-08-10  5:41         ` Eric Sunshine [this message]
2020-08-10 10:02     ` Jeff King
2020-08-11  4:17       ` Emma Brooks
2020-08-11  4:48         ` Eric Sunshine
2020-08-11  4:55         ` Jeff King
2020-09-05  2:55           ` Emma Brooks
2020-09-05  3:26             ` Junio C Hamano
2020-09-07 22:10               ` Emma Brooks
2020-08-11  6:17         ` Eric Wong
2020-08-11  6:33           ` Joe Perches

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAPig+cT2dFLHp6YhUmD7SeGBy3u1mQMhTTCefRzSfz3sTC0OhA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=me@pluvano.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).