Kaydet (Commit) a31714fb authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

add tag support to ./g, try to optimize pre->post submerge situation

Change-Id: I052817865da6df193c0451eccc3b8b6f507845a3
üst 2c5cdc4d
...@@ -125,6 +125,31 @@ get_configured_submodules() ...@@ -125,6 +125,31 @@ get_configured_submodules()
fi fi
} }
do_shortcut_update()
{
local module
local repo
for module in $SUBMODULES_CONFIGURED ; do
if [ ! -d ${module?}/.git ] ; then
case "${module?}" in
helcontent2)
if [ -d clone/help/.git ] ; then
repo="clone/help/.git"
fi
;;
*)
if [ -d clone/${module?}/.git ] ; then
repo="clone/${module?}/.git"
fi
;;
esac
if [ -n "$repo" ] ; then
cp -r "${repo?}" "${module?}/."
fi
done
}
do_git_cmd() do_git_cmd()
{ {
echo "cmd:$@" echo "cmd:$@"
...@@ -147,11 +172,13 @@ local module ...@@ -147,11 +172,13 @@ local module
create_branch=1 create_branch=1
elif [ "$create_branch" = "1" ] ; then elif [ "$create_branch" = "1" ] ; then
branch="$arg" branch="$arg"
create_branch=0
fi fi
done done
if [ -f .gitmodules ] ; then if [ -f .gitmodules ] ; then
git submodule update
if [ -n "$branch" ] ; then if [ -n "$branch" ] ; then
git submodules foreach git branch ${branch} HEAD || return $? git submodules foreach git checkout -b ${branch} HEAD || return $?
fi fi
else else
# now that is the nasty case we moved prior to submodules # now that is the nasty case we moved prior to submodules
...@@ -189,6 +216,8 @@ do_init_modules() ...@@ -189,6 +216,8 @@ do_init_modules()
local module local module
local configured local configured
do_shortcut_update
for module in $SUBMODULES_CONFIGURED ; do for module in $SUBMODULES_CONFIGURED ; do
configured=$(git config --local --get submodule.${module}.url) configured=$(git config --local --get submodule.${module}.url)
if [ -z "$configured" ] ; then if [ -z "$configured" ] ; then
...@@ -265,7 +294,7 @@ case "$COMMAND" in ...@@ -265,7 +294,7 @@ case "$COMMAND" in
do_git_cmd ${COMMAND} "$@" do_git_cmd ${COMMAND} "$@"
;; ;;
checkout) checkout)
do_checkout "$@" && git submodule foreach git checkout "$@" do_checkout "$@"
;; ;;
clone) clone)
do_init_modules && git submodule update && refresh_all_hooks do_init_modules && git submodule update && refresh_all_hooks
...@@ -290,6 +319,9 @@ case "$COMMAND" in ...@@ -290,6 +319,9 @@ case "$COMMAND" in
reset) reset)
do_reset do_reset
;; ;;
tag)
do_git_cmd ${COMMAND} "$@"
;;
*) *)
echo "./g does not support command:$COMMAND" 1>&2 echo "./g does not support command:$COMMAND" 1>&2
exit 1; exit 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment