My version number looks like 0.1.3 and has two components:
- 0.1 (the tag)
- 3 (commits after tag)
All this information easy to obtain from git describe --tags.
For version 0.1.3 git describe may look like
0.1-3-g53d4dec
All of this works fine, but I'm looking for the number of commits affecting only a given subtree, not the whole repo. I don't want to change the version number if something within examples/ or test/ changed, but I do if something within src/ changed.
Basically, I'm looking for git describe --relative src/ that works along the same lines as git log --relative.