Closed yajo closed 3 years ago
Curious: how come does git ouputs a v
prefix on your side?
% git describe --tags --always HEAD
0.10.4-10-gbe3849d
EDIT: ah, it's obviously because your latest tag is v3.0.0 and mine is 0.10.4.
Since your version format includes the commit hash, you could do this:
$ echo 3.0.0.post3.dev0+d929b5a | awk -F+ '{print $NF}'
d929b5a
$ echo 3.0.1 | awk -F+ '{print $NF}'
3.0.1
Because of the ability to set a custom --pattern
and --format
, it would be hard for a to
command to work generically. But using the above, you would just need some custom logic to say, if there's no +
in the input, then adjust the output so it matches your tag pattern (e.g., add a v
prefix).
Hmm I see. I was expecting to use this lib to somehow be able to undo that, but indeed it's technically quite difficult.
Just the v
stuff in itself is a problem. Git is able to let you tag v1.0
and 1.0
separately on different commits, because a tag is just a string for git, but that'd be probably confusing dunamai.
Well, in any case now I know how to proceed to fix my problem. Thanks everybody!
So I'm in a repo and I do this:
Cool!
However, would there be any way to obtain the VCS ref that I can checkout based on that version? Like a
to
command:That ref is something git understands and that I can pass to
git checkout
. Actually you can use git to get it:Note: this example is obtained while using this repo and commit, in case it helps: https://github.com/Tecnativa/doodba-copier-template/commit/d929b5a4edccb8bc46552229553aad84a41b6bda