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

Re: Re: Re: Updating a submodule with a compatible version from another submodule version using the parent meta-repository

From
JIJulian Ibarz <julian.ibarz@gmail.com>
Date
Feb 12, 2011, 20:32 UTC
Message-ID
<AANLkTimist_GXgRGdUW1PpxpRO=poYgD4HkDC5CsyLra@mail.gmail.com>
In-Reply-To
<20110209193610.GA67890@book.hvoigt.net>
Hi Heiko,

Thanks for all your feedbacks. Before your first mail I had already implemented command 1 you are talking about and almost finished command 2. Today I could spend some time again on this side project and I have finished command 2. Here is what you do:

git submodulecheckout --find-versions <submodule> > <some_temp_file> cd <submodule> git submodulecheckout --find-closest < <some_temp_file>

This will output the version you need to checkout in the meta repository. I don't handle the case where there is multiple solutions but it is a good start I think. I think with this you can already start the integration in the submodule bash script to make it recursive and be more user-friendly? Are you still interested Heiko?

I have pushed this to my repository so you can check it out if you want.

Both commands have a suboptimal implementation but it can be improved without changing the current API so I think it is a minor issue. I will probably try this at work today on msysgit. Currently I am doing this at home on my linux using some open source meta-repository, if you have a big one to try this feature let me know (I am currently using git://git.assembla.com/luadocsuperforest.git and it is not that big).

Best regards,
Julian Ibarz
On Wed, Feb 9, 2011 at 2:36 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
Show 20 quoted lines
> Hi Julian,
>
> On Wed, Feb 02, 2011 at 11:31:40PM -0500, Julian Ibarz wrote:
>> So now my two questions that could save me some time are:
>> - is there a function that gives the distance between two commits? I'm
>> sure there is something like this coded somewhere but I didn't find it
>> yet
>
> One thing which now came to my mind is that you might be interested in
> is to use merge bases to find the earliest commit that contains a
> certain revision.
>
> Have a look at how I implemented the submodule merge strategy that might
> help you. You can find it in commit 68d03e4a. I basically do a search
> for the earliest commit that contains the commits from both sides. You
> could use a similar strategy but limit the possible candidates to a
> restricted list of commits which are contained in the supermodule.
>
> Cheers Heiko
>
Previous: Heiko VoigtNext: Heiko Voigt
Message 16 of 20 in “Updating a submodule with a compatible version from another submodule version using the parent meta-repository”
  1. Julian IbarzJan 26, 2011
  2. Jens LehmannJan 26, 2011
  3. Julian IbarzJan 26, 2011
  4. Jens LehmannJan 26, 2011
  5. Julian IbarzJan 26, 2011
  6. Jens LehmannJan 26, 2011
  7. Julian IbarzJan 26, 2011
  8. Junio C HamanoJan 26, 2011
  9. Julian IbarzJan 26, 2011
  10. Junio C HamanoJan 26, 2011
  11. Heiko VoigtJan 29, 2011
  12. Julian IbarzJan 30, 2011
  13. Julian IbarzFeb 3, 2011
  14. Heiko VoigtFeb 6, 2011
  15. Heiko VoigtFeb 9, 2011
  16. Julian IbarzFeb 12, 2011
  17. Heiko VoigtFeb 13, 2011
  18. Julian IbarzFeb 13, 2011
  19. Heiko VoigtFeb 14, 2011
  20. Julian IbarzFeb 20, 2011

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.