Message ID | bf916ad98ccc1526f5298d1c3e1740cabad093af.1629393395.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | test-lib-functions.sh: keep user's HOME, TERM and SHELL for 'test_pause' and 'debug' | expand |
On Thu, Aug 19, 2021 at 10:17 AM Philippe Blain via GitGitGadget <gitgitgadget@gmail.com> wrote: > > From: Philippe Blain <levraiphilippeblain@gmail.com> > > The 'test_pause' function, which is designed to help interactive > debugging and exploration of tests, currently inherits the value of HOME > and TERM set by 'test-lib.sh': HOME="$TRASH_DIRECTORY" and TERM=dumb. It > also invokes the shell defined by SHELL_PATH, which defaults to /bin/sh. that is a bug, it should have been TEST_SHELL_PATH instead. goes without saying, that if you don't really need that shell for your interactive session, nothing prevents you from calling bash and resetting TERM or even HOME as needed Carlo
Hi Carlo, Le 2021-08-19 à 23:08, Carlo Arenas a écrit : > On Thu, Aug 19, 2021 at 10:17 AM Philippe Blain via GitGitGadget > <gitgitgadget@gmail.com> wrote: >> >> From: Philippe Blain <levraiphilippeblain@gmail.com> >> >> The 'test_pause' function, which is designed to help interactive >> debugging and exploration of tests, currently inherits the value of HOME >> and TERM set by 'test-lib.sh': HOME="$TRASH_DIRECTORY" and TERM=dumb. It >> also invokes the shell defined by SHELL_PATH, which defaults to /bin/sh. > > that is a bug, it should have been TEST_SHELL_PATH instead. Right. I'll make that change unconditionnally as a preparatory step. > > goes without saying, that if you don't really need that shell for your > interactive session, nothing prevents you from calling bash and > resetting TERM or even HOME as needed Yes. I'm just trying to streamline to experience :)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index e28411bb75a..662cfc4c3e0 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -139,7 +139,7 @@ test_tick () { # Be sure to remove all invocations of this command before submitting. test_pause () { - "$SHELL_PATH" <&6 >&5 2>&7 + TERM="$USER_TERM" HOME="$USER_HOME" "$SHELL" <&6 >&5 2>&7 } # Wrap git with a debugger. Adding this to a command can make it easier diff --git a/t/test-lib.sh b/t/test-lib.sh index abcfbed6d61..132618991e2 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -585,8 +585,9 @@ else } fi +USER_TERM="$TERM" TERM=dumb -export TERM +export TERM USER_TERM error () { say_color error "error: $*" @@ -1380,9 +1381,10 @@ then fi # Last-minute variable setup +USER_HOME="$HOME" HOME="$TRASH_DIRECTORY" GNUPGHOME="$HOME/gnupg-home-not-used" -export HOME GNUPGHOME +export HOME GNUPGHOME USER_HOME # Test repository rm -fr "$TRASH_DIRECTORY" || {