Skip to content

Support for SHA-256 object format repositories (fails with "invalid path") #2800

Description

@Smart-SangGe

Is your feature request related to a problem? Please describe.
I am unable to use gitui in repositories initialized with the SHA-256 object format (git init --object-format=sha256). When I attempt to launch the application in such a repository, it immediately fails and exits with the error message: invalid path: please run gitui inside of a non-bare git repository.

This is frustrating because the repository is completely valid. I can perform all operations using the standard Git CLI without issues. Furthermore, other TUI tools like lazygit handle these SHA-256 repositories correctly, which suggests the issue is specific to gitui or its underlying libgit2 bindings not parsing the repository metadata correctly.

Describe the solution you'd like
I would like gitui to detect and support repositories using the SHA-256 hashing algorithm. It should launch normally and allow for standard git operations, just as it does with standard SHA-1 repositories.

Describe alternatives you've considered
I have verified that reverting to the default SHA-1 format (git init) allows gitui to work, but this is not a viable solution for my workflow as I specifically require the security properties of SHA-256. Currently, I am forced to use the CLI or alternative tools like lazygit for these specific repositories.

Additional context
Here are the steps to reproduce the issue:

  1. Initialize a new repository with git init --object-format=sha256.
  2. Run gitui.
  3. Observe the error: invalid path: please run gitui inside of a non-bare git repository.

Activity

  1. extrawurst commented on Dec 1, 2025

    @extrawurst
    Collaborator

    its pending upstream issue: rust-lang/git2-rs#1090

  2. extrawurst commented on Dec 1, 2025

    @extrawurst
    Collaborator

    @cruessler @Byron how does gix support look like for it ?

  3. Byron commented on Dec 2, 2025

    @Byron

    Being able to read SHA256 repositories is at least planned, but thus far there was no motivation to go through with it: GitoxideLabs/gitoxide#281.

    It's in a stage where early support can definitely be contributed, but no work is in progress as far as I know.

  4. cruessler commented on Dec 2, 2025

    @cruessler
    Collaborator

    This is a space I’d like to explore and potentially start working on, in particular over the end-of-the-year holidays.

  5. greg-is-kub commented on Jan 13, 2026

    @greg-is-kub

    Update : the error has recently changed, thanks for making it clearer :)

    Error: invalid repo path: unknown object format 'sha256'; class=Repository (6); code=Invalid (-21)
    
  6. cruessler commented on Jan 15, 2026

    @cruessler
    Collaborator

    Thanks for the feedback, that looks like an error message from libgit2, so we probably updated that dependency at some point. :-)

  7. georglauterbach commented on Oct 4, 2026

    @georglauterbach

    I have just come across this inconvenience. Can this be solved or are we still waiting for an upstream dependency?

  8. cruessler commented on Oct 5, 2026

    @cruessler
    Collaborator

    Support is there from gitoxide which we use for some of our Git operations. libgit2 which we use for the rest also has support, but we have not enabled the feature flag unstable-sha256 for libgit2 yet. Once #3001 is merged, gitui master should support SHA-256 for all operations. (None of this has been released yet.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions