question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a way to resolve commit SHA1 from tag refs

See original GitHub issue

Right 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:open
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
wmhiltoncommented, Mar 26, 2019

I’ve started working on this! I got the code done, but adding all the tests for 8 new commands is super tedious. 😃

2reactions
wmhiltoncommented, Oct 13, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found