GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `repo.blame` should allow passing `None` as the `rev` parameter. · Issue #1835 · gitpython-developers/GitPython

repo.blame should allow passing None as the rev parameter. #1835

New issue
Copy link
New issue
Copy link
Closed
#1846
Closed
repo.blame should allow passing None as the rev parameter.#1835
#1846
Copy link
Labels
acknowledgedhelp wanted

Description

@Gaubbe
Gaubbe
opened on Feb 21, 2024
Issue body actions

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.

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Feb 21, 2024
  2. Byron commented on Feb 21, 2024

    @Byron
    Byron
    on Feb 21, 2024
    Member
    More actions

    Thanks for sharing your finding!

    It does seems to make sense to adjust the annotations to explicitly allow this use-case.

  3. Gaubbe commented on Feb 22, 2024

    @Gaubbe
    Gaubbe
    on Feb 22, 2024
    ContributorAuthor
    More actions

    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.

    Reacted by Sebastian Thiel
  4. Byron commented on Feb 22, 2024

    @Byron
    Byron
    on Feb 22, 2024
    Member
    More actions

    Thanks for offering! It's OK to keep the PR focussed on the problem at hand.

    Reacted by Gaubbe
  5. Byron
    closed this as completedin #1846on Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — 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.