Skip to content

Keep mailmapped commits visible when filtering by author - #6166

Open
noahfraiture wants to merge 3 commits into
jesseduffield:masterfrom
noahfraiture:fix/mailmap-author-filter
Open

noahfraiture wants to merge 3 commits into
jesseduffield:masterfrom
noahfraiture:fix/mailmap-author-filter

Conversation

@noahfraiture

Copy link
Copy Markdown
Contributor

Bug

When a commit author is corrected by .mailmap, selecting that commit and filtering by its author can leave the commits list empty, excluding the selected commit itself.

To reproduce:

  1. Create a commit as Legacy Name <old@example.com>.
  2. Add Canonical Name <new@example.com> Legacy Name <old@example.com> to .mailmap.
  3. In the Commits panel, select the commit, press s, and choose its author.

Fix

Read the mailmapped author email with Git's %aE format, and use mailmap for author filtering in both normal and reflog commit queries. This keeps the filter aligned with the author identity shown by lazygit, including when log.mailmap=false.

Validation

  • Added an integration test that demonstrates the empty result before the fix and retains the selected commit afterward.
  • env -u NO_COLOR just check passed (unit tests, integration tests, lint, and generated-file check).
  • just build passed.

noahfraiture and others added 3 commits October 30, 2026 09:27
Selecting a commit with a mailmapped identity currently filters that
same commit out of the list. Keep the expected result beside the
observed one so the fix can switch the assertion.

Co-authored-by: GPT-6 <codex@openai.com>
Both log paths need the same treatment of author identities. Put
their shared argument construction in one place before changing how
mailmap affects matching.

Co-authored-by: GPT-6 <codex@openai.com>
The commit list already shows canonical names, but it paired them
with raw email addresses. Git also lets log.mailmap=false disable
canonical author matching. Use the mapped email and ask filtered log
commands to match against the same canonical identity.

Co-authored-by: GPT-6 <codex@openai.com>
@noahfraiture
noahfraiture marked this pull request as ready for review October 30, 2026 17:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant