Skip to content

Commit

Permalink
Make git quiet by default. Prefer readable arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed May 12, 2019
1 parent 9111952 commit 473b011
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions commands/.settings
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ export CPPSM="${BASH_SOURCE%/*/*}"
if [ -z "$NUMBER_OF_PROCESSORS" ]; then
NUMBER_OF_PROCESSORS=$(getconf _NPROCESSORS_ONLN || echo 2)
fi

if [ "$GIT_QUIET" = 0 ]; then
GIT_QUIET=()
else
GIT_QUIET=(--quiet)
fi
2 changes: 1 addition & 1 deletion commands/add
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
echo "Promoting equipment/$NAME/$BRANCH -> $DESIRED"
"$CPPSM/commands/remove" "equipment/$NAME/$BRANCH"
fi
git submodule add -b "$BRANCH" "$URL" "$DESIRED"
git submodule "${GIT_QUIET[@]}" add --branch "$BRANCH" "$URL" "$DESIRED"
EXISTING="$DESIRED"
fi

Expand Down
4 changes: 2 additions & 2 deletions commands/clone
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ NAME="${NAME##*/}"

N_PARALLEL_UPDATE="${N_PARALLEL_UPDATE:-$NUMBER_OF_PROCESSORS}"

git clone -b "$2" "$1"
git clone "${GIT_QUIET[@]}" --branch "$2" "$1"
cd "$NAME"
git submodule update --init --jobs "$N_PARALLEL_UPDATE"
git submodule "${GIT_QUIET[@]}" update --init --jobs "$N_PARALLEL_UPDATE"
2 changes: 1 addition & 1 deletion commands/init
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ EOF
fi

if [ ! -d .cppsm ]; then
git submodule add -b master https://github.com/cppsm/cppsm-boilerplate.git .cppsm
git submodule "${GIT_QUIET[@]}" add --branch master https://github.com/cppsm/cppsm-boilerplate.git .cppsm
fi

ln -fs .cppsm/.clang-format .clang-format
Expand Down
4 changes: 2 additions & 2 deletions commands/update
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ EOF
exit 1
fi

git pull -r
git pull "${GIT_QUIET[@]}" --rebase

update-by-key () {
local KEY="$1"
local DIR
DIR="$(git config --file .gitmodules --get "$KEY")"
git submodule update --init -- "$DIR"
git submodule "${GIT_QUIET[@]}" update --init -- "$DIR"
}

for KEY in $(git config \
Expand Down
2 changes: 1 addition & 1 deletion commands/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ upgrade-by-key () {
local KEY="$1"
local DIR
DIR="$(git config --file .gitmodules --get "$KEY")"
git submodule update --remote -- "$DIR"
git submodule "${GIT_QUIET[@]}" update --remote -- "$DIR"
git add "$DIR"
}

Expand Down
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ git commit -m Initial

../travis-ci

git submodule add -b v1 https://github.com/per-framework/dumpster.cpp.git equipment/dumpster.cpp/v1
git submodule --quiet add -b v1 https://github.com/per-framework/dumpster.cpp.git equipment/dumpster.cpp/v1
cppsm add equipment https://github.com/per-framework/dumpster.cpp.git v1
cppsm add requires https://github.com/per-framework/dumpster.cpp.git v1
cppsm add equipment https://github.com/per-framework/dumpster.cpp.git v1
Expand Down

0 comments on commit 473b011

Please sign in to comment.