4 echo "Usage: $0 repoistory [directories]" >&2
9 cd "$1" && source_dir="`pwd`" &&
11 if [ ! -d ".git" ]; then
12 echo "$source_dir is not a repoistory (.git isn't found)" >&2
17 dest_dir="`basename \"$source_dir\"`".git &&
18 git clone --mirror --config core.sharedRepository=0644 "$source_dir" "$dest_dir" &&
21 git repack -a -d -f --depth=250 --window=250 &&
23 cp -p hooks/post-update.sample hooks/post-update && hooks/post-update &&
24 cp -p "$HOME"/Internet/WWW/htdocs/git.phdru.name/phdru.name/phdru.name.git/git-daemon-export-ok . &&
25 if [ "`cat \"$source_dir\"/.git/description`" = \
26 "Unnamed repository; edit this file 'description' to name the repository." ]
28 "${VISUAL:-${EDITOR:-vi}}" "$source_dir"/.git/description description
30 cp -p "$source_dir"/.git/description . && chmod a+r description
32 if [ -f "$source_dir"/README.html ]; then
33 cp -p "$source_dir"/README.html . && chmod a+r README.html
36 cd "$HOME"/Internet/WWW/htdocs/git.phdru.name &&
38 if [ -n "$directories" ]; then
39 mkdir -p "$directories"
43 mv "$dest_dir" "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$directories" &&
47 if [ -n "$directories" ]; then
48 dest_dir="$directories/$dest_dir"
50 exec git remote add --mirror=push web "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$dest_dir"