git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Verdoolaege <skimo@kotnet.org>
To: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Lars Hjemli <hjemli@gmail.com>
Cc: git@vger.kernel.org, Ricky Nite <ricky.nite@gmail.com>,
	Chris Larson <clarson@kergoth.com>
Subject: Re: submodule init problem
Date: Wed, 25 Jul 2007 10:15:08 +0200	[thread overview]
Message-ID: <20070725081508.GN1591MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <20070602074410.GA955MdfPADPa@greensroom.kotnet.org> <Pine.LNX.4.64.0707201933360.14781@racer.site> <7vir89fe1l.fsf@assigned-by-dhcp.cox.net>

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@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:
> 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

  reply	other threads:[~2007-07-25  8:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-28 20:51 [PATCH] Let .git/config specify the url for submodules Lars Hjemli
2007-05-31  0:17 ` Lars Hjemli
2007-05-31 23:43   ` Junio C Hamano
2007-06-01  8:08   ` Josef Weidendorfer
2007-06-01  9:17     ` Lars Hjemli
2007-06-01  8:57   ` Sven Verdoolaege
2007-06-01  9:25     ` Lars Hjemli
2007-06-01  9:35       ` Sven Verdoolaege
2007-06-01 14:45         ` Lars Hjemli
2007-06-01 14:51           ` Sven Verdoolaege
2007-06-01 15:56             ` Lars Hjemli
2007-06-01 16:29               ` Linus Torvalds
2007-06-01 19:55                 ` Junio C Hamano
2007-06-02  7:13                   ` Lars Hjemli
2007-06-02  7:44                     ` Sven Verdoolaege
2007-06-02  8:39                       ` Lars Hjemli
2007-06-02  9:15                         ` Junio C Hamano
2007-06-02  9:53                           ` Lars Hjemli
2007-06-02 10:12                             ` Junio C Hamano
2007-06-02 10:38                               ` Lars Hjemli
2007-07-20 17:23                       ` [PATCH] git-submodule fixes for call to git config --get-regexp Chris Larson
2007-07-20 18:07                         ` Junio C Hamano
2007-07-20 18:36                           ` Johannes Schindelin
2007-07-25  0:09                             ` submodule init problem Ricky Nite
2007-07-25  0:30                               ` Ricky Nite
2007-07-25  1:49                                 ` Junio C Hamano
2007-07-25  8:15                                   ` Sven Verdoolaege [this message]
2007-07-25 20:25                                     ` Lars Hjemli
2007-07-25 20:31                                       ` Johannes Schindelin
2007-07-25 20:40                                         ` Lars Hjemli
2007-07-25 20:50                                           ` Johannes Schindelin
2007-07-25 22:20                                     ` Junio C Hamano
2007-07-25 23:43                                       ` Ricky Nite
2007-07-25 23:49                                         ` Junio C Hamano
2007-06-02  7:49                 ` [PATCH] Let .git/config specify the url for submodules Sven Verdoolaege
2007-06-02 16:34                   ` Linus Torvalds
2007-06-02 17:35                     ` Sven Verdoolaege

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070725081508.GN1591MdfPADPa@greensroom.kotnet.org \
    --to=skimo@kotnet.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=clarson@kergoth.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    --cc=ricky.nite@gmail.com \
    --cc=skimo@liacs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).