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

Re: git-subtree: directory mismatch

From
MFMarc Fournier <marc.fournier@camptocamp.com>
Date
Nov 25, 2009, 14:32 UTC
Message-ID
<20091125143204.GA9834@lonquimay.wrk.lsn.camptocamp.com>
In-Reply-To
<32541b130911241348s21e21fb8n12edf374e6a3c309@mail.gmail.com>
On Tue, Nov 24, 2009 at 04:48:26PM -0500, Avery Pennarun wrote:
Show 15 quoted lines
> On Tue, Nov 24, 2009 at 2:53 PM, Marc Fournier
> <marc.fournier@camptocamp.com> wrote:
> > I was not able to reproduce this bug in any of the following cases:
> >  - if the README file wasn't empty
> >  - if modules/cognac is renamed to something else
> >  - if modules/cognac doesn't have the same sub-directories than
> >   modules/mapserver
> >
> > This bug happens using git 1.5.5.6 as well as 1.6.5. It seems to happen
> > when git-subtree calls "git merge -s subtree".
> 
> Yup.  This is basically a bug in "git merge -s subtree": it guesses
> which subtree to merge into, rather than actually taking a prefix
> parameter.  I've been meaning to either submit a patch for this, or
> find a way to work around it.
I see. What sort of criteria does git-merge use to do this auto-guessing ?

I'm hoping to find a way to workaround this problem. I have a couple of subtrees I'm completely unable to update. The best I found is: "git rm -fr ..." followed by "git subtree add ..." again.

> This doesn't usually happen once your project is relatively mature
> (ie. doesn't have blank or "default" template files in it) since then
> the auto-guessing gets more reliable.  But there's no good reason to
> do the auto-guessing, so it would be best to do this "properly."

The thing is I use dozens of different "modules" in my project, all merged into using git-subtree. All these modules have the same structure, and most of them have quite minimal content and won't really evolve more. In my case, evolution will mean adding even more modules.

If I understand the thread Nanako Shiraishi pointed us to, a patch implementing a prefix to "git merge -s subtree" is available somewhere but hasn't been added in any official release yet ?

Marc
Previous: Avery Pennarun
Message 12 of 12 in “git-subtree: directory mismatch”
  1. Marc FournierNov 24, 2009
  2. Avery PennarunNov 24, 2009
  3. Nanako ShiraishiNov 24, 2009
  4. Avery PennarunNov 25, 2009
  5. Junio C HamanoNov 25, 2009
  6. Avery PennarunNov 25, 2009
  7. Junio C HamanoNov 25, 2009
  8. Johannes SchindelinNov 25, 2009
  9. Avery PennarunNov 25, 2009
  10. Björn SteinbrinkNov 25, 2009
  11. Avery PennarunNov 25, 2009
  12. Marc FournierNov 25, 2009

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.