Skip to content

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.

5 participants