Skip to content

Show tags in commit history #807

Closed

Description

@freaktechnik

Issuehunt badges

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 dotconnor has been rewarded.

Backers (Total: $65.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Activity

  1. hkdobrev commented on Nov 11, 2017

    @hkdobrev
    Contributor
  2. freaktechnik commented on Nov 11, 2017

    @freaktechnik
    Author

    Yes, and I think a commit already shows the tag as I'd suggest here, so essentially adding that info to the upper level.
    Example: 03fa6b8

  3. hkdobrev commented on Nov 11, 2017

    @hkdobrev
    Contributor

    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!


    Plus you need to know the tag name in to compare, since those are not auto completed by the UI.

    We can probably do that in the compare UI - suggest tags in an autocomplete.

  4. fregante commented on Nov 14, 2017

    @fregante
    Member

    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

  5. fregante commented on Nov 14, 2017

    @fregante
    Member

    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.

  6. hkdobrev commented on Nov 14, 2017

    @hkdobrev
    Contributor

    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.

  7. yakov116 commented on Nov 14, 2017

    @yakov116
    Member

    @hkdobrev I have waaay to much experience with graphQL.

    1. Must be authenticated and cannot be anonymous. (so certain things would not work without a token)
    2. They are always changing stuff.

    I helped @k0shk0sh build FastHub we spent 2 months trying to switch to V4 and we ended up reverting the whole thing.
    If it was me I would wait another 4-5 months. Lately they have been adding many more typical things. IMHO it's worth the wait

  8. hkdobrev commented on Nov 14, 2017

    @hkdobrev
    Contributor

    @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.

  9. sindresorhus commented on Nov 15, 2017

    @sindresorhus
    Member

    👍 I would find this very useful.

  10. yakov116 commented on Jul 12, 2018

    @yakov116
  11. fregante commented on Jul 12, 2018

    @fregante
  12. 3 remaining items

  13. fregante commented on Mar 4, 2019

    @fregante
    Member

    I hope this answers your question.

    Similar features

    Commit 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 pages

    https://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>
    `)
  14. pinned this issue on Mar 4, 2019
  15. unpinned this issue on Mar 4, 2019
  16. IssueHuntBot commented on Apr 11, 2019

    @IssueHuntBot

    @IssueHunt has funded $60.00 to this issue.


  17. fregante commented on Apr 16, 2019

    @fregante
    Member

    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 before/after markers to limit the search to the visible commits:

    # 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 search queries include tags.

  18. obahareth commented on Apr 20, 2019

    @obahareth

    @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
                }
              }
            }
          }
        }
      }
    }

    name is the tag name, the response will look like this:

    {
      "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 before and after values you're using are commit hashes, they should be cursors (that you request and that get returned by the API) instead.

    I hope that helps.

  19. added
    💵 Funded on Issuehunt
    on May 10, 2019
  20. simonkotwicz commented on May 15, 2019

    @simonkotwicz
    Contributor

    Yes, and I think a commit already shows the tag as I'd suggest here, so essentially adding that info to the upper level.
    Example: 03fa6b8

    Seems like tags are only shown for commits that exist in the main/master branch (when looking at a single commit)

  21. issuehunt-oss commented on Aug 17, 2019

    @issuehunt-oss

    @jerone has funded $5.00 to this issue.


  22. issuehunt-oss commented on Oct 28, 2019

    @issuehunt-oss

    @sindresorhus has rewarded $58.50 to @dotconnor. See it on IssueHunt

    • 💰 Total deposit: $65.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $6.50
  23. added and removed
    💵 Funded on Issuehunt
    on Oct 28, 2019
  24. locked as resolved and limited conversation to collaborators on Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions