#!/bin/sh

# Update checkouts and push changes to our remote.

REMOTE=$(cat REMOTE)

while read repo; do
    info=($repo)
    srcname=${info[0]}
    destname=${info[0]}
    if [ ${#info[@]} -gt 1 ]; then
        destname=${info[1]}
    fi
    if [ "$srcname" = "$destname" ]; then
        echo Updating ${srcname}...
    else
        echo Updating ${srcname} as ${destname}...
    fi
    echo "fetching in ${srcname}.git..."
    $(cd ${srcname}.git && git fetch && \
      git push --mirror ${REMOTE}${destname}.git) || exit
done < REPOS

#!/bin/sh

# Update checkouts and push changes to our remote.

REMOTE=$(cat REMOTE)

while read repo; do
    info=($repo)
    oname=${info[0]}
    rname=${info[0]}
    if [ ${#info[@]} -gt 1 ]; then
        rname=${info[1]}
    fi
    if [ "$oname" = "$rname" ]; then
        echo Pushing ${oname}...
    else
        echo Pushing ${oname} as ${rname}...
    fi
    $(cd ${oname}.git && git fetch && git push --mirror ${REMOTE}${rname}.git) || exit
done < REPOS

--- 
+++ 
@@ -6,17 +6,15 @@
 
 while read repo; do
     info=($repo)
-    srcname=${info[0]}
-    destname=${info[0]}
+    oname=${info[0]}
+    rname=${info[0]}
     if [ ${#info[@]} -gt 1 ]; then
-        destname=${info[1]}
+        rname=${info[1]}
     fi
-    if [ "$srcname" = "$destname" ]; then
-        echo Updating ${srcname}...
+    if [ "$oname" = "$rname" ]; then
+        echo Pushing ${oname}...
     else
-        echo Updating ${srcname} as ${destname}...
+        echo Pushing ${oname} as ${rname}...
     fi
-    echo "fetching in ${srcname}.git..."
-    $(cd ${srcname}.git && git fetch && \
-      git push --mirror ${REMOTE}${destname}.git) || exit
+    $(cd ${oname}.git && git fetch && git push --mirror ${REMOTE}${rname}.git) || exit
 done < REPOS
Use more obvious variable names for the various repo names.
