# git submodule merge madness

7 messages from 2009-01-09 to 2009-01-15. Participants: Ask Bjørn Hansen, Andreas Ericsson, Johannes Schindelin, Sverre Rabbelier.
Thread: https://gitlist.dev/t/17068

## Ask Bjørn Hansen, 2009-01-09 21:50

Subject: git submodule merge madness
Message-ID: <ADC7A3B1-6756-4258-93CD-DB40C7D2793C@develooper.com>
URL: https://gitlist.dev/e/ADC7A3B1-6756-4258-93CD-DB40C7D2793C%40develooper.com

```
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, 2009-01-10 01:13

Subject: Re: git submodule merge madness
Message-ID: <F01C5A5A-1FA3-42EC-BEE7-46A6C0E7C5DF@develooper.com>
URL: https://gitlist.dev/e/F01C5A5A-1FA3-42EC-BEE7-46A6C0E7C5DF%40develooper.com
In-Reply-To: <ADC7A3B1-6756-4258-93CD-DB40C7D2793C@develooper.com>

```

On Jan 9, 2009, at 1:50 PM, Ask Bjørn Hansen wrote:

> 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, 2009-01-12 13:27

Subject: Re: git submodule merge madness
Message-ID: <496B4534.9020809@op5.se>
URL: https://gitlist.dev/e/496B4534.9020809%40op5.se
In-Reply-To: <ADC7A3B1-6756-4258-93CD-DB40C7D2793C@develooper.com>

```
Ask Bjørn Hansen wrote:
> 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, 2009-01-14 22:55

Subject: Re: git submodule merge madness
Message-ID: <alpine.DEB.1.00.0901142354120.3586@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0901142354120.3586%40pacific.mpi-cbg.de
In-Reply-To: <ADC7A3B1-6756-4258-93CD-DB40C7D2793C@develooper.com>

```
Hi,

On Fri, 9 Jan 2009, Ask Bjørn Hansen 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)?

Ciao,
Dscho

```

## Ask Bjørn Hansen, 2009-01-14 23:49

Subject: Re: git submodule merge madness
Message-ID: <AE1922C4-0543-424B-A635-494445E17E45@develooper.com>
URL: https://gitlist.dev/e/AE1922C4-0543-424B-A635-494445E17E45%40develooper.com
In-Reply-To: <alpine.DEB.1.00.0901142354120.3586@pacific.mpi-cbg.de>

```

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".


  - ask

-- 
http://develooper.com/ - http://askask.com/

```

## Sverre Rabbelier, 2009-01-15 00:32

Subject: Re: git submodule merge madness
Message-ID: <bd6139dc0901141632x6d3a0b6bl3abd489e155dc97d@mail.gmail.com>
URL: https://gitlist.dev/e/bd6139dc0901141632x6d3a0b6bl3abd489e155dc97d%40mail.gmail.com
In-Reply-To: <AE1922C4-0543-424B-A635-494445E17E45@develooper.com>

```
On Thu, Jan 15, 2009 at 00:49, Ask Bjørn Hansen <ask@develooper.com> wrote:
> 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, 2009-01-15 00:36

Subject: Re: git submodule merge madness
Message-ID: <alpine.DEB.1.00.0901150134530.3586@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0901150134530.3586%40pacific.mpi-cbg.de
In-Reply-To: <AE1922C4-0543-424B-A635-494445E17E45@develooper.com>

```
Hi,

On Wed, 14 Jan 2009, Ask Bjørn Hansen wrote:

> 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

```
