jgitver
jgitver copied to clipboard
Declarative support for `git namespaces`
The git namespaces feature is a tool that allows to drive scoped semantic versions in the same repository. For example, it is useful if you have experimental R&D versions, specialized client versions and a main line.
In a namespace and branches and tags are scoped with an automatic prefix. This means that if you declare GIT_NAMESPACE=foo/bar it feels like you are working on origin/master when actually you are on (and pushing to) refs/namespaces/foo/refs/namespaces/bar/origin/master. It is a bit like the chroot jail of a container.
The use of namespaces can be managed in jgitver using explicitly constructed pattern regexes for the base version. However, given that this is a nice declarative feature, it would be great if you could just tell jgitver: jgitver.namespace="/experiments/parallelized-search" and it would construct the search regex for this namespace.
Alternatively, this could be implemented at the level of jgit, but I have not found any API switches that perform the local scoping. If these exist, jgitver could simply set the namespace to jgit and continues as is.
jgitver would behave in the same way it always does, returning a simple version string.
Alternatively, jgitver could allow to map the namespace meta into the formatting of the version.
if there is so support in jgit then I think that we are stuck.