GitHub v3 API isn't able to get commits for a user after their username changed, while it does work on the GitHub UI

When I go to, I get 0 results even though I have made commits to that repo with the same account but back when my username was different. However, I’m still able to get the results for it from the UI -
So GitHub does have the data, but due to some bug in the REST API it isn’t able to show the results correctly.
Note that I even tried running the GitHub API query with ?author=$my_old_username, which was ?author=coldk91ght and I still get an empty response.

That’s an interesting problem. The bug is not just a consequence of your username changing – old commits can be looked up by a new username – but rather a consequence of your email address changing.

The commits were created without a public email address, so GitHub used the GitHub noreply email address associated with your account – – for the commit author details, however, because your username has changed this is no longer your account’s email address… so GitHub can no longer associate these commits with your account.

(You can find the email options in your settings, “Keep my email addresses private”)

I believe the bug can be described as: If you have your email address hidden, and you change your username, then old commits are not associated with the new username because the resolution logic looks for a current email address (verified + private). I think the fix would be for the email lookup portion of author resolution to ignore the +username part of the private email address (presumably, the frontend has this extra step in the logic).


That’s my guess, anyway :slight_smile:

What you’re saying makes sense. But it doesn’t explain why even searching with the private email does not work. Something like -