Skip to content

Commit cb19343

Browse files
committed
Due to the simplistic nature of SVN commit history, it is not advisable to continue to use a local git branch once it has shipped to SVN through master using g-ship.
This commit aims to help in the discouragement of re-using these shipped branches: - Modified g-ship to rename shipped feature branches to DELETE-originalname - Added g-cleanup to remove shipped feature branches and run gc on the repository
1 parent 603f9fe commit cb19343

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

g-cleanup

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
# g-cleanup
3+
# Prunes old branches and runs maintenance tasks on the git repository
4+
5+
DEAD_WOOD=`git branch | grep DELETE | tr '\n,*' ' '`
6+
7+
read -p "Continue deleting the following branches? (Y/N) [${DEAD_WOOD}] : " APPROVED
8+
9+
if [ $APPROVED == "Y" ]
10+
then
11+
for branch in ${DEAD_WOOD}; do
12+
git branch -D ${branch}
13+
done
14+
echo "Running garbage collection on your git repository..."
15+
git gc --auto
16+
else
17+
echo "Cleanup cancelled."
18+
fi

g-ship

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ else
2929
git merge ${CURRENT} --squash
3030
git commit
3131
git svn dcommit
32+
git branch -m ${CURRENT} DELETE-${CURRENT}
3233
else
3334
echo "Please fix any failing tests before shipping this feature branch."
3435
fi

0 commit comments

Comments
 (0)