@matheusbsbs / matheus-bagliano / commits / d165fa14f0
Fork 0

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>

Junio C Hamano committed Nov 27, 2005 at 23:33 UTC d165fa14f0a111dfc85d964ecc037d0b280cd54f
6 files changed +30
git-add.sh
+5
@@ -1,5 +1,10 @@
1 #!/bin/sh
2
3 +die () {
4 + echo >&2 "$*"
5 + exit 1
6 +}
7 +
8 usage() {
9 die "usage: git add [-n] [-v] <file>..."
10 }
git-branch.sh
+5
@@ -2,6 +2,11 @@
2
3 GIT_DIR=`git-rev-parse --git-dir` || exit $?
4
5 +die () {
6 + echo >&2 "$*"
7 + exit 1
8 +}
9 +
10 usage () {
11 echo >&2 "usage: $(basename $0)"' [-d <branch>] | [[-f] <branch> [start-point]]
12
git-diff.sh
+5
@@ -9,6 +9,11 @@ files=$(git-rev-parse --no-revs --no-flags --sq "$@")
9
10 : ${flags:="'-M' '-p'"}
11
12 +die () {
13 + echo >&2 "$*"
14 + exit 1
15 +}
16 +
17 # I often say 'git diff --cached -p' and get scolded by git-diff-files, but
18 # obviously I mean 'git diff --cached -p HEAD' in that case.
19 case "$rev" in
git-merge-octopus.sh
+5
@@ -8,6 +8,11 @@
8 LF='
9 '
10
11 +die () {
12 + echo >&2 "$*"
13 + exit 1
14 +}
15 +
16 # The first parameters up to -- are merge bases; the rest are heads.
17 bases= head= remotes= sep_seen=
18 for arg
git-tag.sh
+5
@@ -8,6 +8,11 @@ usage () {
8 exit 1
9 }
10
11 +die () {
12 + echo >&2 "$*"
13 + exit 1
14 +}
15 +
16 annotate=
17 signed=
18 force=
git-verify-tag.sh
+5
@@ -2,6 +2,11 @@
2
3 GIT_DIR=`git-rev-parse --git-dir` || exit $?
4
5 +die () {
6 + echo >&2 "$*"
7 + exit 1
8 +}
9 +
10 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
11 die "$1: no such object."
12