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

Re: [PATCH 2/2] pretty: add '%aA' to show domain-part of email addresses

From
Kousik Sanagavarapu <five231003@gmail.com>
Date
Nov 3, 2023, 17:20 UTC
Message-ID
<ZUUrzIRe7j_Mu_J6@five231003>
In-Reply-To
<4e3a5661-cba0-4849-8340-06d8d4094f48@gmail.com>
On Fri, Nov 03, 2023 at 08:22:05AM +0000, Andy Koppe wrote:
Show 18 quoted lines
> 
> 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
Previous: Andy KoppeNext: Junio C Hamano
Message 19 of 21 in “pretty: add %aA to show domain-part of email addresses”
  1. 0/2 pretty: add %aA to show domain-part of email addressesLiam Beguin, Oct 26, 2023
  2. 1/2 doc: pretty-formats: add missing wordLiam Beguin, Oct 26, 2023
  3. 2/2 pretty: add '%aA' to show domain-part of email addressesLiam Beguin, Oct 26, 2023
  4. Kousik SanagavarapuOct 27, 2023
  5. Junio C HamanoOct 28, 2023
  6. Jeff KingOct 28, 2023
  7. Liam BeguinOct 28, 2023
  8. Andy KoppeOct 28, 2023
  9. Andy KoppeOct 28, 2023
  10. Jeff KingOct 30, 2023
  11. Liam BeguinNov 1, 2023
  12. Junio C HamanoOct 29, 2023
  13. Junio C HamanoNov 20, 2023
  14. Liam BeguinDec 10, 2023
  15. Liam BeguinOct 28, 2023
  16. Oswald BuddenhagenOct 28, 2023
  17. Andy KoppeOct 28, 2023
  18. Andy KoppeNov 3, 2023
  19. Kousik SanagavarapuNov 3, 2023
  20. Junio C HamanoNov 4, 2023
  21. Andy KoppeNov 4, 2023

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.