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

[PATCH v2 0/5] Hashed mailmap

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jan 3, 2021, 21:18 UTC
Message-ID
<20210103211849.2691287-1-sandals@crustytoothpaste.net>

Many people, through the course of their lives, will change either a name or an email address. For this reason, we have the mailmap, to map from a user's former name or email address to their current, canonical forms. Normally, this works well as it is.

However, sometimes people change a name (or an email) and want to completely cease use of the former name or email. This could be because a transgender person has transitioned, because a person has left an abusive partner or broken ties with an abusive family member, or for any other number of good and valuable reasons. In these cases, placing the former name in the .mailmap may be undesirable.

For those situations, let's introduce a hashed mailmap, where the user's former name or email address can be in the form @sha256:<hash>. This obscures the former name or email.

In the course of experimenting with some solutions for v2, I noticed that our mailmap support has a bunch of problems with case sensitivity. Notably, it treats local-parts of email addresses in a case-insensitive way, when the RFC specifically says that they are case sensitive, and we also treat names case insensitively, but only for ASCII characters. Both of those have been fixed here, and the commit messages explain in lurid detail why, while incompatible, this is the correct behavior.

I've also added some performance numbers and explained some alternate solutions in the commit message for the final patch. That's in addition to the performance improvements I've done so that the feature is both cheaper for users and nearly invisible for non-users. That isn't quite the same as adding a perf test, which I haven't done, but I think this explains the situation quite well. If folks are still dying for a perf test, I can add one in v3.

I will point out that fully hashing a mailmap isn't necessarily cheap, but how expensive it is depends on the weighting of current and former members of the project. As mentioned in the original thread, I think a hash rather than an encoding is the right choice here. It is likely that in a few iterations of hardware, all users will have accelerated SHA-256 and the cost will end up being a handful of cycles per name overall.

Changes from v1:
* Fix case-sensitivity problems in the mailmap.
* Add documentation.
* Add explanation of how to compute the value.
* Add some optimizations to improve performance.
* Improve commit message to discuss performance numbers and explain
  rationale better.
brian m. carlson (5):
  mailmap: add a function to inspect the number of entries
  mailmap: switch to opaque struct
  t4203: add failing test for case-sensitive local-parts and names
  mailmap: use case-sensitive comparisons for local-parts and names
  mailmap: support hashed entries in mailmaps
 Documentation/mailmap.txt |  28 ++++++++
 builtin/blame.c           |   2 +-
 builtin/check-mailmap.c   |   4 +-
 builtin/commit.c          |   2 +-
 mailmap.c                 | 139 +++++++++++++++++++++++++++++++++-----
 mailmap.h                 |  15 ++--
 pretty.c                  |   4 +-
 pretty.h                  |   2 +-
 revision.c                |   2 +-
 revision.h                |   3 +-
 shortlog.h                |   3 +-
 t/t4203-mailmap.sh        |  64 +++++++++++++++++-
 12 files changed, 236 insertions(+), 32 deletions(-)
Next: brian m. carlson
Message 1 of 19 in “Hashed mailmap”
  1. 0/5 Hashed mailmapbrian m. carlson, Jan 3, 2021
  2. 1/5 mailmap: add a function to inspect the number of entriesbrian m. carlson, Jan 3, 2021
  3. Ævar Arnfjörð BjarmasonJan 4, 2021
  4. René ScharfeJan 4, 2021
  5. 2/5 mailmap: switch to opaque structbrian m. carlson, Jan 3, 2021
  6. Ævar Arnfjörð BjarmasonJan 4, 2021
  7. 3/5 t4203: add failing test for case-sensitive local-parts and namesbrian m. carlson, Jan 3, 2021
  8. 4/5 mailmap: use case-sensitive comparisons for local-parts and namesbrian m. carlson, Jan 3, 2021
  9. Ævar Arnfjörð BjarmasonJan 4, 2021
  10. Junio C HamanoJan 6, 2021
  11. Ævar Arnfjörð BjarmasonJan 12, 2021
  12. 5/5 mailmap: support hashed entries in mailmapsbrian m. carlson, Jan 3, 2021
  13. Ævar Arnfjörð BjarmasonJan 5, 2021
  14. brian m. carlsonJan 6, 2021
  15. Ævar Arnfjörð BjarmasonJan 10, 2021
  16. brian m. carlsonJan 10, 2021
  17. Junio C HamanoJan 5, 2021
  18. brian m. carlsonJan 6, 2021
  19. Junio C HamanoJan 6, 2021

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.