3 ms·
Git already has an ordering like this built in as ‘git describe’. https://git-scm.com/docs/git-describe https://git-scm.com/docs/git-describe $ git descri
by anderskaseorg 4y ago
Git already has an ordering like this built in as ‘git describe’.
https://git-scm.com/docs/git-describe https://git-scm.com/docs/git-describe
$ git describe 593a2a5d0639b4b4f91ff6e6ffb64e72020f8fd8
v2.34.1-83-g593a2a5d06
This commit is 83 commits after the v2.34.1 tag. Git accepts this identifier anywhere it would accept a commit hash, e.g.:
$ git log v2.34.1-83-g593a2a5d06
$ git show v2.34.1-83-g593a2a5d06:branch.c
https://git.kernel.org/pub/scm/git/git.git/commit/?id=v2.34.1-83-g593a2a5d06 https://git.kernel.org/pub/scm/git/git.git/commit/?id=v2.34....
- cerved 4y agothey want a global, presumably centralized, order
- Too 4y agoDescribe works it’s way backwards to find a tag matching the search pattern. If you are checked out on origin/master and the tags come from the same centralized origin, then you will have a predictable global order. It’s basically the same thing as rev-list that they do, except more readable, with tighter integration to tags and with the result usable as a commitish.
- jamesfinlayson 4y agoNeat - I periodically see those incremental ids show up in places but didn't realised they worked like commit ids. But I'm not surprised.
- iam-TJ 4y agoFor all the interesting ways to name an object, see [0]: man 7 gitrevisions and for this particular naming "describeOutput" [0] https://manpages.debian.org/bullseye/git-man/gitrevisions.7.en.html https://manpages.debian.org/bullseye/git-man/gitrevisions.7....