git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sergiu Todirascu <Sergiu@getstoryteller.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Issue related to git submodules, tracking branches and custom remote names
Date: Thu, 25 Apr 2024 13:00:52 +0000	[thread overview]
Message-ID: <A46E73E9-2718-4243-8835-B69AB1DA39D1@getstoryteller.com> (raw)

Hi, 
I think there's an unexpected behaviour related to git submodules, tracking branches and custom remote names.

What did you do before the bug happened? (Steps to reproduce your issue)

1. Inside any git repo add a submodule via `git submodule add -b <branch> <repo-url>`
2. git submodule update --init
3. cd <submodule-repo> && git remote rename origin internal
3. git submodule update --remote

What did you expect to happen? (Expected behavior)

Command should be successful with: `Submodule path '<submodule>': checked out 'commit-hash'`

What happened instead? (Actual behavior)

`fatal: Unable to find refs/remotes/origin/branch revision in submodule path '<submodule>'`

What's different between what you expected and what actually happened?

As you can see in the error message, it's looking for the branch in the `origin` remote, which was renamed to `internal`.

Anything else you want to add:

I'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.

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.39.3 (Apple Git-145)
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: 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
compiler info: clang: 15.0.0 (clang-1500.1.0.2.5)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
commit-msg
post-commit
pre-merge-commit

Thanks for looking into it,
Sergiu



                 reply	other threads:[~2024-04-25 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A46E73E9-2718-4243-8835-B69AB1DA39D1@getstoryteller.com \
    --to=sergiu@getstoryteller.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).