Provide a way to resolve commit SHA1 from tag refs
See original GitHub issueRight now, resolveRef({ ref: '1.0.0' })
will not return the commit SHA1 associated to the tag 1.0.0
but the object id of the tag.
I need a way to use resolveRef
and retrieve the commit SHA1 if it’s a tag. I think I saw somewhere that this process is called peeling.
Something like this would be awesome:
const tagObjectId = await resolveRef({ ref: '1.0.0' })
const tagCommitId = await resolveRef({ ref: '1.0.0', peelTag: true })
WDYT?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Git Tag list, display commit sha1 hashes - Stack Overflow
To get git tags with the SHA1 hash of the Tag object, you can run: git show-ref --tags. The output will then look...
Read more >How to tag a commit in git? - Tutorialspoint
When we display contents using the cat command it shows a hash value. $ cat .git/refs/tags/v1.1 //view content of the tag file. The...
Read more >Git Refs: What You Need to Know | Atlassian Git Tutorial
The most direct way to reference a commit is via its SHA-1 hash. This acts as the unique ID for each commit. You...
Read more >Git References - Git SCM
When you run commands like git branch <branch> , Git basically runs that update-ref command to add the SHA-1 of the last commit...
Read more >Commits API - GitLab Docs
To create a new branch, also provide either start_branch or start_sha , and ... sha, string, yes, The commit hash or name of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve started working on this! I got the code done, but adding all the tests for 8 new commands is super tedious. 😃
A nice thing about doing it this way is we avoid introducing the term “peel”. AFAICT it’s pretty obscure… being mentioned only briefly once in the user documentation, and referred to 2 times in the technical documentation. It’s never actually defined anywhere except in stack overflow.