Skip to content

Commit

Permalink
define die() for scripts that use it.
Browse files Browse the repository at this point in the history
As a fallout from not using git-sh-setup in scripts that can
operate from a subdirectory, we lost definition of die() from
them.  It might make sense to do some cleanup to consolidate
them back again, but this should suffice for now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 29, 2005
1 parent d6ea70a commit d165fa1
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-add.sh
@@ -1,5 +1,10 @@
#!/bin/sh

die () {
echo >&2 "$*"
exit 1
}

usage() {
die "usage: git add [-n] [-v] <file>..."
}
Expand Down
5 changes: 5 additions & 0 deletions git-branch.sh
Expand Up @@ -2,6 +2,11 @@

GIT_DIR=`git-rev-parse --git-dir` || exit $?

die () {
echo >&2 "$*"
exit 1
}

usage () {
echo >&2 "usage: $(basename $0)"' [-d <branch>] | [[-f] <branch> [start-point]]
Expand Down
5 changes: 5 additions & 0 deletions git-diff.sh
Expand Up @@ -9,6 +9,11 @@ files=$(git-rev-parse --no-revs --no-flags --sq "$@")

: ${flags:="'-M' '-p'"}

die () {
echo >&2 "$*"
exit 1
}

# I often say 'git diff --cached -p' and get scolded by git-diff-files, but
# obviously I mean 'git diff --cached -p HEAD' in that case.
case "$rev" in
Expand Down
5 changes: 5 additions & 0 deletions git-merge-octopus.sh
Expand Up @@ -8,6 +8,11 @@
LF='
'

die () {
echo >&2 "$*"
exit 1
}

# The first parameters up to -- are merge bases; the rest are heads.
bases= head= remotes= sep_seen=
for arg
Expand Down
5 changes: 5 additions & 0 deletions git-tag.sh
Expand Up @@ -8,6 +8,11 @@ usage () {
exit 1
}

die () {
echo >&2 "$*"
exit 1
}

annotate=
signed=
force=
Expand Down
5 changes: 5 additions & 0 deletions git-verify-tag.sh
Expand Up @@ -2,6 +2,11 @@

GIT_DIR=`git-rev-parse --git-dir` || exit $?

die () {
echo >&2 "$*"
exit 1
}

type="$(git-cat-file -t "$1" 2>/dev/null)" ||
die "$1: no such object."

Expand Down

0 comments on commit d165fa1

Please sign in to comment.