Skip to content

Commit 473b011

Browse files
committed
Make git quiet by default. Prefer readable arguments.
1 parent 9111952 commit 473b011

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

commands/.settings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ export CPPSM="${BASH_SOURCE%/*/*}"
1111
if [ -z "$NUMBER_OF_PROCESSORS" ]; then
1212
NUMBER_OF_PROCESSORS=$(getconf _NPROCESSORS_ONLN || echo 2)
1313
fi
14+
15+
if [ "$GIT_QUIET" = 0 ]; then
16+
GIT_QUIET=()
17+
else
18+
GIT_QUIET=(--quiet)
19+
fi

commands/add

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ else
3737
echo "Promoting equipment/$NAME/$BRANCH -> $DESIRED"
3838
"$CPPSM/commands/remove" "equipment/$NAME/$BRANCH"
3939
fi
40-
git submodule add -b "$BRANCH" "$URL" "$DESIRED"
40+
git submodule "${GIT_QUIET[@]}" add --branch "$BRANCH" "$URL" "$DESIRED"
4141
EXISTING="$DESIRED"
4242
fi
4343

commands/clone

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ NAME="${NAME##*/}"
1818

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

21-
git clone -b "$2" "$1"
21+
git clone "${GIT_QUIET[@]}" --branch "$2" "$1"
2222
cd "$NAME"
23-
git submodule update --init --jobs "$N_PARALLEL_UPDATE"
23+
git submodule "${GIT_QUIET[@]}" update --init --jobs "$N_PARALLEL_UPDATE"

commands/init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EOF
1717
fi
1818

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

2323
ln -fs .cppsm/.clang-format .clang-format

commands/update

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ EOF
1414
exit 1
1515
fi
1616

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

1919
update-by-key () {
2020
local KEY="$1"
2121
local DIR
2222
DIR="$(git config --file .gitmodules --get "$KEY")"
23-
git submodule update --init -- "$DIR"
23+
git submodule "${GIT_QUIET[@]}" update --init -- "$DIR"
2424
}
2525

2626
for KEY in $(git config \

commands/upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ upgrade-by-key () {
1818
local KEY="$1"
1919
local DIR
2020
DIR="$(git config --file .gitmodules --get "$KEY")"
21-
git submodule update --remote -- "$DIR"
21+
git submodule "${GIT_QUIET[@]}" update --remote -- "$DIR"
2222
git add "$DIR"
2323
}
2424

test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ git commit -m Initial
1717

1818
../travis-ci
1919

20-
git submodule add -b v1 https://github.com/per-framework/dumpster.cpp.git equipment/dumpster.cpp/v1
20+
git submodule --quiet add -b v1 https://github.com/per-framework/dumpster.cpp.git equipment/dumpster.cpp/v1
2121
cppsm add equipment https://github.com/per-framework/dumpster.cpp.git v1
2222
cppsm add requires https://github.com/per-framework/dumpster.cpp.git v1
2323
cppsm add equipment https://github.com/per-framework/dumpster.cpp.git v1

0 commit comments

Comments
 (0)