diff options
Diffstat (limited to 'g')
-rwxr-xr-x | g | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -12,7 +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" + echo " --set-push-user [username] re-write an existing tree's config with an fd.o commit account name" exit $? fi @@ -53,9 +53,9 @@ while [ "${COMMAND:0:1}" = "-" ] ; do ;; -s) REPORT_REPOS=0 ;; - --rewrite-account) + --set-push-user) shift - REWRITE_ACCOUNT="$1" + PUSH_USER="$1" ;; esac shift @@ -105,10 +105,16 @@ while shift ; do FILES[$FILESNUM]="$1" FILESNUM=$(($FILESNUM+1)) else - [ "$COMMAND" = "commit" -a "$PARAM" = "--allow-empty" ] && ALLOW_EMPTY=1 - - FILES[$FILESNUM]="$PARAM" - FILESNUM=$(($FILESNUM+1)) + if [ "$COMMAND" = "commit" -a "$PARAM" = "-F" ] + then + shift + # this still needs some magic to handle relative paths + EXTRA="${EXTRA} -F ${1}" + else + [ "$COMMAND" = "commit" -a "$PARAM" = "--allow-empty" ] && ALLOW_EMPTY=1 + FILES[$FILESNUM]="$PARAM" + FILESNUM=$(($FILESNUM+1)) + fi fi else if [ "$COMMAND" = "apply" ] ; then @@ -148,10 +154,9 @@ for REPO in $DIRS ; do HOOKDIR="../../git-hooks" fi - 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" - + if [ -d "$DIR" -a "z$PUSH_USER" != "z" ]; then + echo "setting up push url for $DIR" + (cd $DIR && git config remote.origin.pushurl "ssh://${PUSH_USER}@git.freedesktop.org/git/libreoffice/${REPO}") elif [ \( -d "$DIR" -a -d "$DIR"/.git \) -o \( "$COMMAND" = "clone" \) ] ; then ( # executed in a subshell @@ -226,6 +231,7 @@ for REPO in $DIRS ; do # do it! if [ "$COMMAND" != "clone" -o ! -d $DIR ] ; then [ "$REPORT_REPOS" = "1" ] && echo "===== $NAME =====" + echo git $PAGER "$COMMAND" $EXTRA "${FILES[@]}" git $PAGER "$COMMAND" $EXTRA "${FILES[@]}" RETURN=$? fi |