Skip to content

Add multi rev support for function describe  #144

@karajan1001

Description

@karajan1001

In our current describe function we only accept one rev at a time and will try to get a reference for every reference in the repo. It will cost O(MN) in exp show in which we try to get a ref for every single experiment.

def _describe(
self,
rev: str,
base: Optional[str] = None,
match: Optional[str] = None,
exclude: Optional[str] = None,
) -> Optional[str]:
if not base:
base = "refs/tags"
for ref in self.iter_refs(base=base):
if (match and not fnmatch.fnmatch(ref, match)) or (
exclude and fnmatch.fnmatch(ref, exclude)
):
continue
if self.get_ref(ref, follow=False) == rev:
return ref

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions