Skip to content

User misattributed in CHANGELOG using @changesets/changelog-github #2272

Closed
bombshell-dev/tty
#125

Description

@delucis

I just noticed a changeset being misattributed to the wrong user in a recent release.

Here’s the release PR: withastro/starlight#4161 (I manually edited to correct the issue)

It included the following (in PR description and the generated CHANGELOG file):

However, the second of these changesets belongs to a different PR, commit SHA and user.

Our changesets config file: https://github.com/withastro/starlight/blob/a0e0ba263c93bab214222b798b52a759fb799ba7/.changeset/config.json#L1-L16

And versions in use:

    "@changesets/changelog-github": "^1.0.0",
    "@changesets/cli": "^3.0.1",

Thanks as always for working on Changesets 💙

Activity

  1. trueberryless commented on Aug 28, 2026

    @trueberryless
  2. added theissue type on Aug 29, 2026
  3. trueberryless commented on Aug 29, 2026

    @trueberryless
    Contributor

    Thanks for the report, Chris!

    I found out that the issue is the --follow parameter of the git log command, which was added in this PR to improve commit lookups when the changeset file was renamed. The --follow option tells git to keep iterating upwards over the commit tree if it considers the file changes in a commit as a rename or copy of a previous commit.

    Detailed explanation of what happened in that Starlight example

    Here is what happened in that special Starlight case (and it is kinda funny IMHO): The two changeset files in question are very similar in content -- only the icon key is different. Coincidentally, the file names olive-donuts-repeat.md (hypothesis) and open-planets-tap.md (npmx) are also kinda similar 😆

    Now hear me out: When @changeset/git's getCommitsThatAddFiles function ran these git commands:

    • git log --diff-filter=A --follow --max-count=1 --pretty=format:%H:%p -- .changeset/olive-donuts-repeat.md
    • git log --diff-filter=A --follow --max-count=1 --pretty=format:%H:%p -- .changeset/open-planets-tap.md

    git interpreted the HEAD commit as a rename of the parent commit, which lead to the wrong association:

    $ git log --oneline
    a0e0ba26 (HEAD) feat: add npmx icon (#\4159)
    57af92d9 Add Hypothesis icon (#\4156)
    
    // `hypothesis`
    $ git log --diff-filter=A --follow --max-count=1 --pretty=format:%H:%p -- .changeset/olive-donuts-repeat.md
    57af92d91f9a9d0936a06efb4387898aded62aa9:88442c33
    
    // `npmx` -- should point to `a0e0ba263c93bab214222b798b52a759fb799ba7:57af92d9` instead
    $ git log --diff-filter=A --follow --max-count=1 --pretty=format:%H:%p -- .changeset/open-planets-tap.md
    57af92d91f9a9d0936a06efb4387898aded62aa9:88442c33

    Removing the --follow parameter means that git does not track renames/copies, which results in the correct lookups:

    // `hypothesis`
    $ git log --diff-filter=A --max-count=1 --pretty=format:%H:%p -- .changeset/olive-donuts-repeat.md
    57af92d91f9a9d0936a06efb4387898aded62aa9:88442c33
    
    // `npmx`
    $ git log --diff-filter=A --max-count=1 --pretty=format:%H:%p -- .changeset/open-planets-tap.md
    a0e0ba263c93bab214222b798b52a759fb799ba7:57af92d9

    [!NOTE]
    I added some escape characters to the git outputs to prevent linking to non-existent PRs in this repo.
    Additionally, I included the -- separator in the git log commands before the file name, which is also missing in the code.

    Now the question is: Do we simply remove the --follow option to fix the issue and remove the "rename tracking" feature that it added. Or should we add the --find-renames=100% option to only follow commits if the content stayed 100% the same?

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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions