{"thread":{"id":"61367","subject":"Issue related to git submodules, tracking branches and custom remote names","startedAt":"2024-04-25T13:03:22Z","lastAt":"2024-04-25T13:03:22Z","messageCount":1,"participants":["Sergiu Todirascu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"493470","messageId":"A46E73E9-2718-4243-8835-B69AB1DA39D1@getstoryteller.com","threadId":"61367","inReplyTo":null,"subject":"Issue related to git submodules, tracking branches and custom remote names","fromName":"Sergiu Todirascu","fromEmail":"sergiu@getstoryteller.com","sentAt":"2024-04-25T13:00:52Z","receivedAt":"2024-04-25T13:03:22Z","isPatch":false,"sender":{"key":"sergiu@getstoryteller.com","avatar":null},"body":"Hi, \nI think there's an unexpected behaviour related to git submodules, tracking branches and custom remote names.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n1. Inside any git repo add a submodule via `git submodule add -b <branch> <repo-url>`\n2. git submodule update --init\n3. cd <submodule-repo> && git remote rename origin internal\n3. git submodule update --remote\n\nWhat did you expect to happen? (Expected behavior)\n\nCommand should be successful with: `Submodule path '<submodule>': checked out 'commit-hash'`\n\nWhat happened instead? (Actual behavior)\n\n`fatal: Unable to find refs/remotes/origin/branch revision in submodule path '<submodule>'`\n\nWhat's different between what you expected and what actually happened?\n\nAs you can see in the error message, it's looking for the branch in the `origin` remote, which was renamed to `internal`.\n\nAnything else you want to add:\n\nI'd expect for git to either properly detect the changed remote or be able to specify it somewhere. I've looked into the https://git-scm.com/docs/gitmodules reference and couldn't find a setting for setting a custom remote there.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.39.3 (Apple Git-145)\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64\ncompiler info: clang: 15.0.0 (clang-1500.1.0.2.5)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\ncommit-msg\npost-commit\npre-merge-commit\n\nThanks for looking into it,\nSergiu\n\n"}]}