Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gitpython-developers/GitPython
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1b2d3f01543cf86083f32fc61d3f7a9fc458c450
Choose a base ref
...
head repository: gitpython-developers/GitPython
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 24c4a0ece36fc3b1e4a7b848516e98d16c88102b
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Sep 24, 2025

  1. __init__: don't run refresh on import

    Consumers of gitpython may not need to use it in all use cases, and may
    want to be able to run (without using gitpython) in environments where
    git is not available on PATH. While this can be worked around by setting
    the GIT_PYTHON_REFRESH environment variable, adding special handling for
    gitpython means that it can't be imported just like everything else in
    an import block at the top of the module, and environment variables have
    potentially undesired propagation behaviour.
    
    Previously, it was also nontrivial to distinguish gitpython failing to
    import because of missing git or because e.g. gitpython isn't installed
    at all, because the exception that's raised is an ImportError without
    further qualification (except in the error message).
    
    Thus, we now no longer perform `refresh` at the module top level,
    instead performing it lazily when an invocation of git is attempted.
    This also allows some functionality that doesn't rely on the git command
    to work without, e.g. ref listing.
    lheckemann committed Sep 24, 2025
    Configuration menu
    Copy the full SHA
    24c4a0e View commit details
    Browse the repository at this point in the history
Loading