Willy-JL 2 лет назад
Родитель
Сommit
e0b5e7c9d1

+ 2 - 2
.utils/add-app.sh → .utils/add-subtree.sh

@@ -2,7 +2,7 @@
 set -e
 set -e
 
 
 if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then
 if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then
-    echo "Usage: git add-app <path> <repo> <branch> [subdir]"
+    echo "Usage: git add-subtree <path> <repo> <branch> [subdir]"
     exit
     exit
 fi
 fi
 path=${1%/}
 path=${1%/}
@@ -13,7 +13,7 @@ subdir=${4%/}
 if [ "${subdir}" = "" ]; then
 if [ "${subdir}" = "" ]; then
     git subtree add -P ${path} ${repo} ${branch} -m "Add ${path} from ${repo}"
     git subtree add -P ${path} ${repo} ${branch} -m "Add ${path} from ${repo}"
 else
 else
-    bash .utils/subdir-helper.sh ${path} ${repo} ${branch} ${subdir} add
+    bash .utils/subtree-subdir-helper.sh ${path} ${repo} ${branch} ${subdir} add
 fi
 fi
 
 
 gitsubtree=${path}/.gitsubtree
 gitsubtree=${path}/.gitsubtree

+ 0 - 10
.utils/bulk-update-apps.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-set -e
-
-for file in */.gitsubtree; do
-    app="$(dirname "${file}")"
-    echo -e "\n\nUpdating ${app}..."
-    pushd "${app}" > /dev/null
-    git update-app
-    popd > /dev/null
-done

+ 10 - 0
.utils/bulk-update-subtrees.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+
+for file in */.gitsubtree; do
+    subtree="$(dirname "${file}")"
+    echo -e "\n\nUpdating ${subtree}..."
+    pushd "${subtree}" > /dev/null
+    git update-subtree
+    popd > /dev/null
+done

+ 3 - 3
.utils/gitconfig

@@ -1,4 +1,4 @@
 [alias]
 [alias]
-    add-app = "!bash .utils/add-app.sh"
-    update-app = "!bash .utils/update-app.sh"
-    bulk-update-apps = "!bash .utils/bulk-update-apps.sh"
+    add-subtree = "!bash .utils/add-subtree.sh"
+    update-subtree = "!bash .utils/update-subtree.sh"
+    bulk-update-subtrees = "!bash .utils/bulk-update-subtrees.sh"

+ 0 - 0
.utils/subdir-helper.sh → .utils/subtree-subdir-helper.sh


+ 1 - 1
.utils/update-app.sh → .utils/update-subtree.sh

@@ -7,5 +7,5 @@ read repo branch subdir < ${GIT_PREFIX}.gitsubtree
 if [ "${subdir}" = "" ]; then
 if [ "${subdir}" = "" ]; then
     git subtree pull -P ${path} ${repo} ${branch} -m "Merge ${path} from ${repo}"
     git subtree pull -P ${path} ${repo} ${branch} -m "Merge ${path} from ${repo}"
 else
 else
-    bash .utils/subdir-helper.sh ${path} ${repo} ${branch} ${subdir} merge
+    bash .utils/subtree-subdir-helper.sh ${path} ${repo} ${branch} ${subdir} merge
 fi
 fi

+ 3 - 3
README.md

@@ -21,6 +21,6 @@ That's why the commit history for our repo is so huge, it contains all the commi
 
 
 To make updating more manageable, we have added another layer on top of subtrees:
 To make updating more manageable, we have added another layer on top of subtrees:
 - set it up by running `git config --local include.path ../.utils/gitconfig`
 - set it up by running `git config --local include.path ../.utils/gitconfig`
-- add a new app with `git add-app <path> <repo> <branch> [subdir]`, this will pull the history and create `path/.gitsubtree` to remember the url, branch and subdir
-- run `git update-app` to pull updates based on the current subtree directory
-- or run `git bulk-update-apps` to do it for all subtrees
+- add a new app with `git add-subtree <path> <repo> <branch> [subdir]`, this will pull the history and create `path/.gitsubtree` to remember the url, branch and subdir
+- run `git update-subtree` to pull updates based on the current subtree directory
+- or run `git bulk-update-subtrees` to do it for all subtrees