gitgo-gitgit-describe

cheapest way to describe a git hash


I need to get the same result of git describe <hash> for remote repository. For example, given the hash d96edbcf, I want to get something like v0.54.0-1-gd96edbcf

I need to this for multiple repos, so I'm looking for an efficient way to do this without having to check out the whole repo each time.

Fetching the hash does't work as then git describe <hash> says No names found, cannot describe anything


Solution

  • If you just need metadata analysis, fetch just the metadata. That'll cut out almost all the fetch traffic. Add --bare --filter=tree:0 to your clone, and if you know a tip that will have that hash add --single-branch $tip to skip stuff you know is irrelevant.