login
Header Space

 
 

[PATCH] git-submodule fixes for call to git config --get-regexp

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Date: Friday, July 20, 2007 - 1:23 pm

Two minor git-submodule fixes:
* Escape !'s in the git config --get-regexp, so submodule paths can
contain them.
* Be more explicit about the value regex, otherwise things get confused if one
  submodule name is a prefix of another (since --get-regexp can return
  multiple values).

Signed-off-by: Chris Larson <clarson@kergoth.com>

--- git-submodule.sh.old	2007-07-20 10:13:22.578125000 -0700
+++ git-submodule.sh	2007-07-20 10:14:56.281250000 -0700
@@ -46,7 +46,8 @@ get_repo_base() {
 #
 module_name()
 {
-       name=$(GIT_CONFIG=.gitmodules git config --get-regexp
'^submodule\..*\.path$' "$1" |
+       path=$(echo "$1" | sed -e 's/\!/\\!/g')
+       name=$(GIT_CONFIG=.gitmodules git config --get-regexp
'^submodule\..*\.path$' "^$path$" |
        sed -nre 's/^submodule\.(.+)\.path .+$/\1/p')
        test -z "$name" &&
        die "No submodule mapping found in .gitmodules for path '$path'"

-- 
Chris Larson - clarson at kergoth dot com
Dedicated Engineer - MontaVista - clarson at mvista dot com
Core Developer/Architect - TSLib, BitBake, OpenEmbedded, OpenZaurus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-submodule fixes for call to git config --get-reg..., Chris Larson, (Fri Jul 20, 1:23 pm)
Re: [PATCH] git-submodule fixes for call to git config --get..., Johannes Schindelin, (Fri Jul 20, 2:36 pm)
speck-geostationary