Browse Source

changed `sde update tree` to nicely indent the output of the update commands

karasz/new-early
Alejandro Mery 17 years ago
parent
commit
cda2cfe373
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      bin/sde-update-tree

+ 11
- 6
bin/sde-update-tree

@ -52,19 +52,24 @@ while [ $# -gt 0 ]; do
shift
done
indent_output() {
sed -e '/^$/d;' -e 's/^/ /'
}
# jump to the working tree's root
#
cd "$SDEROOT"
tree="${SDEROOT##*/}"
# hunt for the roots of the sub-working trees
#
for x in . package $( ls -1d package/* target/* 2> /dev/null ); do
if [ ! -d "$x" ]; then
case "$x" in
package)
echo -n "$tree/$x: "
git clone --quiet "$GITSERVER/opensde/$x-nopast.git" "$x"
echo "$tree/$x:"
git clone --quiet "$GITSERVER/opensde/$x-nopast.git" "$x" 2>&1 | indent_output
;;
*)
echo "$tree/$x: missing" >&2
@ -72,13 +77,13 @@ for x in . package $( ls -1d package/* target/* 2> /dev/null ); do
esac
elif [ -d "$x/.git" ]; then
cd "$x";
echo -n "$tree/$x: "
git fetch --quiet && git reset && git rebase origin
echo "$tree/$x:"
( git fetch --quiet && git reset && git rebase origin ) 2>&1 | indent_output
cd - > /dev/null
elif [ -d "$x/.svn" ]; then
cd "$x";
echo -n "$tree/$x: "
svn up
echo "$tree/$x:"
svn up 2>&1 | indent_output
cd - > /dev/null
fi
done

Loading…
Cancel
Save