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

test_pause giving '__git_ps1: not found' warning

From
Philip Oakley <philipoakley@iee.email>
Date
Jan 14, 2023, 14:54 UTC
Message-ID
<bce6ac3a-17a6-beed-43ef-5a1e0dd92a5d@iee.email>

I was trying to refine a test_expect_failure test [1] and tried inserting a `test_pause &&` test line [2].

I then found, when it paused, I was repeatedly given the warning line
     /bin/sh: 1: __git_ps1: not found
in the terminal until I expected the test shell.

my PS1 is working normally in the terminal, but not here.  Is this expected, or do I need to set up anything else?

Normally I'm on Git for Windows, but this was on my old laptop (Acer 7741 i5 4GB ram..) converted to Ubuntu 20.04, which I use when away.

The basic sequence was

~$ cd repos/git ~/repos/git (doctrunc *)$ cd t ~/repos/git/t (doctrunc *)$ ./t4205-log-pretty-formats.sh  -i -x -v Initialized empty Git repository in /home/philip/repos/git/t/trash directory.t4205-log-pretty-formats/.git/

[... ...]
+ git log --format=%<(5,mtrunc)%s -4
+ test_pause
+ PAUSE_TERM=dumb
+ PAUSE_SHELL=/bin/sh
+ PAUSE_HOME=/home/philip/repos/git/t/trash 
directory.t4205-log-pretty-formats
+ test 0 != 0
+ TERM=dumb HOME=/home/philip/repos/git/t/trash 
directory.t4205-log-pretty-formats /bin/sh
/bin/sh: 1: __git_ps1: not found
\w$ git status
On branch source-b
[...]
nothing added to commit but untracked files present (use "git add" to track)
/bin/sh: 1: __git_ps1: not found
I added the gits status to see when/where the warning was emitted.

[1] https://github.com/PhilipOakley/git/blob/doctrunc/t/t4205-log-pretty-formats.sh#L1021-L1046 [2] https://github.com/git/git/blob/master/t/test-lib-functions.sh#L137-L188

Any suggestions as to how to set this up correctly to avoid the warning? -- Philip

Next: Philip Oakley
Message 1 of 4 in “test_pause giving '__git_ps1: not found' warning”
  1. Philip OakleyJan 14, 2023
  2. Philip OakleyJan 14, 2023
  3. Jeff KingJan 16, 2023
  4. Philip OakleyJan 18, 2023

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.