Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for sha256 git repositories #1401

Open
Digit4lSh4d0w opened this issue Mar 4, 2025 · 2 comments
Open

feat: Support for sha256 git repositories #1401

Digit4lSh4d0w opened this issue Mar 4, 2025 · 2 comments

Comments

@Digit4lSh4d0w
Copy link

Summary

Add support for git repositories using the sha256 object format.

Currently, when using a sha256 git repo, the branch and status display functions do not work.

Steps to trigger the problem:

1. Create sha1 git repo:

  1. Create folder for git repo with sha1: mkdir test-sha1.
  2. Enter to directory: cd test-sha1.
  3. Create repository with sha1 object format: git init --object-format sha1.
  4. Create file: echo "test" > file.txt.
  5. Stage file: git add file.txt.
  6. Commit file: git commit -m "Add file.txt".
  7. Return: cd ...

2. Create sha256 git repo:

  1. Create folder for git repo with sha256: mkdir test-sha256.
  2. Enter to directory: cd test-sha256.
  3. Create repository with sha256 object format: git init --object-format sha256.
  4. Create file: echo "test" > file.txt.
  5. Stage file: git add file.txt.
  6. Commit file: git commit -m "Add file.txt".
  7. Return: cd ...

3. Check the result:

  1. Run eza: eza --long --git-repos.
  2. Catch the wrong behavior.

Actual Behavior:

The functions related to displaying the branch name and repository status are not working.

Example (from my system):

... + main book-rust-in-action
... | main configs
... - -    cryptography
... - -    docker-compose-files

In the above example, I have left only the directories containing the git repositories. As you can see, some of them use sha1, while others use sha256.

Repositories using sha256 are displayed as simple directories without git repositories.

Expected Behavior:

The functions related to displaying the branch name and repository status are working.

Eza version and system specs:

  • Eza: v0.20.23 [+git]
  • OS: Archlinux 6.13.5-zen1-1-zen
@cafkafk
Copy link
Member

cafkafk commented Mar 4, 2025

This would indeed be super cool, if anyone wants to work on support consider it endorsed!

@cafkafk
Copy link
Member

cafkafk commented Mar 4, 2025

First issue will be libgit2 seemingly (allegedly?) not supporting it libgit2/libgit2#5840 (comment)

Moving from libgit2 would likely be a much larger scope issue (not that it would be unwelcome, if there is rust libraries with acceptable maturity and feature parity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants