jesseduffield / lazygit

simple terminal UI for git commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wsl + Lazygit Memory Allocation Failed

muzammil-iftikhar opened this issue · comments

Describe the bug
Whenever i select any file or commit inside lazygit, i get the memory allocation failed error in Lazygit. I am using lazygit inside wsl.

To Reproduce
Steps to reproduce the behavior:

  1. Goto any git repo
  2. Start lazygit
  3. Goto 'files' section
  4. Goto 'Commits' section

Expected behavior
Lazygit should display the files or commit section properly

Screenshots
image

Version info:

commit=3675570a391b1a49ddd198b4c7e71e17701d4404, build date=2024-03-23T09:09:11Z, build source=binaryRelease, version=0.41.0, os=linux, arch=amd64, git version=2.34.1

Additional context
wsl --version

WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3447

Logs:

May  5 15:56:51 |INFO| Receiving focus - refreshing
May  5 15:56:51 |INFO| refreshing all scopes in async mode
May  5 15:56:51 |INFO| Refresh took 88.037┬╡s
May  5 15:56:51 |DEBU| using cache for key status.showUntrackedFiles
May  5 15:56:51 |DEBU| RunCommand command="git stash list -z --pretty=%ct|%gs"
May  5 15:56:51 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
May  5 15:56:51 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z"
May  5 15:56:51 |DEBU| RunCommand command="git rev-parse --abbrev-ref --verify HEAD"
May  5 15:56:51 |INFO| git stash list -z --pretty=%ct|%gs (908.302┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for stash took 8.833┬╡s
May  5 15:56:51 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (993.156┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for reflogCommits took 7.634┬╡s
May  5 15:56:51 |INFO| git tag --list -n --sort=-creatordate (896.848┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for tags took 5.822┬╡s
May  5 15:56:51 |INFO| git for-each-ref --sort=refname --format=%(refname:short) refs/remotes (1.002278ms)
May  5 15:56:51 |INFO| postRefreshUpdate for remotes took 5.831┬╡s
May  5 15:56:51 |INFO| git status --untracked-files=all --porcelain -z (925.334┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for remoteBranches took 2.369┬╡s
May  5 15:56:51 |ERRO| fatal: Needed a single revision
 command="git rev-parse --abbrev-ref --verify HEAD"
May  5 15:56:51 |INFO| git rev-parse --abbrev-ref --verify HEAD (670.408┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for submodules took 16.021┬╡s
May  5 15:56:51 |INFO| postRefreshUpdate for files took 15.811┬╡s
May  5 15:56:51 |DEBU| RunCommand command="git merge-base  @{u}"
May  5 15:56:51 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads"
May  5 15:56:51 |ERRO| fatal: Not a valid object name
 command="git merge-base  @{u}"
May  5 15:56:51 |INFO| git merge-base  @{u} (804.064┬╡s)
May  5 15:56:51 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%s%x00%m --abbrev=40 -300 --no-show-signature -- (878.653┬╡s)
May  5 15:56:51 |DEBU| using cache for key rebase.updateRefs
May  5 15:56:51 |DEBU| using cache for key rebase.updateRefs
May  5 15:56:51 |INFO| postRefreshUpdate for commits took 52.325┬╡s
May  5 15:56:51 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (639.582┬╡s)
May  5 15:56:51 |DEBU| RunCommand command="git symbolic-ref --short HEAD"
May  5 15:56:51 |INFO| git symbolic-ref --short HEAD (726.01┬╡s)
May  5 15:56:51 |DEBU| RunCommand command="git worktree list --porcelain"
May  5 15:56:51 |INFO| git worktree list --porcelain (751.052┬╡s)
May  5 15:56:51 |DEBU| RunCommand command="git -C /home/muzammil/Downloads/demo rev-parse --path-format=absolute --absolute-git-dir"
May  5 15:56:51 |INFO| git -C /home/muzammil/Downloads/demo rev-parse --path-format=absolute --absolute-git-dir (670.278┬╡s)
May  5 15:56:51 |INFO| postRefreshUpdate for worktrees took 26.703┬╡s
May  5 15:56:51 |INFO| postRefreshUpdate for localBranches took 20.288┬╡s
May  5 15:56:51 |DEBU| using cache for key rebase.updateRefs
May  5 15:56:52 |DEBU| using cache for key rebase.updateRefs
May  5 15:56:52 |ERRO| Unexpected error when running cmd task: exit status 1; Failed command: /usr/bin/git [git -C /home/muzammil/Downloads/demo diff --no-ext-diff --submodule --unified=3 --color=always --no-index -- /dev/null demo.md]

The issue was not with lazygit but rather the delta pager.
Anyone who comes across this issue, just follow the solution posted here

solution