GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Don't search/list every single repo reference when explicit references are provided by elhmn · Pull Request #112 · github/git-sizer Conversation
Contributor
Now that we can provide explicit roots to git-sizer, we don't want to look for other references than the one provided.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …s are specified
When explicit roots and reference filters are both provided, we want to make
sure that the optimisation don't kick in. As we still want to iterate
over all references in order to apply the filters.
Here is an example with git-sizer being run with explicit roots and reference filters
```
git-sizer main~20^{tree} main~10^{tree} --tags --branches
```
elhmn
force-pushed
the
elhmn-limit-tree-traversal-to-refs-passed-by-arguments
branch
from
135d97e to
721e353
Compare
We printed out the reference count, even when explicit roots were
provided.
```
git-sizer master~50^{tree} 'HEAD@{1.week.ago}' -v
[TRUNCATED_OUTPUT]
| * References | | |
| * Count | 187 | |
| * Ignored | 187 | |
| | | |
[TRUNCATED_OUTPUT]
```
This is not very useful, as the reference count depends on the list of references
extracted by running `git for-each-ref`.
This commit changes the output to not print the reference count when
explicit roots and no reference filters are provided to git-sizer
The reference count is still displayed when the -j flag is passed to
git-sizer.
```
git-sizer master~50^{tree} 'HEAD@{1.week.ago}' -v -j
[TRUNCATED_OUTPUT]
"reference_count": 15,
"reference_groups": {
"ignored": 15
},
[TRUNCATED_OUTPUT]
```
We don't want to print the reference count for json v1, when explicit
root are not provided git-sizer
elhmn
force-pushed
the
elhmn-limit-tree-traversal-to-refs-passed-by-arguments
branch
from
41cd01a to
d407c86
Compare
mhagger
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aside from the line comments, I noticed that this version of the code emits confusing counts in the "references" progress meter, like: I think that this count should be zero, since no references were scanned. But the progress meter is actually counting roots, not references. So this is misleading. (I know it's "just" a progress meter, but I know that I glance at those numbers all the time and rely on them.) I suggest instead iterating over the references and roots separately, with two separate progress meters, like diff --git a/sizes/graph.go b/sizes/graph.go index 0fb1c8a..2fb1b71 100644 --- a/sizes/graph.go +++ b/sizes/graph.go @@ -269,14 +269,22 @@ func ScanRepositoryUsingGraph( return HistorySize{}, err } + // Process roots in two passes just to make the progress meter + // output more useful: + progressMeter.Start("Processing references: %d") for _, root := range roots { - progressMeter.Inc() if refRoot, ok := root.(ReferenceRoot); ok { + progressMeter.Inc() graph.RegisterReference(refRoot.Reference(), refRoot.Groups()) } + } + progressMeter.Done() + progressMeter.Start("Processing roots: %d") + for _, root := range roots { if root.Walk() { + progressMeter.Inc() graph.pathResolver.RecordName(root.Name(), root.OID()) } }
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of revealing internal details via both
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+143
to
+147
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+33
to
+36
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+25
to
+28
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Comment on lines
+509
to
+522
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach seems to depend on the fact that even though the uninitialized
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersAt least 1 approving review is required to merge this pull request. Uh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |