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
Show tags in commit history #807
Comments
Hi @freaktechnik! Thanks for the suggestion! To clarify, you mean pages like this one, correct? |
Yes, and I think a commit already shows the tag as I'd suggest here, so essentially adding that info to the upper level. |
OK, this would be very useful, but I don't think it's really feasible at the moment as we'd need to either perform a HTTP call for every commit on the page (where each could be a huge response we need to parse) or to try to use the API with authentication which we're trying to avoid if possible. This would be very easy for GitHub to add as they already save the tags and PRs related to a commit, but they expose it only on the commit page. I'd suggest contacting GitHub on https://github.com/contact requesting that feature from them. If anyone knows a good approach this, please let us know!
We can probably do that in the compare UI - suggest tags in an autocomplete. |
With the API we could query the repo's refs (paged) and match them to whatever commits are visible on the current page. It probably wouldn't require more than 1-2 extra HTTP requests per commit page, which is fine for me. This is definitely a feature I'd like and use. I don't mind finally seeing API integration, we already even have a GHE API URL helper |
That would still exhaust the GitHub's API limit easily just by moving through commit pages front and back. Caching them would also be a problem by itself. Even if we wanted to add an option for the user to have their own OAuth token, that would not be agreed by @sindresorhus as already dicussessd in #581 (comment). Maybe this could be a real use case for some !?🤷♂️ |
He's ok with the option if it's really needed: #741 (comment) In this case I guess the API would be replaced by fetching https://github.com/avajs/ava/tags But honestly I don't see why be strict with the API at all: it saves bandwidth, GH won't change its structure without warning (it happens if we just parse HTML pages) and it only requires a couple more clicks for the setup, which is done once. |
Either we use API everywhere or nowhere at all
Matching tags with the respective commits by itself would be another problem, requiring to load all tag pages for each commit page visit.
👍 Honestly RG has done enough page scraping already! @sindresorhus WDYT? |
After watching some of the GitHub satellite videos and especially the first keynote, I think it would be best to utilize the API v4 using GraphQL. GitHub's vision is to build the whole github.com on top of the GraphQL API and provide the same tools and platform their developers have to everyone. With this, most modifications to github.com which a browser extension might want to do would be possible and performant over GraphQL calls. However, this is not fully featured yet and I'd recommend waiting or building that in a separate extension for now in order to reduce complexity and maintenance until we have a solid platform to use for many features. |
@hkdobrev I have waaay to much experience with graphQL.
I helped @k0shk0sh build FastHub we spent 2 months trying to switch to V4 and we ended up reverting the whole thing. |
@yakov116 👍 and re the authentication - of course, I think it would be worth the hassle of people needing to configure anything or approve an app or something to use the extension to its fullest extent. |
👍 I would find this very useful. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Bump we now have the token so... |
I'd like to take this, are there any examples I should use as a starting point? |
I hope this answers your question. Similar featuresCommit list: https://github.com/sindresorhus/refined-github/blob/master/source/features/mark-merge-commits-in-list.tsx Multi-query v4 API (if required): https://github.com/sindresorhus/refined-github/blob/master/source/features/pr-branches.tsx Affected pageshttps://github.com/sindresorhus/element-ready/commits/master Also keep in mind that some commits may have multiple tags. For packages that use version commits this would be of dubious utility (as seen in the screenshot) Design// Code for the demo screenshot
document.querySelector('.commit-indicator').insertAdjacentHTML('beforebegin', `
<div class="ml-2">
<svg aria-hidden="true" class="octicon octicon-tag" width="14" height="16"><path d="M6.73 2.73c-0.47-0.47-1.11-0.73-1.77-0.73H2.5C1.13 2 0 3.13 0 4.5v2.47c0 0.66 0.27 1.3 0.73 1.77l6.06 6.06c0.39 0.39 1.02 0.39 1.41 0l4.59-4.59c0.39-0.39 0.39-1.02 0-1.41L6.73 2.73zM1.38 8.09c-0.31-0.3-0.47-0.7-0.47-1.13V4.5c0-0.88 0.72-1.59 1.59-1.59h2.47c0.42 0 0.83 0.16 1.13 0.47l6.14 6.13-4.73 4.73L1.38 8.09z m0.63-4.09h2v2H2V4z"></path></svg>
${document.querySelector('.commit-title').textContent}
</div>
`) |
@IssueHunt has funded $60.00 to this issue.
|
I want to take this, but the API does not show which tags are on a specific commit: https://developer.github.com/v4/object/commit/ This means that the only way to do this seems to be Fetch all tags page by page until they're found. The API doesn't even seem to pickup the # https://developer.github.com/v4/explorer/
query {
repository(owner: "sindresorhus", name: "caprine") {
refs(refPrefix: "refs/tags/", last: 100, after: "77e6951397dab721419bafa90a5d6744310e1e7f", before: "79fa563090f14199b8988722f1c4c4b95069cb59") {
nodes {
name
target {
commitUrl
}
}
}
}
} Neither v3 and v4 |
@bfred-it When I was working on this (but I sadly stopped because I had to move) I was able to get the tags using this query: {
repository(owner: "sindresorhus", name: "element-ready") {
refs(first: 100, refPrefix: "refs/tags/") {
edges {
node {
target {
... on Tag {
name
commitResourcePath
}
}
}
}
}
}
}
{
"data": {
"repository": {
"refs": {
"edges": [
{
"node": {
"target": {
"name": "v0.1.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/f68100c11e5eec3ae45e9fe854691fb694af10c0"
}
}
},
{
"node": {
"target": {
"name": "v0.2.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/95f80a9e26904bd9c30774a40fb83ebed0c56af9"
}
}
},
{
"node": {
"target": {
"name": "v1.0.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/26cf4445a2460a9b1df5b336b018d471e1a10f27"
}
}
},
{
"node": {
"target": {
"name": "v2.0.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/b2d64d08f02ed5c3daa5393caf6ff4d8f25afb78"
}
}
},
{
"node": {
"target": {
"name": "v2.1.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/faf1a61170450015de9b24ea9439fae4250a9bbb"
}
}
},
{
"node": {
"target": {
"name": "v2.2.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/a8652a3facc2ad0a7717f1d773d754dc89834bb7"
}
}
},
{
"node": {
"target": {
"name": "v2.2.1",
"commitResourcePath": "/sindresorhus/element-ready/commit/0ea70435fa5771a7f7637f3525ccf7e4e0063fb9"
}
}
},
{
"node": {
"target": {
"name": "v3.0.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/61003ded56d37ec5a28f9a42258d5b12015e7469"
}
}
},
{
"node": {
"target": {
"name": "v3.1.0",
"commitResourcePath": "/sindresorhus/element-ready/commit/840f1e81102bdf208d0e9ecf2015ea253a64f630"
}
}
}
]
}
}
}
} Also the I hope that helps. |
Seems like tags are only shown for commits that exist in the main/master branch (when looking at a single commit) |
@jerone has funded $5.00 to this issue.
|
@sindresorhus has rewarded $58.50 to @dotconnor. See it on IssueHunt
|
Add a link to a tag that is set on a commit when looking at the commit history. This makes it easier to identify new commits that haven't been released yet, or identify change ranges.
I realize you can use the pull request/diffing UI for that, but that's way more complicated than looking at the history, especially when a tag only includes a few commits. Plus you need to know the tag name in to compare, since those are not auto completed by the UI.
IssueHunt Summary
dotconnor has been rewarded.
Backers (Total: $65.00)
Submitted pull Requests
add-tag-to-commits
featureTips
IssueHunt has been backed by the following sponsors. Become a sponsor
The text was updated successfully, but these errors were encountered: