[Libreoffice-commits] .: Branch 'feature/submodules' - g

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 2 11:00:24 PDT 2012


 g |   36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

New commits:
commit ba9e29b24d2e83b5111122ccee8fd3dfb11bcf0d
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Oct 2 12:59:44 2012 -0500

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

diff --git a/g b/g
index 7c6551c..f70cac1 100755
--- a/g
+++ b/g
@@ -125,6 +125,31 @@ get_configured_submodules()
     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()
 {
     echo "cmd:$@"
@@ -147,11 +172,13 @@ local module
 	    create_branch=1
 	elif [ "$create_branch" = "1" ] ; then
 	    branch="$arg"
+	    create_branch=0
 	fi
     done
     if [ -f .gitmodules ] ; then
+	git submodule update
 	if [ -n "$branch" ] ; then
-	    git submodules foreach git branch ${branch} HEAD || return $?
+	    git submodules foreach git checkout -b ${branch} HEAD || return $?
 	fi
     else
 	# now that is the nasty case we moved prior to submodules
@@ -189,6 +216,8 @@ do_init_modules()
 local module
 local configured
 
+    do_shortcut_update
+
     for module in $SUBMODULES_CONFIGURED ; do
 	configured=$(git config --local --get submodule.${module}.url)
 	if [ -z "$configured" ] ; then
@@ -265,7 +294,7 @@ case "$COMMAND" in
 	do_git_cmd ${COMMAND} "$@"
 	;;
     checkout)
-	do_checkout "$@" && git submodule foreach git checkout "$@"
+	do_checkout "$@"
 	;;
     clone)
 	do_init_modules && git submodule update && refresh_all_hooks
@@ -290,6 +319,9 @@ case "$COMMAND" in
     reset)
 	do_reset
 	;;
+    tag)
+	do_git_cmd ${COMMAND} "$@"
+	;;
     *)
 	echo "./g does not support command:$COMMAND" 1>&2
 	exit 1;


More information about the Libreoffice-commits mailing list