Re: submodule init problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
> Hi,
> 
> On Fri, 20 Jul 2007, Junio C Hamano wrote:
> 
> > "Chris Larson" <clarson@xxxxxxxxxxx> 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:
> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux