Skip to content

Invalid "Ignoring redundant source references" warnings for git sources

When using a git source and ref-storage == project.refs, we get unconditional invalid warnings for all git sources.

This is because of commit 82513109:

    git source plugin: Track git tags and save them to reproduce a minimum shallow repository
    
    Instead of tag information being fetched which can change with time,
    they are tracked and saved in the projects.refs/.bst. Then we re-tag
    automatically the closest tag so that `git describe` works and is
    reproducible.
    
    This new feature is opt-in with the new `track-tags` configuration,
    and must be used to fix modules which are broken by our new policy
    of omitting the `.git/` repository when staging git sources.
    
    This fixes issue #487

Which does not respect the rule about returning None values from Source.get_ref() when there is no ref set, as clearly stated in the docs:

    def get_ref(self):
        """Fetch the internal ref, however it is represented

        Returns:
           (simple object): The internal source reference, or ``None``

        .. note::

           The reference is the user provided (or track resolved) value
           the plugin uses to represent a specific input, like a commit
           in a VCS or a tarball's checksum. Usually the reference is a string,
           but the plugin may choose to represent it with a tuple or such.

           Implementations *must* return a ``None`` value in the case that
           the ref was not loaded. E.g. a ``(None, None)`` tuple is not acceptable.
        """
        raise ImplError("Source plugin '{}' does not implement get_ref()".format(self.get_kind()))

The result is that the core does not correctly recognize unset refs loaded from git sources and issues a warning.

This happens only on master and not in bst-1.2

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information