Skip to content

Scan starting at arbitrary roots #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 22, 2023
Merged

Scan starting at arbitrary roots #110

merged 8 commits into from
Aug 22, 2023

Conversation

mhagger
Copy link
Member

@mhagger mhagger commented Aug 14, 2023

Have you ever wanted to compute git-sizer stats for a particular part of your history, for example a single tree? This PR implements that feature.

git-sizer now allows arbitrary ROOT argument, like

git-sizer main^{tree}

which would show the stats for the whole source tree of the main commit, but for no other commits. If at least one ROOT argument is specified, then the usual behavior of scanning references doesn't happen, unless you also specify options to select references, like

git-sizer --include=refs main@{1}

which would include all references, plus the previous version of branch main (which might give different results if, for example, main just had a non-fast-forward update).

The new ROOT objects will also be used (in the form that they appeared in the command-line) in the names that are shown in the footnotes.

/cc @elhmn, @vtbassmatt

It wasn't used.
This provides a better separation of concerns, which will be taken
advantage of shortly.
We want to add another type of root, so start the virtualization
process.
Instead of only traversing objects starting at references, allow the
user to specify explicit Git objects via the command line. In that
case, the traversal includes objects reachable from those objects.
@mhagger mhagger requested a review from a team as a code owner August 14, 2023 20:42
@vtbassmatt
Copy link

Sweet!

elhmn
elhmn previously approved these changes Aug 16, 2023
Copy link
Contributor

@elhmn elhmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting aside the linter's failures, it looks amazing ! Thank you 🙇‍♂️

@mhagger
Copy link
Member Author

mhagger commented Aug 19, 2023

Putting aside the linter's failures, it looks amazing!

I just pushed a commit to fix the linter problem. @elhmn: if you're OK with the change, feel free to merge this.

@elhmn and I also discussed that this should probably not bother scanning references at all or reporting their counts when run in "explicit-root-only" mode. He's going to take a stab at implementing that change. Feel free to implement it as part of this PR or to merge this one and implement it as part of a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants