You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo.blame should allow passing None as the rev parameter. #1835
This issue only affects the type hint given to the rev parameter, as passing None to the function does work and gives the expected behavior, which is running the git blame -p -- <file> command without a revision, which gives back the blame including changes to the local working directory that haven't been committed yet.
While the code works at runtime, language servers such as pylance give back an error, as None is not a valid type according to the type hints.
I'll gladly make a pull request with the fix if you or other contributors don't have anything more to say about this issue.
Are there any other places in the code that comes to mind for which such a fix could also make sense? The only other git command that I use without specifiying a revision is git diff, but the Diffable interface seems to already support passing None as the other parameter.
Activity
Byron commentedon Feb 21, 2024
Thanks for sharing your finding!
It does seems to make sense to adjust the annotations to explicitly allow this use-case.
Gaubbe commentedon Feb 22, 2024
I'll gladly make a pull request with the fix if you or other contributors don't have anything more to say about this issue.
Are there any other places in the code that comes to mind for which such a fix could also make sense? The only other git command that I use without specifiying a revision is
git diff, but theDiffableinterface seems to already support passingNoneas theotherparameter.Byron commentedon Feb 22, 2024
Thanks for offering! It's OK to keep the PR focussed on the problem at hand.