* Problem switching branches in submodule
@ 2013-09-26 17:20 Manish Gill
2013-09-26 18:08 ` Jonathan Nieder
2013-09-26 23:44 ` Duy Nguyen
0 siblings, 2 replies; 6+ messages in thread
From: Manish Gill @ 2013-09-26 17:20 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 785 bytes --]
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
Here, Mailman3 is the primary repository and "rest_project" is a
submodule. I can do "git checkout" just fine
inside rest_project, but not after cd-ing into any other repos.
My git version is 1.8.4
Other commands, like git status, push/pull are working fine.
I'd appreciate any help. Thank you.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problem switching branches in submodule
2013-09-26 17:20 Problem switching branches in submodule Manish Gill
@ 2013-09-26 18:08 ` Jonathan Nieder
2013-09-26 18:33 ` Manish Gill
2013-09-26 23:44 ` Duy Nguyen
1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-09-26 18:08 UTC (permalink / raw)
To: Manish Gill; +Cc: git, Nguyễn Thái Ngọc Duy
(cc-ing Duy, who knows the setup code well)
Manish Gill wrote:
> 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
>
> Here, Mailman3 is the primary repository and "rest_project" is a
> submodule. I can do "git checkout" just fine
> inside rest_project, but not after cd-ing into any other repos.
>
> My git version is 1.8.4
>
> Other commands, like git status, push/pull are working fine.
Interesting. Yeah, this shouldn't happen.
What is the exact command you use to get the above output? Is your
repository public (which would let us reproduce it) or can you
reproduce it by creating a small artificial test repository?
For comparison, did some previous version of git work ok in the same
scenario, or is this the first time you've tried it?
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problem switching branches in submodule
2013-09-26 18:08 ` Jonathan Nieder
@ 2013-09-26 18:33 ` Manish Gill
2013-09-26 18:48 ` Jonathan Nieder
0 siblings, 1 reply; 6+ messages in thread
From: Manish Gill @ 2013-09-26 18:33 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Nguyễn Thái Ngọc Duy
[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]
On 09/26/2013 11:38 PM, Jonathan Nieder wrote:
> (cc-ing Duy, who knows the setup code well)
> Manish Gill wrote:
>
>> 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
>>
>> Here, Mailman3 is the primary repository and "rest_project" is a
>> submodule. I can do "git checkout" just fine
>> inside rest_project, but not after cd-ing into any other repos.
>>
>> My git version is 1.8.4
>>
>> Other commands, like git status, push/pull are working fine.
>
> Interesting. Yeah, this shouldn't happen.
>
> What is the exact command you use to get the above output?
git checkout <branch_name>
Is your
> repository public (which would let us reproduce it) or can you
> reproduce it by creating a small artificial test repository
The repo isn't public, I'm afraid.
I should mention what *exactly* happened that led to this. I was trying
to publish my branch on Launchpad (using git-remote-bzr). At some point,
I had the genius idea to remote the extra stuff from the config file and
just try with the bzr:: remote as origin, and instead of doing it via
the console, I just replaced the config file.
Annnnyway, I just restored my backed up config file for that submodule
in the middle of writing this and seems like things seem to work now.
I dunno, this was most likely because of some configuration derp on my
part (the new config file didn't contain the branch information most
likely). So I guess problem solved!
Thanks for your help.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problem switching branches in submodule
2013-09-26 18:33 ` Manish Gill
@ 2013-09-26 18:48 ` Jonathan Nieder
2013-09-26 19:29 ` Manish Gill
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Nieder @ 2013-09-26 18:48 UTC (permalink / raw)
To: Manish Gill; +Cc: git, Nguyễn Thái Ngọc Duy
Manish Gill wrote:
> Jonathan Nieder wrote:
>> What is the exact command you use to get the above output?
>
> git checkout <branch_name>
Is <branch_name> a normal branch, a remote-tracking branch, or a
branch that doesn't exist yet?
[...]
> I should mention what *exactly* happened that led to this. I was trying
> to publish my branch on Launchpad (using git-remote-bzr). At some point,
> I had the genius idea to remote the extra stuff from the config file and
> just try with the bzr:: remote as origin, and instead of doing it via
> the console, I just replaced the config file.
>
> Annnnyway, I just restored my backed up config file for that submodule
> in the middle of writing this and seems like things seem to work now.
If you happen to have a copy of the old config file or remember what it
said, that could be helpful (especially if you can still reproduce the
problem in case we come up with a fix).
Did the config file have a [core] worktree setting or something similar?
Hmm,
Jonathan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problem switching branches in submodule
2013-09-26 18:48 ` Jonathan Nieder
@ 2013-09-26 19:29 ` Manish Gill
0 siblings, 0 replies; 6+ messages in thread
From: Manish Gill @ 2013-09-26 19:29 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, Nguyễn Thái Ngọc Duy
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
On 09/27/2013 12:18 AM, Jonathan Nieder wrote:
> Manish Gill wrote:
>> Jonathan Nieder wrote:
>
>>> What is the exact command you use to get the above output?
>>
>> git checkout <branch_name>
>
> Is <branch_name> a normal branch, a remote-tracking branch, or a
> branch that doesn't exist yet?
Local branch that was supposed to track a remote branch.
>
> [...]
>> I should mention what *exactly* happened that led to this. I was trying
>> to publish my branch on Launchpad (using git-remote-bzr). At some point,
>> I had the genius idea to remote the extra stuff from the config file and
>> just try with the bzr:: remote as origin, and instead of doing it via
>> the console, I just replaced the config file.
>>
>> Annnnyway, I just restored my backed up config file for that submodule
>> in the middle of writing this and seems like things seem to work now.
>
> If you happen to have a copy of the old config file or remember what it
> said, that could be helpful (especially if you can still reproduce the
> problem in case we come up with a fix).
Config file which was NOT working:
http://bpaste.net/show/oaWG3TQarH3BrdjDj5be/
Working config restored from backup:
http://bpaste.net/show/nF3ap5fDEAwL9NyqdCmD/
>
> Did the config file have a [core] worktree setting or something similar?
Looks like the working one had it and the other didn't. Adding the
"worktree" setting seems to fix the problem. But shouldn't this work
uniformly in the repo? Removing the [core] worktree gives the same
error, but only in directories inside the repo. Checkout still works on
the top-level. Seems a bit strange I guess.
>
> Hmm,
> Jonathan
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 555 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problem switching branches in submodule
2013-09-26 17:20 Problem switching branches in submodule Manish Gill
2013-09-26 18:08 ` Jonathan Nieder
@ 2013-09-26 23:44 ` Duy Nguyen
1 sibling, 0 replies; 6+ messages in thread
From: Duy Nguyen @ 2013-09-26 23:44 UTC (permalink / raw)
To: Manish Gill; +Cc: Git Mailing List, Jonathan Nieder
On Fri, Sep 27, 2013 at 12:20 AM, Manish Gill <mgill25@outlook.com> wrote:
> 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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-26 23:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26 17:20 Problem switching branches in submodule Manish Gill
2013-09-26 18:08 ` Jonathan Nieder
2013-09-26 18:33 ` Manish Gill
2013-09-26 18:48 ` Jonathan Nieder
2013-09-26 19:29 ` Manish Gill
2013-09-26 23:44 ` Duy Nguyen
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 NNTP newsgroup(s).