Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 6

Request for commits "author": null and "committer": null, can't get user login

Trying to request commits ( particulary here https://api.github.com/repositories/162478155/commits) and getting both attributes of list element as null. They are populated inside commit object but there are no login field. I need to have login field to get user avatar. Could you please help and say what am I doing wrong. Tried with app token in header and result is the same.

 

Sample

 

 

  {
    "sha": "022516f9e0187be415857b605fb6c4ecb727a567",
    "node_id": "MDY6Q29tbWl0MTYyNDc4MTU1OjAyMjUxNmY5ZTAxODdiZTQxNTg1N2I2MDVmYjZjNGVjYjcyN2E1Njc=",
    "commit": {
      "author": {
        "name": "Oleg Bakhirev",
        "email": "oleg.bakhirev@jetbrains.com",
        "date": "2019-08-27T16:30:37Z"
      },
      "committer": {
        "name": "Oleg Bakhirev",
        "email": "oleg.bakhirev@jetbrains.com",
        "date": "2019-08-27T16:30:37Z"
      },
      "message": "Add creation of new event by click in the cell",
      "tree": {
        "sha": "b57ff58fe9df21ac6d1a3446c214f67f91f2b0bc",
        "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/git/trees/b57ff58fe9df21ac6d1a3446c214f67f91f2b0bc"
      },
      "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/git/commits/022516f9e0187be415857b605fb6c4ecb727a567",
      "comment_count": 0,
      "verification": {
        "verified": false,
        "reason": "unsigned",
        "signature": null,
        "payload": null
      }
    },
    "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/022516f9e0187be415857b605fb6c4ecb727a567",
    "html_url": "https://github.com/olegbakhirev/due-dates-calendar-widget/commit/022516f9e0187be415857b605fb6c4ecb727a567",
    "comments_url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/022516f9e0187be415857b605fb6c4ecb727a567/comments",
    "author": null,
    "committer": null,
    "parents": [
      {
        "sha": "fc1e89c434fc414830b170193e2faf89d3a5b9bf",
        "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/fc1e89c434fc414830b170193e2faf89d3a5b9bf",
        "html_url": "https://github.com/olegbakhirev/due-dates-calendar-widget/commit/fc1e89c434fc414830b170193e2faf89d3a5b9bf"
      }
    ]
  },
  {
    "sha": "fc1e89c434fc414830b170193e2faf89d3a5b9bf",
    "node_id": "MDY6Q29tbWl0MTYyNDc4MTU1OmZjMWU4OWM0MzRmYzQxNDgzMGIxNzAxOTNlMmZhZjg5ZDNhNWI5YmY=",
    "commit": {
      "author": {
        "name": "Oleg Bakhirev",
        "email": "oleg.bakhirev@jetbrains.com",
        "date": "2019-06-26T14:11:34Z"
      },
      "committer": {
        "name": "Oleg Bakhirev",
        "email": "oleg.bakhirev@jetbrains.com",
        "date": "2019-06-26T14:11:34Z"
      },
      "message": "Add first day of week sync with profile; fix styles",
      "tree": {
        "sha": "a863104f8c2eaf3b121102bf3de2d84f05cea130",
        "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/git/trees/a863104f8c2eaf3b121102bf3de2d84f05cea130"
      },
      "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/git/commits/fc1e89c434fc414830b170193e2faf89d3a5b9bf",
      "comment_count": 0,
      "verification": {
        "verified": false,
        "reason": "unsigned",
        "signature": null,
        "payload": null
      }
    },
    "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/fc1e89c434fc414830b170193e2faf89d3a5b9bf",
    "html_url": "https://github.com/olegbakhirev/due-dates-calendar-widget/commit/fc1e89c434fc414830b170193e2faf89d3a5b9bf",
    "comments_url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/fc1e89c434fc414830b170193e2faf89d3a5b9bf/comments",
    "author": null,
    "committer": null,
    "parents": [
      {
        "sha": "e4f12af99168e9a67e062e4b54aaf3c321430b15",
        "url": "https://api.github.com/repos/olegbakhirev/due-dates-calendar-widget/commits/e4f12af99168e9a67e062e4b54aaf3c321430b15",
        "html_url": "https://github.com/olegbakhirev/due-dates-calendar-widget/commit/e4f12af99168e9a67e062e4b54aaf3c321430b15"
      }
    ]
  },

 

Thanks in advance!

5 Replies
Highlighted
Community Manager
Message 2 of 6

Re: Request for commits "author": null and "committer": null, can't get user log

Commits aren't always associated with a GitHub user. For example, perhaps a friend of mine and I were working on a project together. I have a GitHub account and my friend doesn't. If we both add commits to the repository using our own email addresses and names and then I push the repository to GitHub, my commits will be associated with my GitHub user account but my friends' commits will show up with `author` and `committer` as `null`.

 

I hope that helps!

Highlighted
Copilot Lvl 2
Message 3 of 6

Re: Request for commits "author": null and "committer": null, can't get user log

Hi lee-dohm,

as far as I can figure out, the only case where a person without Github account can have their commits in a Github repo is when the repo was hosted somewhere else, e.g. on an internal server, before the repo was pushed to Github.

If it is possible, could you please elaborate more about other cases where a person without Github account can still have their commits pushed to a Github repo leading to committs with null committer and author fields?

 

Thank you in advance. 

Highlighted
Community Manager
Message 4 of 6

Re: Request for commits "author": null and "committer": null, can't get user log

As I stated, but here's a more explicit sequence of events:

 

  1. I create a repo on GitHub
  2. I clone the repo locally
  3. I add some commits (I have a GitHub account)
  4. My friend adds some commits (my friend does not have a GitHub account)
  5. I add some more commits
  6. I push the contents of the local repo to the GitHub repository

 

All of the commits added in step 4 above would not have an associated GitHub account and the committer and author fields would be `null`.

 

Keep in mind, this is only one possible sequence of events that would create this result. Git is a distributed version control system. This means that all clones of a repository are on equal footing as far as Git is concerned, whether they're local, hosted on GitHub, hosted on some internal server, stored on a flash drive, or backed up to tape. It is true that, by convention, a GitHub-hosted repository is generally considered to be "canonical" or the "central" repository. But there's nothing in Git or GitHub that enforces that. So if you add commits to one clone of a repository, those commits can be pushed to any other copy of that repository.

 

I hope that helps!

Highlighted
Copilot Lvl 2
Message 5 of 6

Re: Request for commits "author": null and "committer": null, can't get user log

Re: Request for commits "author": null and "committer": null, can't get user log
Highlighted
Community Manager
Message 6 of 6

Re: Request for commits "author": null and "committer": null, can't get user log

@MMLLkk123 I'm not sure what you're asking. Can you give some more details including:

 

  1. What exactly you're doing step-by-step
  2. What you expect to happen
  3. What actually happens instead

 

Thanks!