From aa1a988c7403cac81638c195b753fab7ac3600f9 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Fri, 21 Jun 2013 13:31:37 +0200 Subject: Reintroduce --with-linked-git option With slightly different semantics: Instead of pointing at a previous checkout, point at base directory of all repos. Change-Id: I254ecc33071be53067c44610b030f737cf75a7ee --- g | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'g') diff --git a/g b/g index c24ca3bad481..e273171ae7c2 100755 --- a/g +++ b/g @@ -152,6 +152,10 @@ get_git_reference() if [ -f config_host.mk ]; then REFERENCED_GIT=$(cat config_host.mk | grep GIT_REFERENCE_SRC | sed -e "s/.*=//") fi + LINKED_GIT="" + if [ -f config_host.mk ]; then + LINKED_GIT=$(cat config_host.mk | grep GIT_LINK_SRC | sed -e "s/.*=//") + fi } do_shortcut_update() @@ -249,6 +253,11 @@ local configured do_shortcut_update for module in $SUBMODULES_CONFIGURED ; do + if [ -n "$LINKED_GIT" ] ; then + if ! [ -d ".git/modules/${module}" ]; then + ./bin/git-new-module-workdir "${LINKED_GIT}/${module}" "${module}" + fi + fi configured=$(git config --local --get submodule.${module}.url) if [ -z "$configured" ] ; then git submodule init $module || return $? -- cgit