From: Heiko Voigt Date: Fri, 21 Dec 2012 08:20:33 GMT Subject: Re: [PATCH v8 1/3] submodule: add get_submodule_config helper funtion Message-ID: <20121221082033.GB560@book.hvoigt.net> In-Reply-To: <3377beb925bc209d90058493b74d174db1b7aa50.1355932282.git.wking@tremily.us> On Wed, Dec 19, 2012 at 11:03:31AM -0500, wking@tremily.us wrote: > diff --git a/git-submodule.sh b/git-submodule.sh > index 2365149..263a60c 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -153,6 +153,32 @@ die_if_unmatched () [...] > +get_submodule_config () { > + name="$1" > + option="$2" > + default="$3" > + value=$(git config submodule."$name"."$option") > + if test -z "$value" > + then > + value=$(git config -f .gitmodules submodule."$name"."$option") > + fi > + printf '%s' "${value:-$default}" > +} > + > + > +# Minor nit: For all other functions we only have one newline as separator. Cheers Heiko