Skip to content

Commit

Permalink
git-mirror: add a optional clone url on the cmdline
Browse files Browse the repository at this point in the history
  • Loading branch information
gebi committed Sep 29, 2008
1 parent f95a119 commit ecc9a2c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/git-mirror
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

OPT_URL_="" # gitweb project list to mirror
OPT_URL_="" # gitweb project list to mirror
OPT_CLONE_URL_="" # base clone url to which the repo name is appended

PROGNAME_="$(basename $0)"

Expand All @@ -11,6 +12,12 @@ usage()
echo "$msg_" >&2
cat <<EOT
Usage: "$PROGNAME_" <gitweb url>
$PROGNAME_ tries to mirror all repositories from a gitweb instance
OPTIONS:
-b Base url for clone (default = ssh://git@<REPOSITORY>)
EOT
exit 1
}
Expand All @@ -28,7 +35,6 @@ done
shift $(($OPTIND - 1))

OPT_URL_="$1"
OPT_CLONE_URL_=""

[ -z "$OPT_URL_" ] && usage "need a url pointing to a gitweb installation"
[ -z "$OPT_CLONE_URL_" ] && OPT_CLONE_URL_="ssh://git@${OPT_URL_#*//}"
Expand Down

0 comments on commit ecc9a2c

Please sign in to comment.