gg-scm/gg

Relative editor paths don't work

zombiezen opened this issue · 0 comments

It seems that Git executes the editor command from the root of the working copy, rather than wherever the commit command is invoked from.

Steps to Reproduce

gg init &&
cat > editor <<EOF &&
#!/bin/bash
vim "$@"
EOF
chmod +x editor &&
git config core.editor ./editor &&
git add . &&
mkdir subdir &&
cd subdir &&
gg commit

Expected Behavior

vim is opened to edit the commit message.

Actual Behavior

/bin/sh: 1: ./editor: not found
gg: open editor: exit status 127

and an exit with code 1.

Version Info

gg version 1.1.0-1, built on 2020-12-23T02:07:47Z
go: go1.15.6 gc linux/amd64
git version 2.17.1