Re: [RFC] remove/deprecate 'submodule init' and 'sync'
- From
W. Trevor King <wking@tremily.us>
- Date
- Nov 30, 2012, 18:17 UTC
- Message-ID
- <20121130181709.GA967@odin.tremily.us>
- In-Reply-To
- <20121130175309.GA718@odin.tremily.us>
On Fri, Nov 30, 2012 at 12:53:09PM -0500, W. Trevor King wrote:
> Likewise for `submodule sync`, which seems to be > quite similar to `init`.
Ah, I'd remove the part of `sync` that touches the superproject's .git/config, but keep the part that stores the superproject-reorded URL in the submodule's config:
url=$(get_submodule_config "$name" url)
up_path=$(get_up_path "$sm_path")
url=$(resolve_relative_url "$url" "$up_path") &&
if test -n "$url"
then
if test -e "$sm_path"/.git
then
(
clear_local_git_env
cd "$sm_path"
remote=$(get_default_remote)
git config remote."$remote".url "$url"
)
fi
fiI should probably also tweak sync to do similar things with submodule.<name>.branch and .remote as part of my `--update remote` series.
Cheers, Trevor
-- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy