summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-28 07:33:54 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-29 07:13:03 (GMT)
commitd165fa14f0a111dfc85d964ecc037d0b280cd54f (patch)
tree4e7244f27b394bc4f2fd84a677bda73e1231276c
parentd6ea70af7708af5f29db09b2d782ab3b9ce50f79 (diff)
downloadgit-d165fa14f0a111dfc85d964ecc037d0b280cd54f.zip
git-d165fa14f0a111dfc85d964ecc037d0b280cd54f.tar.gz
git-d165fa14f0a111dfc85d964ecc037d0b280cd54f.tar.bz2
define die() for scripts that use it.
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>
-rwxr-xr-xgit-add.sh5
-rwxr-xr-xgit-branch.sh5
-rwxr-xr-xgit-diff.sh5
-rwxr-xr-xgit-merge-octopus.sh5
-rwxr-xr-xgit-tag.sh5
-rwxr-xr-xgit-verify-tag.sh5
6 files changed, 30 insertions, 0 deletions
diff --git a/git-add.sh b/git-add.sh
index b5fe46a..fdec86d 100755
--- a/git-add.sh
+++ b/git-add.sh
@@ -1,5 +1,10 @@
#!/bin/sh
+die () {
+ echo >&2 "$*"
+ exit 1
+}
+
usage() {
die "usage: git add [-n] [-v] <file>..."
}
diff --git a/git-branch.sh b/git-branch.sh
index b48c329..5306b27 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -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]]
diff --git a/git-diff.sh b/git-diff.sh
index b3ec84b..e45f50e 100755
--- a/git-diff.sh
+++ b/git-diff.sh
@@ -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
diff --git a/git-merge-octopus.sh b/git-merge-octopus.sh
index bb58e22..7adffdc 100755
--- a/git-merge-octopus.sh
+++ b/git-merge-octopus.sh
@@ -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
diff --git a/git-tag.sh b/git-tag.sh
index e710286..2435a75 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -8,6 +8,11 @@ usage () {
exit 1
}
+die () {
+ echo >&2 "$*"
+ exit 1
+}
+
annotate=
signed=
force=
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
index d6e0eb8..1f44da5 100755
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -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."