git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Nov 20, 2013, 18:54 UTC
Message-ID
<20131120185420.GA11404@sigill.intra.peff.net>
In-Reply-To
<xmqqhab67wjr.fsf@gitster.dls.corp.google.com>
On Wed, Nov 20, 2013 at 10:33:28AM -0800, Junio C Hamano wrote:
Show 5 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Am I misremembering the issues with one-shot variables and functions?
> 
> I think there are two problems involved.

OK, I was misremembering. I recalled the "does not unset afterwards" part, but not the "does not export" part. I think because:

Show 5 quoted lines
> test_must_fail () {
> 	(
> 		env | sed -n -e '/EDITOR/s/^/>> /p'
> 	)
> }

...here we _do_ have GIT_EDITOR set properly in the function itself, but not in the subprocess.

Previous discussion and links to POSIX are here:
  http://article.gmane.org/gmane.comp.version-control.git/137095

Not that they matter compared to the code you demonstrated, but I was digging them up when you responded. :)

> 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>").

I think it is used, as there are several "git commit --amend -v" invocations. Which makes sense, as you should not be able to test "-v" with "-F", I would think.

I'm not sure why the old $FAKE_EDITOR doesn't work there, though (not that it would make the test pass anyway, as it does something different than what the test wants, but I would not expect the shell to complain of failure).

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 5 of 8 in “t7507-*.sh: Fix test #8 (could not run '"$FAKE_EDITOR"')”
  1. t7507-*.sh: Fix test #8 (could not run '"$FAKE_EDITOR"')Ramsay Jones, Nov 20, 2013
  2. Junio C HamanoNov 20, 2013
  3. Jeff KingNov 20, 2013
  4. Junio C HamanoNov 20, 2013
  5. Jeff KingNov 20, 2013
  6. Jeff KingNov 20, 2013
  7. Ramsay JonesNov 20, 2013
  8. Jens LehmannNov 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.