Jeff King <> writes:

> The test_set_editor helper does some magic to help with quoting, but
> that should not be an issue in this case (since we are using "cat"). We
> are using test_set_editor elsewhere in the script, which would have set
> EDITOR previously. But I would think that GIT_EDITOR, which we are using
> here, would supersede that. However, the error message he shows
> indicates that git is using EDITOR (as FAKE_EDITOR is part of that quote
> magic).
> Am I misremembering the issues with one-shot variables and functions?

I think there are two problems involved.

The first is that we are not really using GIT_EDITOR under some
shells; to wit:

------------------------ >8 ------------------------

$ cat >/var/tmp/ <<\EOF

test_must_fail () {
                env | sed -n -e '/EDITOR/s/^/>> /p'

export EDITOR

GIT_EDITOR=cat test_must_fail foo

$ dash /var/tmp/
>> EDITOR=dog
$ bash /var/tmp/
>> EDITOR=dog

------------------------ 8< ------------------------

So it appears that GIT_EDITOR that was never exported in the script
fails to get exported with the "VAR=VAL cmd" syntax under dash, when
cmd is not a command but is a shell function.  The "git commit" in
question ends up using $EDITOR.

Another is that EDITOR="$FAKE_EDITOR" that is set up earlier in the
is having trouble launching (I have a feeling that it never was
actually used because everybody uses "commit -F <file>").
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to