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

Git submodule ssh command recursion bug

From
DWDavid Weber <dave@veryflatcat.com>
Date
Feb 2, 2024, 09:59 UTC
Message-ID
<FB27DE07-1C5A-4E2F-8BE6-8AC958365C9B@veryflatcat.com>

What did you do before the bug happened? (Steps to reproduce your issue) I attempted to run `git -c core.sshCommand="ssh -i ~/.ssh/my_key" submodule update --init --recursive` in a repo with three submodules. The first was a public repository and the 2nd and 3rd required the private key that I specified as above.

What did you expect to happen? (Expected behaviour) I expected all the submodules to be updated

What happened instead? (Actual behaviour) The public repository was correctly checked out. The private ones were not checked out and I was asked for a user name for the repository.

What's different between what you expected and what actually happened? I expected git to use the private key provided and not ask for user name.

Anything else you want to add: If I did the following then the command worked as expected:

  EXPORT GIT_SSH_COMMAND="ssh -i ~/.ssh/my_key"
  submodule update --init --recursive

Then all submodules update as expected. I assume this is because the `-c core.sshCommand` is not propagated to the underlying operations that perform the task of checking out the modules.

I have the same behaviour on Linux and OSX.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.34.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 compiler info: gnuc: 11.4 libc info: glibc: 2.35 $SHELL (typically, interactive shell): /usr/bin/zsh

[Enabled Hooks]
Message 1 of 1 in “Git submodule ssh command recursion bug”
  1. David WeberFeb 2, 2024

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.