lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Breaks if the GPG signatures are enabled in git log

Open mvshmakov opened this issue 3 years ago • 1 comments

Describe the bug lazygit cannot parse commits from git log if git config --global log.showSignature true

To Reproduce Steps to reproduce the behavior:

  1. git config --global log.showSignature true
  2. lazygit

Expected behavior lazygit should open correctly.

Logs

panic: runtime error: index out of range [1] with length 1

goroutine 54 [running]:
github.com/jesseduffield/lazygit/pkg/commands/loaders.(*CommitLoader).extractCommitFromLine(0x1400023f4a0, {0x1400067d220, 0x4b})
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/loaders/commits.go:164 +0x45c
github.com/jesseduffield/lazygit/pkg/commands/loaders.(*CommitLoader).GetCommits.func1({0x1400067d220, 0x4b})
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/loaders/commits.go:94 +0x104
github.com/jesseduffield/lazygit/pkg/commands/oscommands.(*cmdObjRunner).RunAndProcessLines(0x140002891e0, {0x1054cbd98, 0x14000094180}, 0x14000166150)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/oscommands/cmd_obj_runner.go:102 +0x1c0
github.com/jesseduffield/lazygit/pkg/commands.(*gitCmdObjRunner).RunAndProcessLines(0x14000217230, {0x1054cbd98, 0x14000094180}, 0x14000166150)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/git_cmd_obj_runner.go:25 +0x4c
github.com/jesseduffield/lazygit/pkg/commands/oscommands.(*CmdObj).RunAndProcessLines(0x14000094180, 0x14000166150)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/oscommands/cmd_obj.go:148 +0x4c
github.com/jesseduffield/lazygit/pkg/commands/loaders.(*CommitLoader).GetCommits(0x1400023f4a0, {0x1, {0x0, 0x0}, 0x1, {0x105274374, 0x4}, 0x0})
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/commands/loaders/commits.go:92 +0x318
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshCommitsWithLimit(0x140002b41e0)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/gui/commits_panel.go:119 +0x16c
github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshCommits.func2()
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/gui/commits_panel.go:94 +0x34
github.com/jesseduffield/lazygit/pkg/utils.Safe.func1()
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/utils/utils.go:95 +0x28
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x140000c07b8)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/utils/utils.go:106 +0x5c
github.com/jesseduffield/lazygit/pkg/utils.Safe(0x14000634048)
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/utils/utils.go:95 +0x40
created by github.com/jesseduffield/lazygit/pkg/gui.(*Gui).refreshCommits
        /private/tmp/lazygit-20220317-63378-100u81x/lazygit-0.34/pkg/gui/commits_panel.go:93 +0x134

Desktop (please complete the following information):

  • OS: MacOS
  • Lazygit Version: 0.34

Additional context Seems like there was an issue like this submitted a while ago and it was reported as fixed. Though for me on the latest version the issue persists.

Git log entry looks like this if the settings is enabled:

commit <commit SHA1> (HEAD -> main, origin/main)
gpg: Signature made Thu Apr 28 21:01:06 2022 +04
gpg:                using RSA key <fingerprint>
gpg: Good signature from "Author <[email protected]>" [ultimate]
Author: Author <[email protected]>
Date:   Thu Apr 28 21:01:06 2022 +0400

    Example commit message

mvshmakov avatar Apr 28 '22 17:04 mvshmakov

It's not an issue for me I guess the issue can be closed.

strboul avatar Apr 26 '23 14:04 strboul