summaryrefslogtreecommitdiff
path: root/g
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-01-20 16:03:48 +0000
committerMichael Meeks <michael.meeks@novell.com>2011-01-20 16:03:48 +0000
commitf8eb05ab0e84b916b6d094acdeb6707d00dcfd44 (patch)
tree8a7f939c169edbc68e5098b908fd8d881c3e2186 /g
parent5dd4778d66b5ac1acc7d42ef391c00b4d8dae408 (diff)
Add --rewrite-account [username] option, inspired by Christina RoƟmanith's work
Diffstat (limited to 'g')
-rwxr-xr-xg11
1 files changed, 10 insertions, 1 deletions
diff --git a/g b/g
index d033a0c37a89..1cceacdd7e12 100755
--- a/g
+++ b/g
@@ -12,6 +12,7 @@ if [ "$#" -eq "0" ] ; then
echo "Usage: g [options] [git commands]"
echo " -f Force - act on all the repos, not only the changed ones"
echo " -s Silent - do not report the repo names."
+ echo " --rewrite-account [username] re-write an existing tree's config for a new commit account name"
exit $?
fi
@@ -52,6 +53,10 @@ while [ "${COMMAND:0:1}" = "-" ] ; do
;;
-s) REPORT_REPOS=0
;;
+ --rewrite-account)
+ shift
+ REWRITE_ACCOUNT="$1"
+ ;;
esac
shift
COMMAND="$1"
@@ -143,7 +148,11 @@ for REPO in $DIRS ; do
HOOKDIR="../../git-hooks"
fi
- if [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
+ if [ "$REWRITE_ACCOUNT" != "" ]; then
+ echo "rewrite $DIR/.git/config"
+ sed -i.bak "s|git://anongit.freedesktop.org/git/libreoffice/|ssh://$REWRITE_ACCOUNT@git.freedesktop.org/git/libreoffice/|" "$DIR/.git/config"
+
+ elif [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then
(
# executed in a subshell
if [ "$COMMAND" != "clone" ] ; then