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

Re: Problem switching branches in submodule

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 26, 2013, 23:44 UTC
Message-ID
<CACsJy8DifMCL4QZV_jxgHaL1MLDi6nrgBTSuBcB69btfOJOWvA@mail.gmail.com>
In-Reply-To
<BLU0-SMTP17403D5452DA1619FEFCCBAB8280@phx.gbl>
On Fri, Sep 27, 2013 at 12:20 AM, Manish Gill <mgill25@outlook.com> wrote:
Show 14 quoted lines
> Hello,
>
> I have a git repository with lots of submodules. In one particular
> submodule, I'm having the following problem:
>
> If I try to switch branches at the top-level of that submodule, I succeed.
>
> But, if I try to switch branches in any subsequen levels, I get the
> following error:
>
>     fatal: internal error: work tree has already been set
>     Current worktree: ../path/Mailman3/rest_project
>     New worktree: ../path/Mailman3/rest_project/website/public_rest
>

Can you apply this patch, rebuild git and retry again? It will create a coredump at "fatal:...", which might give me a clue what's going on.. Once you get the coredump, open it with gdb, execute "bt full" and paste the output here.

diff --git a/usage.c b/usage.c
index ed14645..0403091 100644
--- a/usage.c
+++ b/usage.c
@@ -34,6 +34,7 @@ static NORETURN void usage_builtin(const char *err,
va_list params)
 static NORETURN void die_builtin(const char *err, va_list params)
 {
        vreportf("fatal: ", err, params);
+       *(char*)0 = 1;
        exit(128);
 }
-- 
Duy
Previous: Manish Gill
Message 6 of 6 in “Problem switching branches in submodule”
  1. Manish GillSep 26, 2013
  2. Jonathan NiederSep 26, 2013
  3. Manish GillSep 26, 2013
  4. Jonathan NiederSep 26, 2013
  5. Manish GillSep 26, 2013
  6. Duy NguyenSep 26, 2013

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.