-
Notifications
You must be signed in to change notification settings - Fork 439
/
Copy pathsubtree-split
executable file
·62 lines (49 loc) · 1.36 KB
/
subtree-split
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -e
set -x
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
function split()
{
# split_new_repo $1 $2
SHA1=`./bin/splitsh-lite --prefix=$1`
git push $2 "$SHA1:$CURRENT_BRANCH"
}
function split_new_repo()
{
TMP_DIR="/tmp/enqueue-repo"
REMOTE_URL=`git remote get-url $2`
rm -rf $TMP_DIR;
mkdir $TMP_DIR;
(
cd $TMP_DIR;
git clone $REMOTE_URL .;
git checkout -b master;
touch foo;
git add foo;
git commit -m "foo";
git push origin master;
);
SHA1=`./bin/splitsh-lite --prefix=$1`
git fetch $2
git push $2 "$SHA1:$CURRENT_BRANCH" -f
}
function remote()
{
git remote add $1 $2 || true
}
remote psr-queue git@github.com:php-enqueue/psr-queue.git
remote enqueue git@github.com:php-enqueue/enqueue.git
remote stomp git@github.com:php-enqueue/stomp.git
remote amqp-ext git@github.com:php-enqueue/amqp-ext.git
remote fs git@github.com:php-enqueue/fs.git
remote enqueue-bundle git@github.com:php-enqueue/enqueue-bundle.git
remote job-queue git@github.com:php-enqueue/job-queue.git
remote test git@github.com:php-enqueue/test.git
split 'pkg/psr-queue' psr-queue
split 'pkg/enqueue' enqueue
split 'pkg/stomp' stomp
split 'pkg/amqp-ext' amqp-ext
split 'pkg/fs' fs
split 'pkg/enqueue-bundle' enqueue-bundle
split 'pkg/job-queue' job-queue
split 'pkg/test' test