From 31cf8af327e41f4f1a8d09ff51a7842e21afcccf Mon Sep 17 00:00:00 2001 From: Thomas Meeus Date: Thu, 11 Dec 2014 10:18:34 +0100 Subject: [PATCH 1/6] Document issue with leaky subtree command --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1a34229..4e02fef 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,14 @@ git-subsplit can also be installed as a git command by: ./install.sh +Caveats +------- + +There is a known bug in the underlying git-subtree command that this script uses. Your disk will eventually run out of inodes because a cache directory isn't cleaned up after every run. I suggest you to create a cronjob to clean the cache directory every month: + +``` +0 0 1 * * rm -rf /dflydev-git-subsplit-github-webhook/temp/$projectname/.subsplit/.git/subtree-cache/* +``` Hooks ----- From 6a8bc7123894d381a7b178037ede5cc5810e5b4c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 26 Jan 2016 15:53:19 +0100 Subject: [PATCH 2/6] Program exit codes are overwritten by echo/say etc programs --- git-subsplit.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-subsplit.sh b/git-subsplit.sh index f1fb257..b7dcc0f 100755 --- a/git-subsplit.sh +++ b/git-subsplit.sh @@ -216,11 +216,13 @@ subsplit_publish() fi say " - syncing branch '${HEAD}'" + git checkout master >/dev/null 2>&1 git branch -D "$LOCAL_BRANCH" >/dev/null 2>&1 git branch -D "${LOCAL_BRANCH}-checkout" >/dev/null 2>&1 git checkout -b "${LOCAL_BRANCH}-checkout" "origin/${HEAD}" >/dev/null 2>&1 git subtree split -q --prefix="$SUBPATH" --branch="$LOCAL_BRANCH" "origin/${HEAD}" >/dev/null + RETURNCODE=$? if [ -n "$VERBOSE" ]; then @@ -231,7 +233,7 @@ subsplit_publish() echo "${DEBUG} git subtree split -q --prefix=\"$SUBPATH\" --branch=\"$LOCAL_BRANCH\" \"origin/${HEAD}\" >/dev/null" fi - if [ $? -eq 0 ] + if [ $RETURNCODE -eq 0 ] then PUSH_CMD="git push -q ${DRY_RUN} --force $REMOTE_NAME ${LOCAL_BRANCH}:${HEAD}" @@ -291,6 +293,7 @@ subsplit_publish() say " - subtree split for '${TAG}'" git subtree split -q --annotate="${ANNOTATE}" --prefix="$SUBPATH" --branch="$LOCAL_TAG" "$TAG" >/dev/null + RETURNCODE=$? if [ -n "$VERBOSE" ]; then @@ -298,7 +301,7 @@ subsplit_publish() fi say " - subtree split for '${TAG}' [DONE]" - if [ $? -eq 0 ] + if [ $RETURNCODE -eq 0 ] then PUSH_CMD="git push -q ${DRY_RUN} --force ${REMOTE_NAME} ${LOCAL_TAG}:refs/tags/${TAG}" From 5335516422db7616ea1ba0dde43f80df42522e97 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 26 Jan 2016 15:54:47 +0100 Subject: [PATCH 3/6] Remove duplicate fetch, -t option fetches other refs too --- git-subsplit.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/git-subsplit.sh b/git-subsplit.sh index f1fb257..045becd 100755 --- a/git-subsplit.sh +++ b/git-subsplit.sh @@ -334,7 +334,6 @@ subsplit_update() if [ -n "$VERBOSE" ]; then - echo "${DEBUG} git fetch -q origin" echo "${DEBUG} git fetch -q -t origin" echo "${DEBUG} git checkout master" echo "${DEBUG} git reset --hard origin/master" From 55b5816f6035e8e9fed66dec6e233c84713db98b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 26 Jan 2016 16:09:51 +0100 Subject: [PATCH 4/6] Actually remove unnecessary fetch --- git-subsplit.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/git-subsplit.sh b/git-subsplit.sh index 045becd..a19c44d 100755 --- a/git-subsplit.sh +++ b/git-subsplit.sh @@ -327,7 +327,6 @@ subsplit_update() say "Updating subsplit from origin" - git fetch -q origin git fetch -q -t origin git checkout master git reset --hard origin/master From 833f2a25a915544c6c38cbe8af3f59ea004efdef Mon Sep 17 00:00:00 2001 From: Welling Guzman Date: Tue, 14 Jun 2016 17:27:40 -0400 Subject: [PATCH 5/6] add debug option in README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4e02fef..923ae32 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,10 @@ Does not actually publish information to the subsplit repos for each subtree split. Instead, display the command and execute the command with `--dry-run` included. +#### --debug + +Allows you to see the logic behind the scenes. + Not Invented Here ----------------- From c6131111d82c40817bedb9e7480f10d52196d4b5 Mon Sep 17 00:00:00 2001 From: Sam Jordan Date: Wed, 14 Dec 2016 19:10:00 +0000 Subject: [PATCH 6/6] Typo Fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 923ae32..88699ab 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Do not sync any tags. #### --rebuild-tags Ordinarily tags will not be synced more than once. This is because in general -tags should be considered or or less static. +tags should be considered more or less static. If for some reason tags need to be resynced from scratch (history changed so tags might point to somewhere else) this flag will get the job done.