Skip to content

lazygit do not support git pre commitΒ #92

Open
@scbizu

Description

@scbizu

Hello there! I recently find that lazygit has no support for the git pre commit.

Case 1

when I write the git commit message and press down the Enter,lazygit will wait a moment (depends on what the git pre commit script) .And I can not see my script output in the terminal.

Case 2

when my git pre commit script has an error, lazygit will crash and finally get the panic log.

the panic log is here:

panic: exit status 1

goroutine 1 [running]:
main.handleCommitPress.func1(0xc420134000, 0xc420478000, 0xc420136060, 0xc420136060)
       $GOPATH/src/github.com/jesseduffield/lazygit/files_panel.go:167 +0xea
main.wrappedConfirmationFunction.func1(0xc420134000, 0xc420478000, 0xc, 0xc420041e01)
         $GOPATH/src/github.com/jesseduffield/lazygit/confirmation_panel.go:19 +0x6e
github.com/jesseduffield/gocui.(*Gui).execKeybindings(0xc420134000, 0xc420478000, 0xc420041da0, 0x10d21b9, 0x0, 0x0)
        $GOPATH/src/github.com/jesseduffield/gocui/gui.go:659 +0xdd
github.com/jesseduffield/gocui.(*Gui).onKey(0xc420134000, 0xc420041da0, 0xc4200e0200, 0xc42013e000)
        $GOPATH/src/github.com/jesseduffield/gocui/gui.go:623 +0x1b3
github.com/jesseduffield/gocui.(*Gui).handleEvent(0xc420134000, 0xc420041da0, 0xc420041d98, 0x0)
        $GOPATH/src/github.com/jesseduffield/gocui/gui.go:428 +0x40
github.com/jesseduffield/gocui.(*Gui).MainLoop(0xc420134000, 0x0, 0x0)
         $GOPATH/src/github.com/jesseduffield/gocui/gui.go:388 +0x2c0
main.run()
         $GOPATH/src/github.com/jesseduffield/lazygit/gui.go:347 +0x175
main.main()
         $GOPATH/src/github.com/jesseduffield/lazygit/main.go:68 +0xf2

Proposal

we can pop up a window (just like the git commit window) to show git pre commit output after we enter the git commit message.

if there is an error in git pre commit script, we should rollback this commit and stay in lazygit's terminal as well.

if this proposal is acceptable, I can do something and send U a PR.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions