Skip to content

useGpgSignerAuthor keeps the OpenPGP UID comment in the author name #61

Closed

Description

@Shinrai

Problem

With useGpgSignerAuthor (--use-gpg-signer-author), detectGitAuthor() (src/utils/git.mjs) reads the last commit's signer with git log -1 --format=%GS and parses it with parseSignerUid(). An OpenPGP user ID has the form Name (Comment) <email>, and the parser keeps the comment as part of the name:

signer UID:  Nate Corcoran (2023 PC) <[email protected]>
@Author:     Nate Corcoran (2023 PC) <CLDMV>        ← with --company CLDMV
expected:    Nate Corcoran <CLDMV>

Existing CLDMV headers use Nate Corcoran <CLDMV>, so the option can't be used to keep new headers consistent with them. Without the option, the author comes from git config user.name (Shinrai).

Fix

  • parseSignerUid() strips an OpenPGP UID comment, the parenthesised part before <email>, from the name. Nested or escaped parentheses in the comment are handled per RFC 4880's user ID convention.
  • A UID with no comment, no email or no name still parses as it does today.
  • Tests: a UID with a comment, without a comment, email only, name only, a parenthesis inside the name, an empty signer (unsigned commit falls back to user.name and then the log author), and --company suffixing on top.

Context

This came up while planning to roll fix-headers out to every CLDMV v4 repo. The rollout config will use useGpgSignerAuthor: true plus company: "CLDMV", so new files match the existing @Author: Nate Corcoran <CLDMV> headers.

Activity

  1. added theissue type on Sep 28, 2026
  2. added
    type: bug
    priority: high
    semver: patch
    area: core
    status: in progress
    status: implemented
    and removed
    status: in progress
    on Sep 28, 2026
  3. Shinrai commented on Sep 28, 2026

    @Shinrai
    ContributorAuthor

    Merged into next via #62 (437a798): parseSignerUid() drops the OpenPGP UID comment, so a signer of Nate Corcoran (2023 PC) <…> with --company CLDMV now gives @Author: Nate Corcoran <CLDMV>. Ships in v1.4.0 (release PR #47); this issue closes when that release lands on master.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corepriority: highsemver: patchstatus: implementedtype: bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions