Skip to content

porcelain: honor Git SSH command env vars#2274

Draft
aouxwoux wants to merge 2 commits into
jelmer:mainfrom
aouxwoux:codex/porcelain-ssh-env-command
Draft

porcelain: honor Git SSH command env vars#2274
aouxwoux wants to merge 2 commits into
jelmer:mainfrom
aouxwoux:codex/porcelain-ssh-env-command

Conversation

@aouxwoux

@aouxwoux aouxwoux commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • restore porcelain-level GIT_SSH_COMMAND / GIT_SSH handling for remote transports
  • keep explicit ssh_command= precedence over environment defaults
  • add regression coverage for SSH command env precedence and porcelain transport forwarding

Fixes #2209

Verification

  • python -m unittest tests.cli.test_cli.SshCommandFromEnvTest tests.porcelain.TransportKwargsTests tests.test_client.SSHGitClientTests
  • python -m ruff check dulwich/porcelain/__init__.py tests/porcelain/__init__.py
  • git diff --check

Also attempted python -m unittest tests.porcelain on Windows; it reached unrelated symlink tests that require symlink privileges and failed with WinError 1314.

@jelmer

jelmer commented Jul 6, 2026

Copy link
Copy Markdown
Owner

I realize this is still marked as draft, but please note that GIT_SSH_COMMAND is now in dulwich.cli; we shouldn't support it in two places. If you think it should be elsewhere, let's have that discussion first.

@aouxwoux

aouxwoux commented Jul 7, 2026

Copy link
Copy Markdown
Author

Thanks, agreed. I pushed a follow-up that removes the porcelain-level GIT_SSH_COMMAND / GIT_SSH lookup and the tests for it, so this no longer adds a second place that supports those env vars.

For #2209, the remaining question is policy: the repro is via porcelain.clone(), while env handling currently lives in dulwich.cli. I'll leave this as draft unless you'd like to discuss moving that behavior or documenting explicit ssh_command= for porcelain callers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GIT_SSH_COMMAND brokne since 1.2.1

2 participants