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

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

 



"Chris Larson" <clarson@xxxxxxxxxxx> writes:

> Two minor git-submodule fixes:
> * Escape !'s in the git config --get-regexp, so submodule paths can
> contain them.

> --- 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')

My first reaction was if it shouldn't be done for only the '!'
at the very beginning, to defeat "do_not_match" logic, but it
would not hurt if we have extra "\!" in the middle.

Once you introduce that sed to munge the path string, I suspect
you would also want and can afford to quote extended regular
expression metacharacters as well.

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