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

Re: [PATCH v2] t7501-commit.sh: explicitly check that -F prevents invoking the editor

From
Adeodato Simó <dato@net.com.org.es>
Date
Jan 10, 2009, 10:32 UTC
Message-ID
<20090110103252.GA32151@chistera.yi.org>
In-Reply-To
<alpine.DEB.1.00.0901101117100.30769@pacific.mpi-cbg.de>
* Johannes Schindelin [Sat, 10 Jan 2009 11:19:43 +0100]:
> Hi,
Hello,
Show 10 quoted lines
> >  test_expect_success '--signoff' '
> >  	echo "yet another content *narf*" >> foo &&
> > -	echo "zort" | (
> > -		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
> > -		git commit -s -F - foo
> > -	) &&
> > +	echo "zort" | git commit -s -F - foo &&
> >  	git cat-file commit HEAD | sed "1,/^$/d" > output &&
> >  	test_cmp expect output
> >  '
> AFAICT this still tests if -F - launches an editor, except that it _does_ 
> launch the editor, waiting for the user to quit the editor.  Which is bad.

The default value of VISUAL for the test suite is ":" AFAICS. Hence, even if it's called, it will return immediately.

If it would be called, without my patch the "--signoff" test would fail, but there would be no obvious reason as to why. Seeing "editor not invoked if -F is given FAILED" is much more clear IMHO.

Also note that there plenty of places in the test suite where -F is used, but VISUAL is not set explicitly.

Cheers,
-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
Excuse me for thinking a banana-eating contest was about eating a banana!
                -- Paris Geller
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 8 of 9 in “t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusing”
  1. t7500-commit.sh: do not call test_set_editor unnecessarily, it's confusingAdeodato Simó, Dec 29, 2008
  2. Junio C HamanoDec 29, 2008
  3. Adeodato SimóDec 29, 2008
  4. Junio C HamanoDec 29, 2008
  5. Johannes SchindelinDec 30, 2008
  6. t7501-commit.sh: explicitly check that -F prevents invoking the editorAdeodato Simó, Jan 9, 2009
  7. Johannes SchindelinJan 10, 2009
  8. Adeodato SimóJan 10, 2009
  9. Johannes SchindelinJan 10, 2009

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.