RiotGamesMinions / thor-scmversion

Thor tasks to manage a VERSION file based on SCM tags
MIT License
58 stars 22 forks source link

Auto version bump does not work for git shallow clones #42

Open mayurva opened 9 years ago

mayurva commented 9 years ago

Hello,

We are experimenting with shallow git clones (depth=1) for our Jenkins builds. We discovered that the auto version bump fails for shallow clones since the commit corresponding to last git tag is not pulled in when cloned with depth=1. Note that we pull in all the tags (git fetch --tags) while cloning, so the tags are available in the local copy.

When we investigated further, we discovered that contained_in_current_branch? method returns false as the branch metadata for the given tag is not present in the shallow copy.

Can you please suggest some alternate ways to bump the version, so that we can still use thor-scmversion with shallow clones?

Thanks, Mayur

capoferro commented 9 years ago

I'd be happy with an alternate implementation of contained_in_current_branch?. The current implementation is not very fast for repos with 1000+ tags. If you find a better way to figure out if a given tag is contained in the current branch, please send it our way.