jesseduffield / jesseduffield/lazygit

No files shown in Commit pane for the initial commit in SHA-256 repos

Open
#5,385 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Describe the bug

I am using SHA-256 commit hashes on a repo (created with `git init --object-format=sha256`). In it, lazygit continues to work fine, but when I try to diff individual files of the initial commit, the window is empty.

### To Reproduce
Steps to reproduce the behavior:

1. Create a SHA-256 repo with `git init --object-format=sha256`
2. Add and commit any file
3. Go to `[4] Commits` > select the commit > press Enter to enter diff view
4. No files are shown, as if the commit is empty

5. Add and commit another file
6. Go to `[4] Commits` > select the latest commit > press Enter to enter diff view
7. Everything is fine
8. Initial commit is still broken

### Expected behavior

The committed files are shown

### Screenshots

| | |
|-|-|
|Image| Image |
| Commit list view: diff shows file in commit | pressed Enter: commit appears empty |

### Version info:

```
commit=, build date=, build source=Homebrew, version=0.60.0, os=darwin, arch=arm64, git version=2.53.0
```

### Terminal info:

iTerm2 Build 3.6.8\
zsh 5.9 (arm-apple-darwin24.2.0)

### Additional context

Initial commit sha: `ba741fcd02b3cd42187ee46d4bdbfed10bf8fdbb15ccf739cb9ce583aefe5cae`

When pressing Enter, the following gets logged:

```
Mar 18 09:13:50 |DEBU| RunCommand command="git -c diff.noprefix=false diff --submodule --no-ext-diff --name-status -z --no-renames 4b825dc642cb6eb9a060e54bf8d69288fbee4904 ba741fcd02b3cd42187ee46d4bdbfed10bf8fdbb15ccf739cb9ce583aefe5cae"
Mar 18 09:13:50 |ERRO| fatal: ambiguous argument '4b825dc642cb6eb9a060e54bf8d69288fbee4904': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
```

I don't know where it takes the `4b825dc642cb6eb9a060e54bf8d69288fbee4904` from; there is no such object inside `.git`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.