Git development
 help / color / mirror / Atom feed
* [PATCH 0/1] t7528: fix failure under csh
@ 2026-08-03  0:41 Kenneth Lorber
  2026-08-03  0:41 ` [PATCH 1/1] " Kenneth Lorber
  0 siblings, 1 reply; 3+ messages in thread
From: Kenneth Lorber @ 2026-08-03  0:41 UTC (permalink / raw)
  To: git
  Cc: Kenneth Lorber, redoste, Fabian Stelzer, Patrick Steinhardt,
	Junio C Hamano, Xi Ruoyao

The test suite fails at t7528 when run in an account with tcsh as
the login shell due to $SHELL being "/bin/tcsh"; similar behaviour
is expected under other csh-like shells.

From ssh-agent(1):
-s      Generate Bourne shell commands on stdout.  This is the  default
               if SHELL does not look like it's a csh style of shell.

This patch explicitly tells ssh-agent to use Bourne shell syntax, thus
removing a spurious test failure for users with csh style shells.

An alternative change would be to have test-lib.sh clear $SHELL; this
was rejected as potentially hiding additional similar errors.  There
are no such additional errors evident currently.

No additional tests are added as the error is in the setup for
testing, not an error in git itself.

Kenneth Lorber (1):
  t7528: fix failure under csh

 t/t7528-signed-commit-ssh.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] t7528: fix failure under csh
  2026-08-03  0:41 [PATCH 0/1] t7528: fix failure under csh Kenneth Lorber
@ 2026-08-03  0:41 ` Kenneth Lorber
  2026-08-03  2:13   ` brian m. carlson
  0 siblings, 1 reply; 3+ messages in thread
From: Kenneth Lorber @ 2026-08-03  0:41 UTC (permalink / raw)
  To: git
  Cc: Kenneth Lorber, redoste, Fabian Stelzer, Xi Ruoyao,
	Patrick Steinhardt, Junio C Hamano

Explicitly set sh mode for ssh-agent (ssh-agent -s) to prevent
failure when user's login shell is csh-like.  The failure is
caused by propagation of the $SHELL value from the user's original
shell despite the test and test harness explictly using sh, which
makes ssh-agent emit initialization code for the wrong shell:

> cd t
> echo $SHELL
/bin/tcsh
> ./t7528-signed-commit-ssh.sh --verbose --debug
[...]
expecting success of 7528.2 'sign commits using literal public keys with ssh-agent':
[...]
./t7528-signed-commit-ssh.sh: 1: eval: setenv: not found
./t7528-signed-commit-ssh.sh: 1: eval: setenv: not found
[...]

Signed-off-by: Kenneth Lorber <keni@his.com>
---
 t/t7528-signed-commit-ssh.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh
index b50306b9b3..7bf4a40de2 100755
--- a/t/t7528-signed-commit-ssh.sh
+++ b/t/t7528-signed-commit-ssh.sh
@@ -82,7 +82,7 @@ test_expect_success GPGSSH 'create signed commits' '
 test_expect_success GPGSSH 'sign commits using literal public keys with ssh-agent' '
 	test_when_finished "test_unconfig commit.gpgsign" &&
 	test_config gpg.format ssh &&
-	eval $(ssh-agent -T || ssh-agent) &&
+	eval $(ssh-agent -T -s || ssh-agent -s) &&
 	test_when_finished "kill ${SSH_AGENT_PID}" &&
 	test_when_finished "test_unconfig user.signingkey" &&
 	mkdir tmpdir &&
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] t7528: fix failure under csh
  2026-08-03  0:41 ` [PATCH 1/1] " Kenneth Lorber
@ 2026-08-03  2:13   ` brian m. carlson
  0 siblings, 0 replies; 3+ messages in thread
From: brian m. carlson @ 2026-08-03  2:13 UTC (permalink / raw)
  To: Kenneth Lorber
  Cc: git, redoste, Fabian Stelzer, Xi Ruoyao, Patrick Steinhardt,
	Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 1984 bytes --]

On 2026-08-03 at 00:41:03, Kenneth Lorber wrote:
> Explicitly set sh mode for ssh-agent (ssh-agent -s) to prevent
> failure when user's login shell is csh-like.  The failure is
> caused by propagation of the $SHELL value from the user's original
> shell despite the test and test harness explictly using sh, which
> makes ssh-agent emit initialization code for the wrong shell:
> 
> > cd t
> > echo $SHELL
> /bin/tcsh
> > ./t7528-signed-commit-ssh.sh --verbose --debug
> [...]
> expecting success of 7528.2 'sign commits using literal public keys with ssh-agent':
> [...]
> ./t7528-signed-commit-ssh.sh: 1: eval: setenv: not found
> ./t7528-signed-commit-ssh.sh: 1: eval: setenv: not found
> [...]
> 
> Signed-off-by: Kenneth Lorber <keni@his.com>
> ---
>  t/t7528-signed-commit-ssh.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t7528-signed-commit-ssh.sh b/t/t7528-signed-commit-ssh.sh
> index b50306b9b3..7bf4a40de2 100755
> --- a/t/t7528-signed-commit-ssh.sh
> +++ b/t/t7528-signed-commit-ssh.sh
> @@ -82,7 +82,7 @@ test_expect_success GPGSSH 'create signed commits' '
>  test_expect_success GPGSSH 'sign commits using literal public keys with ssh-agent' '
>  	test_when_finished "test_unconfig commit.gpgsign" &&
>  	test_config gpg.format ssh &&
> -	eval $(ssh-agent -T || ssh-agent) &&
> +	eval $(ssh-agent -T -s || ssh-agent -s) &&
>  	test_when_finished "kill ${SSH_AGENT_PID}" &&
>  	test_when_finished "test_unconfig user.signingkey" &&
>  	mkdir tmpdir &&

This seems reasonable.  SHELL is defined by POSIX as "a pathname of the
user's preferred command language interpreter."  When we're running the
testsuite, we don't care what that is and always want a POSIX
sh-compatible output, so using `-s` is the right thing.

I also don't see any other instances of `ssh-agent` in the codebase, so
this looks like the only place we need to fix.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-03  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03  0:41 [PATCH 0/1] t7528: fix failure under csh Kenneth Lorber
2026-08-03  0:41 ` [PATCH 1/1] " Kenneth Lorber
2026-08-03  2:13   ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox