1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #!/bin/sh
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- origin_name="origin"
- sibling_conf=".git-universe-sibling"
-
-
-
-
-
- rewrite_uri_to () {
-
- git remote -v \
- | grep "^$origin_name" \
- | grep "(fetch)$" \
- | cut -f 2 \
- | cut -d" " -f 1 \
- | perl -pe "s|[^/]+$|$1|;"
- }
-
-
-
-
-
- project=$1
-
- if [ -f $sibling_conf ];
- then
- sibling=$(cat $sibling_conf);
- else
- sibling=$(find -maxdepth 1 -type d -name "[^.]*" | head -1)
- fi
-
- if [ -z "$sibling" ];
- then
- echo "could not find older sibling" 1>&2
- exit 1
- fi
-
-
-
-
-
- pushd "$sibling" >/dev/null
- new_remote=$(rewrite_uri_to $project)
- popd >/dev/null
-
- echo \'git clone $new_remote\'
- git clone $new_remote
|