Reference groups or "refgroups" were introduced in https://github.com/github/git-sizer/pull/84 as a way to limit the references that git-sizer uses as starting points when scanning repository contents. This PR expands on that feature in the following ways:
Allow refgroups to have user-specified names. For example,
Allow refgroups to be nested. Nested refgroups are only matched against references that also match their parent(s).
Allow refgroups to have user-specified names.
Allow refgroups to be used as --include=@REFGROUP and --exclude=@REFGROUP option arguments.
Have git-sizer emit a count of references in each defined refgroup.
Add some more pre-defined refgroups: pulls (refs/pull/**) for GitHub-style pull request references, and changes (refs/changes/**) for Gerrit-style changeset references.
Putting this all together, one could use something like this config:
[refgroup "tags.releases"]
name = Release tags
includeRegexp = refs/tags/v\\d+\\.\\d+(\\.\\d+)?
and run git-sizer the following way to see counts of branches and tags, the latter broken down by release tags and other tags:
Any references that are excluded from the scan entirely are tallied under "Ignored".
I also made the --include and --exclude options more flexible. Aside from the existing --include=PREFIX style, one can now also use --include=/REGEXP/ as a shorter version of --include-regexp=REGEXP and --include=@REFGROUP as an equivalent of --refgroup=REFGROUP. The old-style versions of these options have been deprecated.
This PR is written so that it can be read commit-by-commit. It sprouts from the branch for https://github.com/github/git-sizer/pull/86 because it uses some of the new test features introduced by that PR.
/cc @ttaylorr and @tgummerer as possible reviewers.
Reference groups or "refgroups" were introduced in https://github.com/github/git-sizer/pull/84 as a way to limit the references that
git-sizer
uses as starting points when scanning repository contents. This PR expands on that feature in the following ways:--include=@REFGROUP
and--exclude=@REFGROUP
option arguments.git-sizer
emit a count of references in each defined refgroup.pulls
(refs/pull/**
) for GitHub-style pull request references, andchanges
(refs/changes/**
) for Gerrit-style changeset references.Putting this all together, one could use something like this config:
and run
git-sizer
the following way to see counts of branches and tags, the latter broken down by release tags and other tags:Any references that are excluded from the scan entirely are tallied under "Ignored".
I also made the
--include
and--exclude
options more flexible. Aside from the existing--include=PREFIX
style, one can now also use--include=/REGEXP/
as a shorter version of--include-regexp=REGEXP
and--include=@REFGROUP
as an equivalent of--refgroup=REFGROUP
. The old-style versions of these options have been deprecated.This PR is written so that it can be read commit-by-commit. It sprouts from the branch for https://github.com/github/git-sizer/pull/86 because it uses some of the new test features introduced by that PR.
/cc @ttaylorr and @tgummerer as possible reviewers.