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 — `active_branch` is detected incorrectly when using `reftable` · Issue #2113 · gitpython-developers/GitPython

active_branch is detected incorrectly when using reftable #2113

New issue
Copy link
New issue
Copy link
Closed
#2114
Closed
active_branch is detected incorrectly when using reftable#2113
#2114
Copy link
Labels
acknowledgedhelp wanted

Description

@alynn-coefficient
alynn-coefficient
opened on Mar 19, 2026
Issue body actions

On git repositories using the new reftable format (slated to become the default in the upcoming Git 3.0.0), GitPython detects the wrong ref as being active.

Observe, with the traditional "files" format:

mkdir test
cd test
git init --ref-format=files
uvx --with gitpython python -c "import git; print(git.Repo('.').active_branch.name)"

Produces main as expected. However:

mkdir test
cd test
git init --ref-format=reftable
uvx --with gitpython python -c "import git; print(git.Repo('.').active_branch.name)"

Produces .invalid.

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Mar 19, 2026
  2. Byron commented on Mar 19, 2026

    @Byron
    Byron
    on Mar 19, 2026
    Member
    More actions

    While the object database with SHA256 should be fine, the reference handling will have a problem as it's currently done in pure python.

    To support this properly, I think it would have to detect reftables and switch to an alternative implementation, probably one that just uses Git under the hood.

  3. alynn-coefficient commented on Mar 20, 2026

    @alynn-coefficient
    alynn-coefficient
    on Mar 20, 2026
    Author
    More actions

    Is there a shorter-term option perhaps to add the detection and just error loudly? I realise that full native reftables support may be a longer-term project.

    Reacted by Sebastian Thiel
  4. Byron
    linked a pull request that will close this issueFix `Repo.active_branch` resolution for reftable-backed repositories #2114on Mar 21, 2026
  5. Byron
    closed this as completedin #2114on Mar 21, 2026
  6. planetmarshall commented on Apr 1, 2026

    @planetmarshall
    planetmarshall
    on Apr 1, 2026
    More actions

    On git repositories using the new reftable format (slated to become the default in the upcoming Git 3.0.0)...

    Also worth noting that reftables may already be widely used on macos where a case-insensitive filesystem is the default - due to git suggesting that users migrate if it detects a case-sensitivity conflict:

    error: You're on a case-insensitive filesystem, and the remote you are
    trying to fetch from has references that only differ in casing. It
    is impossible to store such references with the 'files' backend. You
    can either accept this as-is, in which case you won't be able to
    store all remote references on disk. Or you can alternatively
    migrate your repository to use the 'reftable' backend with the
    following command:
    
        git refs migrate --ref-format=reftable
    
    Please keep in mind that not all implementations of Git support this
    new format yet. So if you use tools other than Git to access this
    repository it may not be an option to migrate to reftables.
    

    Was caught by this recently when using repo.index.diff("HEAD") to detect a changeset.

    Reacted by Sebastian Thiel
    Reacted by Eliah Kagan
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 01402503 — 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.