0

I have few tags with the following patterns in chronological order:

0.0.3.156-alpha+2
0.0.3.154
0.0.3.153
build-.139
build-.140
build-.142
build-0.0.1.28
build-0.0.1.29

I need to get the latest tag that match the pattern number.number.number.number hence 0.0.3.154 in this case. The git command git descrive --match=<pattern> will find the latest tag that matches that pattern. But since here is a glob (see here) and not a regex.

Could you show me the correct glob pattern to match the above?

hydradon
  • 1,316
  • 1
  • 21
  • 52

1 Answers1

0

Try git describe --tags --match "[0-1000].[0-1000].[0-1000]*" and if you want to delete the last part use -cut ...

Thibaut
  • 9
  • 1
  • Can you be more precise about what the OP should do? – Nico Haase Jan 11 '18 at 10:11
  • 1
    Thats not how it works, [0-1000] would match "0" to "1" or "0" or "0" or" 0 (yes it is a redundant pattern). [0-456] would match "0" to "4" or "5" or "6" – Otzen Nov 27 '20 at 13:28