I'm using tags to identify release versions and to identify "development complete" commits for tasks. Doing a git tag
I get a list like the following.
> git tag
v0.1.0
task_1768
task_2011
task_1790
task_1341
v0.1.1
task_2043
task_2311
v0.1.2
Assuming that all tags point to commits on master
branch, is there a way to list all tags since some tag? For example, to generate a list of all tasks included in the v0.1.2
release -- I'm looking for something like the following (which is not an actual command).
> git tag -l "task_*" --since v0.1.1
To get output like the following.
task_2043
task_2311
Is there a way to do this with git tag
?
Is there a way to do this with git rev-list
?
(Or some other git command?)
Based on the answers and comments the following is what I'm currently using.
> git log v0.1.1.. --decorate | grep -Eow 'tag: ([a-zA-Z0-9.-_]*)' | awk '{ print substr($0, 6); }'
task_2043
task_2311
v0.1.2
> git log v0.1.1.. --decorate | grep -Eow 'tag: ([a-zA-Z0-9.-_]*)' | awk '{ print substr($0, 6); }' | grep -Eo 'task_.*'
task_2043
task_2311
New selected answer. This is exactly what I was looking for initially. Much more elegant.
> git tag --contains v0.1.1
v0.1.1
task_2043
task_2311
v0.1.2
> git tag --contains v0.1.1 | grep -Eo 'task_.*'
task_2043
task_2311
git tag --contains v0.1.1
will show you all tags that contain the given tag -- i.e. tags from which you can trace back in history and reach the given tag.
you can provide a range for git log
:
git log v1.1.0..
now you add the --decorate
option which will list tags. There are other options you can add to log to limit the list to just the interesting ones or grep it for "tag":
git log v1.1.0.. --decorate | grep 'tag:'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With