ejoffe / spr

Stacked Pull Requests on GitHub
MIT License
794 stars 68 forks source link

git error: fatal: cannot run /usr/bin/true: No such file or directory #362

Open kilianyp opened 11 months ago

kilianyp commented 11 months ago

When running git amend I am faced with the following error:

Commit to amend (1-2): 2
> git commit --fixup efa9629033b21c58fadb220f5add01e7a1124a30
> git rebase -i --autosquash --autostash origin/master
git error: fatal: cannot run /usr/bin/true: No such file or directory
error: unable to start editor '/usr/bin/true'
panic: exit status 1

goroutine 1 [running]:
github.com/ejoffe/spr/git/realgit.(*gitcmd).MustGit(0x7c6e34?, {0xc000034a80?, 0xc0000d3d00?}, 0x2?)
        /Users/runner/work/spr/spr/git/realgit/realcmd.go:44 +0x3c
github.com/ejoffe/spr/spr.(*stackediff).AmendCommit(0xc00007afc0, {0xa9ea40?, 0xc0000106c0?})
        /Users/runner/work/spr/spr/spr/spr.go:85 +0x586
main.main()
        /Users/runner/work/spr/spr/cmd/amend/main.go:66 +0x3af

I am on ubuntu:

git version 2.39.2
Release:        18.04
kilianyp commented 11 months ago

git rebase -i --autosquash --autostash origin/master

That command still works fine in isolation, e.g. if I run git commit --fixup.. and then git rebase... manually.

kilianyp commented 11 months ago

I solved it by manually creating a /bin/usr/true that just echos 1.

I am using zsh, where which true returns true: shell built-in command.

arbll commented 7 months ago

Ran into the same issue, I'm also a zsh user