[Libreoffice-commits] .: 2 commits - g
Michael Meeks
mmeeks at kemper.freedesktop.org
Thu Jan 20 08:04:24 PST 2011
g | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
New commits:
commit ffdb00633596b4b1edcc64b09c2ac95e1d4669b7
Author: Michael Meeks <michael.meeks at novell.com>
Date: Thu Jan 20 16:03:48 2011 +0000
Add --rewrite-account [username] option, inspired by Christina RoÃmanith's work
diff --git a/g b/g
index d033a0c..1cceacd 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
commit 52dc7cfbcdd2b71d789ec1068bebcde44235dcdc
Author: Michael Meeks <michael.meeks at novell.com>
Date: Thu Jan 20 15:44:25 2011 +0000
cope with change of path, and broken absolute links this generates
diff --git a/g b/g
index 2f6fcd4..d033a0c 100755
--- a/g
+++ b/g
@@ -234,12 +234,18 @@ for REPO in $DIRS ; do
case "$COMMAND" in
pull|clone)
# update links
- for link in $(ls) ; do
- if [ ! -e "$RAWBUILDDIR/$link" ] ; then
- echo "Creating missing link $link"
- ln -s "$DIR/$link" "$RAWBUILDDIR/$link"
- fi
- done
+ if [ "$DIR" != "$RAWBUILDDIR" ]; then
+ for link in $(ls) ; do
+ if [ ! -e "$RAWBUILDDIR/$link" ] ; then
+ if test -h "$RAWBUILDDIR/$link"; then
+ rm "$RAWBUILDDIR/$link"
+ echo -n "re-"
+ fi
+ echo "creating missing link $link $DIR/$link -> $RAWBUILDDIR/$link"
+ ln -sf "$DIR/$link" "$RAWBUILDDIR/$link"
+ fi
+ done
+ fi
;;
status)
# git status returns error in some versions, clear that
More information about the Libreoffice-commits
mailing list