Skip to content
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

Git blame avatars for everyone #11043

Open
2 of 11 tasks
WeetHet opened this issue Apr 26, 2024 · 3 comments
Open
2 of 11 tasks

Git blame avatars for everyone #11043

WeetHet opened this issue Apr 26, 2024 · 3 comments
Labels
enhancement [core label] git blame git Git integration feedback

Comments

@WeetHet
Copy link
Contributor

WeetHet commented Apr 26, 2024

Currently, only GitHub avatars are supported in git blame. Other hostings should be supported as well.

Avatar support

  • GitHub
  • GitLab (main instance)
  • Gitee
  • Bitbucket
  • Sourcehut
  • Codeberg (Add avatar support for codeberg in git blame #10991)
  • Self-hosted instances of GitLab
  • Self-hosted instances of Gitea
  • Self-hosted instances of Forjejo
  • Self-hosted instances of Sourcehut
  • Anything else with an API

Questions

  • Should this be an API for extensions?
  • Should we make a Commit/Author/User/... struct for each hosting separately or extract them?
    For now I've extracted the Author struct as it's the only one that is built by hand and not deserialised from the response.
@WeetHet WeetHet added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Apr 26, 2024
@WeetHet WeetHet changed the title Avatars in git blame for everyone Git blame avatars for everyone Apr 26, 2024
@mrnugget
Copy link
Member

  • Should this be an API for extensions?

I think for now it's fine to keep it in there, since it's similar to the permalinks behavior we have.

  • Should we make a Commit/Author/User/... struct for each hosting separately or extract them?
    For now I've extracted the Author struct as it's the only one that is built by hand and not deserialised from the response.

I don't think we need more than a URL right now. Once we need more, we can add more.

@JosephTLyons JosephTLyons added git Git integration feedback git blame and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 26, 2024
@WeetHet
Copy link
Contributor Author

WeetHet commented Apr 28, 2024

  • Should this be an API for extensions?

I think for now it's fine to keep it in there, since it's similar to the permalinks behavior we have.

  • Should we make a Commit/Author/User/... struct for each hosting separately or extract them?
    For now I've extracted the Author struct as it's the only one that is built by hand and not deserialised from the response.

I don't think we need more than a URL right now. Once we need more, we can add more.

Okay, I'll undraft the PR and we'll go from there

@d1y
Copy link
Contributor

d1y commented Apr 30, 2024

The Gitee host need access_token after you can send request fetch avatar
So the user may need to fill it in manually, this is a setting item 🤔

API: https://gitee.com/api/v5/swagger#/getV5ReposOwnerRepoCommitsSha

function createURL(owner: string, repo: string, sha: string, token: string) {
  return `https://gitee.com/api/v5/repos/${owner}/${repo}/commits/${sha}?access_token=${token}`
}

const token = Bun.env["ACCESS_TOKEN"]!

const url = createURL('libkitten', 'zed', 'f72cf2afe34f77bf498454cd5486aa2c31b820d6', token)

console.log(url)

// export ACCESS_TOKEN=$$$
// bun run run.ts | xargs curl | jless

Avatar is author.avatar_url

At present, it seems that it does not support setting the image size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] git blame git Git integration feedback
Projects
None yet
Development

No branches or pull requests

4 participants