Philip Oakley
Philip Oakley

Reputation: 14071

describe a commit relative to a tag in parent^/ancestor~ format

I'm looking to describe a particular commit relative to a more recent tag using the parent^ and ancestor generation~ format shown in specifying revisions section of git-rev-parse.

Is there a simple command for obtaining this format?

Upvotes: 4

Views: 390

Answers (1)

Philip Oakley
Philip Oakley

Reputation: 14071

After more googling found git name-rev --tags --name-only <my-commit-ID> did the trick. This is much better at indicating the commit is in the project than 'git describe` which can give false hope.

Found on A few git tips you didn't know about, By Mislav Marohnic


git describe --contains <my-commit-ID> also does the trick as described by jszakmeister

Upvotes: 4

Related Questions