threads / discuss / 17068

git submodule merge madness

Subject: git submodule merge madness

## tl;dr

7 messages between Jan 9, 2009 and Jan 15, 2009.

replies: 6people: 4as markdown or json

Ask Bjørn Hansen· Jan 9, 2009, 21:50 UTC · lore
Hi,

We've (again) replaced a few directories with submodules. Man, it's madness!

The typical problem is that we get an error trying to merge a "pre- submodule" branch into master:

	fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584  
'some/sub/dir': It is a submodule!
Mark Levedahl wrote an example in July, but I don't think he got any  
replies:  http://marc.info/?l=git&m=121587851313303
Any ideas?   Is there something we can do?    I see a strong  
correlation between adding a new submodule and the number of "git  
sucks" messages on our internal IRC server.
  - ask
-- 
http://develooper.com/ - http://askask.com/
Ask Bjørn Hansen· Jan 10, 2009, 01:13 UTC · re: Ask Bjørn Hansen · lore

Re: git submodule merge madness

On Jan 9, 2009, at 1:50 PM, Ask Bjørn Hansen wrote:
Show 8 quoted lines
> The typical problem is that we get an error trying to merge a "pre- 
> submodule" branch into master:
>
> 	fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584  
> 'some/sub/dir': It is a submodule!
>
> Mark Levedahl wrote an example in July, but I don't think he got any  
> replies:  http://marc.info/?l=git&m=121587851313303
Replying to myself for the archives:

Looking in the code I noticed it's the recursive merge algorithm giving that error. Making it use the resolve strategy ("git merge -s resolve") made it work in the cases I had today, yay.

  - ask
-- 
http://develooper.com/ - http://askask.com/
Andreas Ericsson· Jan 12, 2009, 13:27 UTC · re: Ask Bjørn Hansen · lore

Re: git submodule merge madness

Ask Bjørn Hansen wrote:
Show 16 quoted lines
> Hi,
> 
> We've (again) replaced a few directories with submodules.  Man, it's 
> madness!
> 
> The typical problem is that we get an error trying to merge a 
> "pre-submodule" branch into master:
> 
>     fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584 
> 'some/sub/dir': It is a submodule!
> Mark Levedahl wrote an example in July, but I don't think he got any 
> replies:  http://marc.info/?l=git&m=121587851313303
> Any ideas?   Is there something we can do?    I see a strong correlation 
> between adding a new submodule and the number of "git sucks" messages on 
> our internal IRC server.
> 

Well, reworking the repository structure (which is essentially what you're doing) should be a flag day. Merge stuff before that and mark it in some way so that you don't run into the problems you're seeing now.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Johannes Schindelin· Jan 14, 2009, 22:55 UTC · re: Ask Bjørn Hansen · lore

Re: git submodule merge madness

Hi,
On Fri, 9 Jan 2009, Ask Bjørn Hansen wrote:
Show 10 quoted lines
> We've (again) replaced a few directories with submodules.  Man, it's 
> madness!
> 
> The typical problem is that we get an error trying to merge a "pre-submodule"
> branch into master:
> 
> 	fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584
> 'some/sub/dir': It is a submodule!
> Mark Levedahl wrote an example in July, but I don't think he got any replies:
> http://marc.info/?l=git&m=121587851313303

So.... Which Git version are you are using? Did you test any Git version containing the commit d5a84fb(merge-recursive: fail gracefully with directory/submodule conflicts)?

Ciao, Dscho

Ask Bjørn Hansen· Jan 14, 2009, 23:49 UTC · re: Johannes Schindelin · lore

Re: git submodule merge madness

On Jan 14, 2009, at 2:55 PM, Johannes Schindelin wrote:
Show 17 quoted lines
>> We've (again) replaced a few directories with submodules.  Man, it's
>> madness!
>>
>> The typical problem is that we get an error trying to merge a "pre- 
>> submodule"
>> branch into master:
>>
>> 	fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584
>> 'some/sub/dir': It is a submodule!
>> Mark Levedahl wrote an example in July, but I don't think he got  
>> any replies:
>> http://marc.info/?l=git&m=121587851313303
>
> So.... Which Git version are you are using?  Did you test any Git  
> version
> containing the commit d5a84fb(merge-recursive: fail gracefully with
> directory/submodule conflicts)?
IIRC I tried 1.6.1 and master as of about a week ago.

I don't see d5a84fb in my repository (and google doesn't find it referenced anywhere when I search for "directory/submodule conflicts".

  - ask
-- 
http://develooper.com/ - http://askask.com/
Sverre Rabbelier· Jan 15, 2009, 00:32 UTC · re: Ask Bjørn Hansen · lore

Re: git submodule merge madness

On Thu, Jan 15, 2009 at 00:49, Ask Bjørn Hansen <ask@develooper.com> wrote:
Show 9 quoted lines
> On Jan 14, 2009, at 2:55 PM, Johannes Schindelin wrote:
>> So.... Which Git version are you are using?  Did you test any Git version
>> containing the commit d5a84fb(merge-recursive: fail gracefully with
>> directory/submodule conflicts)?
>
> IIRC I tried 1.6.1 and master as of about a week ago.
>
> I don't see d5a84fb in my repository (and google doesn't find it referenced
> anywhere when I search for "directory/submodule conflicts".

I checked current master: $ git log --grep="fail gracefully with" returns nothing. Searching the archive I don't see any reference to "fail gracefully with" either. I don't see it on your gitweb [0] either. Did that commit magically dissapear?

[0] http://repo.or.cz/w/git/dscho.git
-- 
Cheers,

Sverre Rabbelier
Johannes Schindelin· Jan 15, 2009, 00:36 UTC · re: Ask Bjørn Hansen · lore

Re: git submodule merge madness

Hi,
On Wed, 14 Jan 2009, Ask Bjørn Hansen wrote:
Show 22 quoted lines
> On Jan 14, 2009, at 2:55 PM, Johannes Schindelin wrote:
> 
> > >We've (again) replaced a few directories with submodules.  Man, it's 
> > >madness!
> > >
> > >The typical problem is that we get an error trying to merge a 
> > >"pre-submodule" branch into master:
> > >
> > >	fatal: cannot read object 894c77319a18c4d48119c2985a9275c9f5883584
> > >'some/sub/dir': It is a submodule!
> > >Mark Levedahl wrote an example in July, but I don't think he got any
> > >replies:
> > >http://marc.info/?l=git&m=121587851313303
> >
> >So.... Which Git version are you are using?  Did you test any Git version
> >containing the commit d5a84fb(merge-recursive: fail gracefully with
> >directory/submodule conflicts)?
> 
> IIRC I tried 1.6.1 and master as of about a week ago.
> 
> I don't see d5a84fb in my repository (and google doesn't find it referenced
> anywhere when I search for "directory/submodule conflicts".

Well. Can do arithmetics in my head after midnight, but not think straight...

In any case, could you please provide a patch to the testsuite demonstrating the problem? History shows that such patches are very helpful.

Ciao, Dscho

← back to recent threads