Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1400 +/- ##
==========================================
+ Coverage 97.33% 97.40% +0.06%
==========================================
Files 42 57 +15
Lines 2104 2661 +557
==========================================
+ Hits 2048 2592 +544
- Misses 56 69 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
|
|
||
| def guess_default_branch() -> str: | ||
| c = cmd.run("git branch --format '%(refname:short)' --list master main") |
There was a problem hiding this comment.
This makes a strong hypothesis that the reference branch can only be master or main so it won't work with develop which is common, or any other "exotic choice".
To handle this, I use git branch -r | grep -Po "HEAD -> .+/\K.+$" | head -n 1 which works with any default branch as long as there is a remote with a default. The head is for the case where there are multiple remotes, but makes the hypothesis that they share the same default branch.
There was a problem hiding this comment.
I guess I'll have to try those commands 👀 Looks interesting!
I'm thinking of letting users set default_git_remote and default_git_branch_name (but not yet have time to impletemtn it 🥲)
There was a problem hiding this comment.
Yes, that's a good idea. Having guess the default but keeping the possibility to explicitly set it from the configuration 👍🏼
|
|
||
| def _get_commits(self): | ||
| def _get_commits(self) -> list[git.GitCommit]: | ||
| # TODO: this method seems to do a few different things. probably would be better if we could split it to smaller functions |
There was a problem hiding this comment.
Already done in refactors branch
|
close in favor of #1519 |
Description
Checklist
poetry alllocally to ensure this change passes linter check and testExpected behavior
Steps to Test This Pull Request
Additional context