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: 3.1.48
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: 3.1.49
Choose a head ref
  • 8 commits
  • 8 files changed
  • 2 contributors

Commits on Apr 28, 2026

  1. reject control chars in written values in configuration

    Reject CR, LF, and NUL in GitConfigParser values before writing them
    to git config files (which also is a deviation from Git which escapes them).
    
    GitConfigParser._write() serializes embedded newlines as indented
    continuation lines by replacing "\n" with "\n\t". Git itself skips
    leading whitespace before parsing config tokens, so an injected value
    such as:
    
        foo
        [core]
        hooksPath=/tmp/hooks
    
    is written in a form where the indented "[core]" line is still parsed by
    Git as a real section header. This lets attacker-controlled input passed
    to config_writer().set_value() poison repository config, including
    core.hooksPath, and redirect hook execution for later Git operations.
    
    Fail closed instead of stripping or normalizing these characters. Silent
    normalization can hide unsanitized caller input, and GitPython does not
    currently round-trip Git-style escaped values such as "\n" as embedded
    newlines.
    
    Apply the validation to set_value(), add_value(), and the public set()
    path so callers cannot bypass the safer helper API. Add regression tests
    for the advisory payload and for CR, LF, NUL, and bytes values.
    
    This preserves existing read behavior for config files that already
    contain multiline values while preventing GitPython from writing new
    unsafe values.
    
    Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
    codex and Byron committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    c417af4 View commit details
    Browse the repository at this point in the history
  2. avoid duplicate validation in set_value

    Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
    codex and Byron committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    8e24503 View commit details
    Browse the repository at this point in the history
  3. Improve pure Python rev-parse coverage and behavior (#2135)

    Port object-resolving revspec cases inspired by gix-revision into deterministic GitPython tests, without shelling out to Git or Gix at runtime. Refactor rev_parse handling around anchors, navigation, peeling, reflog selectors, path/index lookups, describe-style names, and commit-message searches.
    
    Document observed Git/Gix behavior differences and the GitPython choices made for user-facing compatibility.
    
    Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
    codex and Byron committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    d7ce6fc View commit details
    Browse the repository at this point in the history
  4. Fix rev-parse CI issues

    codex authored and Byron committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    bdbdf4b View commit details
    Browse the repository at this point in the history
  5. Merge pull request #2137 from gitpython-developers/fix-config-injection

    reject control chars in written values in configuration
    Byron authored Apr 28, 2026
    Configuration menu
    Copy the full SHA
    b049a13 View commit details
    Browse the repository at this point in the history
  6. Address rev-parse review feedback

    codex authored and Byron committed Apr 28, 2026
    Configuration menu
    Copy the full SHA
    6cf7ac3 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2026

  1. Merge pull request #2136 from gitpython-developers/copilot/create-rep…

    …roducing-test-fix
    
    Improve pure Python rev-parse coverage and behavior
    Byron authored Apr 29, 2026
    Configuration menu
    Copy the full SHA
    1c4ea96 View commit details
    Browse the repository at this point in the history
  2. bump version to 3.1.49

    Byron committed Apr 29, 2026
    Configuration menu
    Copy the full SHA
    aee2fd5 View commit details
    Browse the repository at this point in the history
Loading