Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15

Re: [PATCH] t7507-*.sh: Fix test #8 (could not run '"$FAKE_EDITOR"')

From: Jens Lehmann <hidden>
Date: 2016-06-15 22:59:17

Am 20.11.2013 20:35, schrieb Ramsay Jones:
On 20/11/13 17:22, Junio C Hamano wrote:
quoted
Ramsay Jones [off-list ref] writes:
quoted
Signed-off-by: Ramsay Jones <redacted>
---

Hi Jens,

commit 61b6a633 ("commit -v: strip diffs and submodule shortlogs
from the commit message", 19-11-2013) in 'pu' fails the new test
it added to t7507.

I didn't spend too long looking at the problem, so take this patch
as nothing more than a quick suggestion for a possible solution! :-P
[The err file contained something like: "There was a problem with the
editor '"$FAKE_EDITOR"'"].

Having said that, this fixes it for me ...
Well spotted.  test_must_fail being a shell function, not a command,
we shouldn't have used the "VAR=val cmd" one-shot environment
assignment for portability.

Even though this happens to be the last test in the script, using
test_set_editor to permanently affect the choice of editor for tests
that follow is not generally a good idea.  It would be safer to do
this, I would have to say:

		git commit -a -m "submodule commit"
	) &&
        (
		GIT_EDITOR=cat &&
                export GIT_EDITOR &&
                test_must_fail git commit -a -v 2>err
	) &&
        test_i18ngrep "Aborting ..."
Yes, this works great (and I very nearly wrote exactly this, but since
the test was using test_set_editor anyway ...) :-D
Thanks all, will use that in the next iteration.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help