-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add committer/author data to the remote context #949
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Hello 👋 thanks for reporting this! Unfortunately GitHub API does not directly expose the realnames: "author": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}, But instead, you can probably use the committer or author data which belong to the "commit": {
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"author": {
"name": "Monalisa Octocat",
"email": "[email protected]",
"date": "2011-04-14T16:00:49Z"
},
"committer": {
"name": "Monalisa Octocat",
"email": "[email protected]",
"date": "2011-04-14T16:00:49Z"
},
} In
|
I need the expansion for the contributor list, I don't think there is a commit available when you are looping over them right?
The script I am currently using queries the "name" through the Github API: github-username-expander.py.txt |
Ah I see. In that case it is currently not possible to use the author or committer information. Would making |
Not sure, is that usable per contributor? I.e. how could this template be adjusted:
Be adjusted to generate the Contributors list at the end of the following release notes? https://github.com/tim-janik/jj-fzf/releases/tag/v0.23.0 |
Yeah, I'm thinking of making the following use case possible:
I'm not sure about the naming though. What do you think? |
Depends on the origin of the data.
If this is meant to work across remotes, it could be better to keep it more generic and then allow fallbacks. |
Hmm, I'm actually thinking of just mapping the values from available remotes instead of sending separate requests for each one, e.g. this endpoint for GitHub. I'm not sure about the rest of the remotes. I updated the title of the issue accordingly. |
Is there an existing issue or pull request for this?
Feature description
I am currently using a rather crude adhoc script to expand Github user names like @some-github-user-handle into "John Doe (@some-github-user-handle)". It would be nice if the Github backend could supply a
remote.realname
field next toremote.username
.Desired solution
Enrich the github remote record with
remote.realname
.Alternatives considered
A post-processor that expands user names can come close, but having
remote.realname
available in the templates would be preferable. The post processor solution looks like this:The script is attached as github-username-expander.py.txt, just remove the
.txt
and make it executable.Additional context
No response
The text was updated successfully, but these errors were encountered: