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

Re: submodule init problem

From
SVSven Verdoolaege <skimo@kotnet.org>
Date
Jul 25, 2007, 08:15 UTC
Message-ID
<20070725081508.GN1591MdfPADPa@greensroom.kotnet.org>
In-Reply-To
<20070602074410.GA955MdfPADPa@greensroom.kotnet.org>
On Tue, Jul 24, 2007 at 06:49:26PM -0700, Junio C Hamano wrote:
> Ok, this appears it most likely to be related to the fact that
> one is a prefix of the other in problematic case.

Yes, this has been noted before and Chris Larson sent in a patch, but he didn't follow up on it.

On Fri, Jul 20, 2007 at 07:36:43PM +0100, Johannes Schindelin wrote:
Show 20 quoted lines
> Hi,
> 
> On Fri, 20 Jul 2007, Junio C Hamano wrote:
> 
> > "Chris Larson" <clarson@kergoth.com> writes:
> > 
> > > +       name=$(GIT_CONFIG=.gitmodules git config --get-regexp
> > > '^submodule\..*\.path$' "^$path$" |
> > >        sed -nre 's/^submodule\.(.+)\.path .+$/\1/p')
> 
> I wonder why it is a regular expression to begin with, since we seem to 
> prefer shell patterns on paths.
> 
> However, _if_ we already go with regexps, why not just put it into the 
> "sed" call, which is _already_ there, and leave "git config" alone?  IOW 
> call
> 
> 	git config --get-regexp '^submodule\..*\.path$' |
> 		sed -nre 's/^submodule\.(.*$path.*)\.path .+$\1/p'
>

You would be matching the key (the name of the module) rather than the value (the path of the module) here.

Anyway, I'm not sure why Lars went for the regexp. I thought he wanted to match the path exactly, which is why I originally proposed (the more clunky)

On Sat, Jun 02, 2007 at 09:44:10AM +0200, Sven Verdoolaege wrote:
Show 13 quoted lines
> On Sat, Jun 02, 2007 at 09:13:55AM +0200, Lars Hjemli wrote:
> > But I don't see an easy way to do the mapping from path to url/submodule 
> > with:
> > 
> > [submodule "xyzzylib"]
> >  path=lib
> >  url=git://xyzzy/lib-1.2.3
> > 
> > Suggestions?
> 
> I'm not a shell programmer, but it could look something like this
> 
>     $ name=$(git config --get-regexp 'submodule\..*\.path' | while read module modulepath; do if test "$modulepath" = "$path"; then echo $module | sed -e 's/^submodule.//' -e 's/.path//'; fi; done)
skimo
Previous: Lars HjemliNext: Lars Hjemli
Message 21 of 31 in “Let .git/config specify the url for submodules”
  1. Let .git/config specify the url for submodulesLars Hjemli, May 28, 2007
  2. Lars HjemliMay 31, 2007
  3. Junio C HamanoMay 31, 2007
  4. Josef WeidendorferJun 1, 2007
  5. Lars HjemliJun 1, 2007
  6. Sven VerdoolaegeJun 1, 2007
  7. Lars HjemliJun 1, 2007
  8. Sven VerdoolaegeJun 1, 2007
  9. Lars HjemliJun 1, 2007
  10. Sven VerdoolaegeJun 1, 2007
  11. Lars HjemliJun 1, 2007
  12. Linus TorvaldsJun 1, 2007
  13. Junio C HamanoJun 1, 2007
  14. Lars HjemliJun 2, 2007
  15. Sven VerdoolaegeJun 2, 2007
  16. Lars HjemliJun 2, 2007
  17. Junio C HamanoJun 2, 2007
  18. Lars HjemliJun 2, 2007
  19. Junio C HamanoJun 2, 2007
  20. Lars HjemliJun 2, 2007
  21. Sven VerdoolaegeJul 25, 2007
  22. Lars HjemliJul 25, 2007
  23. Johannes SchindelinJul 25, 2007
  24. Lars HjemliJul 25, 2007
  25. Johannes SchindelinJul 25, 2007
  26. Junio C HamanoJul 25, 2007
  27. Ricky NiteJul 25, 2007
  28. Junio C HamanoJul 25, 2007
  29. Sven VerdoolaegeJun 2, 2007
  30. Linus TorvaldsJun 2, 2007
  31. Sven VerdoolaegeJun 2, 2007

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.