Skip to content
This repository has been archived by the owner on May 8, 2018. It is now read-only.

Commit

Permalink
Remove the '--explain' switch.
Browse files Browse the repository at this point in the history
It doesn't really stand up that well under the optimizations made by
hack, and I almost never use it anymore, so just set it quietly aside.
  • Loading branch information
eventualbuddha committed Sep 9, 2011
1 parent 9792b4f commit 2ed06ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 39 deletions.
26 changes: 5 additions & 21 deletions bin/hack
Expand Up @@ -11,9 +11,7 @@ fi
project=$(basename "$rootdir")

# default settings
explain=false
verbose=true
run=true
branch=$CURRENT

printUsage() {
Expand All @@ -22,7 +20,6 @@ printUsage() {
echo " -h --help Show this message"
echo " -v --verbose Show all commands before running them (default: on)"
echo " -q --quiet Don't display commands before running them (default: off)"
echo " -e --explain --dry-run Don't actually run commands (default: off)"
echo
echo " If BRANCH is given then that branch will be updated and switched to instead of the"
echo " current branch."
Expand All @@ -32,11 +29,6 @@ printUsage() {
for arg in "$@"; do
case $arg
in
-e | --explain | --dry-run)
explain=true
verbose=true
run=false
;;
-v | --verbose)
verbose=true
;;
Expand Down Expand Up @@ -85,9 +77,7 @@ git() {
echo -e "+ ${GREEN}git $@${NO_COLOR}"
fi

if [ "$run" = true ]; then
eval "$GIT $@"
fi
eval "$GIT $@"
}

no_changes () {
Expand Down Expand Up @@ -161,10 +151,6 @@ different_refs() {
stashed=false
noop=true

if [ "$explain" = true ]; then
echo "These are the commands that would be run:"
fi

REMOTE=`$GIT config branch.$branch.remote`

if [ -z "$REMOTE" ]; then
Expand Down Expand Up @@ -222,10 +208,8 @@ fi

pop_stash_if_needed

if [ "$run" = true ]; then
if [ "$noop" = false ]; then
good "Successfully updated $project."
else
good "$project already up to date."
fi
if [ "$noop" = false ]; then
good "Successfully updated $project."
else
good "$project already up to date."
fi
20 changes: 2 additions & 18 deletions bin/ship
Expand Up @@ -5,17 +5,14 @@ CURRENT=${CURRENT#refs/heads/}
gitdir=$(git rev-parse --git-dir)

# default settings
explaining=false
verbose=true
run=true

printUsage() {
echo "usage: $0 [options] [remote]"
echo
echo " -h --help Show this message"
echo " -v --verbose Show all commands before running them (default: on)"
echo " -q --quiet Don't display commands before running them (default: off)"
echo " -e --explain --dry-run Don't actually run commands (default: off)"
echo
echo " remote Which remote we should push to (default: origin)"
echo
Expand All @@ -24,11 +21,6 @@ printUsage() {
for arg in "$@"; do
case $arg
in
-e | --explain | --dry-run)
explain=true
verbose=true
run=false
;;
-v | --verbose)
verbose=true
;;
Expand Down Expand Up @@ -76,15 +68,9 @@ git() {
echo -e "+ ${GREEN}git $@${NO_COLOR}"
fi

if [ "$run" = true ]; then
eval "$GIT $@"
fi
eval "$GIT $@"
}

if [ "$explain" = true ]; then
echo "These are the commands that would be run:"
fi

if [ -z "$REMOTE" ]; then
REMOTE=`$GIT config branch.$CURRENT.remote`
fi
Expand Down Expand Up @@ -142,6 +128,4 @@ if [ "$TYPE" = "git-svn" ]; then
die "Could not complete the rebase from the upstream Subversion server."
fi

if [ "$run" = true ]; then
good "Successfully shipped your changes from $CURRENT to $REMOTE"
fi
good "Successfully shipped your changes from $CURRENT to $REMOTE"

0 comments on commit 2ed06ab

Please sign in to comment.