Skip to content

Commit

Permalink
Merge pull request Homebrew#1380 from woodruffw/silence-git
Browse files Browse the repository at this point in the history
Redirect stderr output from git (shim) invocations to /dev/null.
  • Loading branch information
MikeMcQuaid authored Oct 26, 2016
2 parents 84d1661 + 72b8184 commit 4284b82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ esac
if [[ -z "$HOMEBREW_DEVELOPER" ]]
then
export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config"
HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun)"
HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun 2>/dev/null)"
if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]]
then
export HOMEBREW_DEV_CMD_RUN="1"
Expand All @@ -231,7 +231,7 @@ elif [[ -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]]
then
if [[ -z "$HOMEBREW_DEVELOPER" ]]
then
git config --file="$HOMEBREW_GIT_CONFIG_FILE" --replace-all homebrew.devcmdrun true
git config --file="$HOMEBREW_GIT_CONFIG_FILE" --replace-all homebrew.devcmdrun true 2>/dev/null
export HOMEBREW_DEV_CMD_RUN="1"
fi
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
Expand Down
10 changes: 5 additions & 5 deletions Library/Homebrew/utils/analytics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ migrate-legacy-uuid-file() {
local analytics_uuid="$(<"$legacy_uuid_file")"
if [[ -n "$analytics_uuid" ]]
then
git config --file="$HOMEBREW_REPOSITORY/.git/config" --replace-all homebrew.analyticsuuid "$analytics_uuid"
git config --file="$HOMEBREW_REPOSITORY/.git/config" --replace-all homebrew.analyticsuuid "$analytics_uuid" 2>/dev/null
fi
rm -f "$legacy_uuid_file"
fi
Expand All @@ -23,16 +23,16 @@ setup-analytics() {
return
fi

local message_seen="$(git config --file="$git_config_file" --get homebrew.analyticsmessage)"
local analytics_disabled="$(git config --file="$git_config_file" --get homebrew.analyticsdisabled)"
local message_seen="$(git config --file="$git_config_file" --get homebrew.analyticsmessage 2>/dev/null)"
local analytics_disabled="$(git config --file="$git_config_file" --get homebrew.analyticsdisabled 2>/dev/null)"
if [[ "$message_seen" != "true" || "$analytics_disabled" = "true" ]]
then
# Internal variable for brew's use, to differentiate from user-supplied setting
export HOMEBREW_NO_ANALYTICS_THIS_RUN="1"
return
fi

HOMEBREW_ANALYTICS_USER_UUID="$(git config --file="$git_config_file" --get homebrew.analyticsuuid)"
HOMEBREW_ANALYTICS_USER_UUID="$(git config --file="$git_config_file" --get homebrew.analyticsuuid 2>/dev/null)"
if [[ -z "$HOMEBREW_ANALYTICS_USER_UUID" ]]
then
if [[ -n "$HOMEBREW_LINUX" ]]
Expand All @@ -51,7 +51,7 @@ setup-analytics() {
export HOMEBREW_NO_ANALYTICS_THIS_RUN="1"
return
fi
git config --file="$git_config_file" --replace-all homebrew.analyticsuuid "$HOMEBREW_ANALYTICS_USER_UUID"
git config --file="$git_config_file" --replace-all homebrew.analyticsuuid "$HOMEBREW_ANALYTICS_USER_UUID" 2>/dev/null
fi

if [[ -n "$HOMEBREW_LINUX" ]]
Expand Down

0 comments on commit 4284b82

Please sign in to comment.