'Partitions the tags into two lists based on TAG_MATCHER.
One of the lists of tags will be deleted locally (self.__tags_to_delete) so
gradle will use our tag version as the package version during the
build/publish task.
One of the lists will be used to determine the next semantic version
for out tag pattern (self.__filtered_tags).'

def __partition_tags_on_pattern(self):

    tag_ref_result = run_quick('git    -C    {path}    show-ref    --tags'.format(path=self.path), echo=False)
    ref_lines = tag_ref_result.stdout.strip().split('\n')
    hash_tags = [CommitTag(s) for s in ref_lines]
    self.__filtered_tags = [ht for ht in hash_tags if self.TAG_MATCHER.match(ht.tag)]
    self.__tags_to_delete = [ht for ht in hash_tags if (not self.TAG_MATCHER.match(ht.tag))]
