Re: Tags
- From
Jan Harkes <jaharkes@cs.cmu.edu>
- Date
- Jul 2, 2005, 22:32 UTC
- Message-ID
- <20050702223219.GA21865@delft.aura.cs.cmu.edu>
- In-Reply-To
- <20050702203805.GB19206@delft.aura.cs.cmu.edu>
On Sat, Jul 02, 2005 at 04:38:06PM -0400, Jan Harkes wrote:
> - Then you run the following script (untested)
Ok, I tested it and it was pretty broken, I assumed that git-fetch-script accepted the same arguments as git-pull-script.
Here is one that actually seems to work.
Jan
#!/bin/sh # # combine per-user private trees into a single repository. # assumes that user repositories are stored as "$repos/<user>/<tree>.git" # global=global.git repos=/path/to/user/repositories
export GIT_DIR="$global"
# create global repository if it doesn't exist git-init-db
for tree in $(cd "$repos" && find . -name '*.git' -prune | sed 'sX./XX')
do
root="$repos/$tree"
for ref in $(cd "$root" && find refs -type f) ; do
echo Synchronizing $tree
git fetch "$root" "$ref" type=$(echo "$ref" | sed -ne 'sX^refs/\([^/]*\)/.*$X\1Xp')
name=$(echo "$ref" | sed -ne 'sX^refs/[^/]*/\(.*\)$X\1Xp')
dest="$GIT_DIR/refs/$type/$tree/$name"
mkdir -p $(dirname "$dest")
cat "$GIT_DIR/FETCH_HEAD" > "$dest"
done
done