-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: always prune on git fetch (#10664) #10761
fix: always prune on git fetch (#10664) #10761
Conversation
2d77f26
to
cbb40db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ADustyOldMuffin do you think you can design a unit test to demonstrate that this change works? Might be able to use a local directory as the "remote" for a git repo.
I can add more tests if needed, I was hoping these tests added with the previous change would cover this change as well to ensure we're also still fixing the previous issue. After looking at them I can add some extra tests/validation to ensure we're cleaning up old branches possibly. |
cbb40db
to
d7b066d
Compare
Yeah, I woulda hoped those tests would have caught this as well. But they must be insufficient, since you're still hitting the |
I took a second look and I don't believe those tests actually covered anything since the fetch is being ran in the same local repo. I'll write some tests that add a local remote and actually attempt to fetch. Our issue stemmed from the same issue being tested. |
Codecov ReportBase: 45.66% // Head: 45.64% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #10761 +/- ##
==========================================
- Coverage 45.66% 45.64% -0.02%
==========================================
Files 236 236
Lines 28690 28695 +5
==========================================
- Hits 13102 13099 -3
- Misses 13794 13803 +9
+ Partials 1794 1793 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This should clean up any old branches and save on disk space, and fix any errors around bad branch names. Signed-off-by: Daniel Hix <danieljacobhix@gmail.com>
d7b066d
to
016c172
Compare
@crenshaw-dev I removed the prune and walked through the tests and it throws the same error we had in the issue, but ours didn't include the magic words. I did some digging and found a multitude of errors that require pruning to remove the error and some of them having the same messaging but the |
Awesome research! I love the phrase "a multitude of errors." :-P I'll go ahead and and merge. If people see noticeable performance issues in 2.5.0-rcX, then we can revisit the possibility of a "laundry list of error messages" approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ADustyOldMuffin!
If we want to consider cherry-picking this back, I think we'll want some metrics demonstrating that there's no performance regression. Maybe the initial tests you did would be sufficient, but it would be nice to have some stats for this code running in a live instance. |
This should clean up any old branches and save on disk space, and fix any errors around bad branch names.
fixes #10664
Most initial tests of timing the git fetch command with and without prune found that differences in amount of time on large repositories with many changes were within 10-50ms of each other, and with smaller repositories with low amounts of changes the difference was closer to un-measurable if not the same.
I think this combined with possibly saving space and removing old refs adds up that it makes sense to auto prune on fetch so we can avoid random issues with git branches.
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: