git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kousik Sanagavarapu <five231003@gmail.com>
To: Andy Koppe <andy.koppe@gmail.com>
Cc: Liam Beguin <liambeguin@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] pretty: add '%aA' to show domain-part of email addresses
Date: Fri, 3 Nov 2023 22:50:12 +0530	[thread overview]
Message-ID: <ZUUrzIRe7j_Mu_J6@five231003> (raw)
In-Reply-To: <4e3a5661-cba0-4849-8340-06d8d4094f48@gmail.com>

On Fri, Nov 03, 2023 at 08:22:05AM +0000, Andy Koppe wrote:
> 
> On 27/10/2023 19:40, Kousik Sanagavarapu wrote:
> > So, if we have a domain-name, we grab it, else (the case where we don't
> > have '@') we grab it as-is. Looks good.
> 
> I'm not sure that this is the right way to handle a missing '@' here
> actually, because %al already returns the whole email field in that case,
> which makes sense as the likes of the 'mail' command would interpret it as a
> local username.
>
> And if someone was going to use %al and the new specifier together to format
> the parts of the email field differently, they probably wouldn't want the
> field to appear twice.
> 
> Therefore I think it would be more appropriate to expand to nothing in that
> case. Tools that consume this output would already need to be able to deal
> with the empty case, as it could also happen if there's a single '@' at the
> end of the email field, or if the field is empty.

I originally thought since localpart and the new domainpart are like
counterparts (or are symmetrical, like Peff mentioned), falling back
like in the case of localpart was the correct way here (again, symmetry).

Having read your reasoning though I think it makes sense to not fall back the
same way as localpart (%al) and return empty instead.

This goes in favor of what Liam said in the original commit message of this
feature being used to keep track of commits from different organizations (as
in from GitHub or GitLab) or at least domains that make sense. As, if we
return the whole email (where the email is with no domain-part or '@' is at
the end of the email), the whole purpose of our new feature is lost.

Thanks


  reply	other threads:[~2023-11-03 17:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 23:16 [PATCH 0/2] pretty: add %aA to show domain-part of email addresses Liam Beguin
2023-10-26 23:16 ` [PATCH 1/2] doc: pretty-formats: add missing word Liam Beguin
2023-10-26 23:16 ` [PATCH 2/2] pretty: add '%aA' to show domain-part of email addresses Liam Beguin
2023-10-27 18:40   ` Kousik Sanagavarapu
2023-10-28  0:12     ` Junio C Hamano
2023-10-28  2:13       ` Jeff King
2023-10-28  3:22         ` Liam Beguin
2023-10-28  6:58           ` Andy Koppe
2023-10-28  7:02             ` Andy Koppe
2023-10-30  9:10             ` Jeff King
2023-11-01 19:06               ` Liam Beguin
2023-10-29 23:53         ` Junio C Hamano
2023-11-20 20:21           ` Junio C Hamano
2023-12-10 21:07             ` Liam Beguin
2023-10-28  2:20     ` Liam Beguin
2023-10-28 15:27       ` Oswald Buddenhagen
2023-10-28 21:11         ` Andy Koppe
2023-11-03  8:22     ` Andy Koppe
2023-11-03 17:20       ` Kousik Sanagavarapu [this message]
2023-11-04  1:54       ` Junio C Hamano
2023-11-04  9:51         ` Andy Koppe

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=ZUUrzIRe7j_Mu_J6@five231003 \
    --to=five231003@gmail.com \
    --cc=andy.koppe@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=liambeguin@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.
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).