#!/bin/sh
#
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
echo >&2 "usage: $0 [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>"
##
## git-am is supposed to be the newer and better tool for this job.
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
echo >&2 "applymbox [-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]"
## $3 - "info" file with Author, email and subject
## $4 - optional file containing signoff to add
##
-. git-sh-setup || die "Not a git archive."
+. git-sh-setup
final=.dotest/final-commit
##
#!/bin/sh
-. git-sh-setup || dir "Not a git archive"
+. git-sh-setup
usage() {
echo >&2 'usage: git bisect [start|bad|good|next|reset|visualize]
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
echo >&2 "usage: $(basename $0)"' [-d <branch>] | [[-f] <branch> [start-point]]
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die "usage: git checkout [-f] [-b <new_branch>] [<branch>] [<paths>...]"
# Copyright (c) 2005 Junio C Hamano.
#
-. git-sh-setup || die "Not a git archive."
+. git-sh-setup
usage="usage: $0 "'[-v] <upstream> [<head>]
# Copyright (c) 2005 Linus Torvalds
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die 'git commit [-a] [-s] [-v | --no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit>] [-e] [<path>...]'
# Copyright (c) 2005 Junio C Hamano
#
-. git-sh-setup || die "Not a git repository"
+. git-sh-setup
dc </dev/null 2>/dev/null || {
# This is not a real DC at all -- it just knows how
#!/bin/sh
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
. git-parse-remote
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
# Copyright (c) 2005 Junio C Hamano
#
-. git-sh-setup || die "Not a git archive."
+. git-sh-setup
usage () {
echo >&2 "usage: $0"' [-n] [-o dir | --stdout] [--keep-subject] [--mbox]
#!/bin/sh
-. git-sh-setup || die "Not a git archive."
+. git-sh-setup
laf="$GIT_DIR/lost-found"
rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit
# Copyright (c) 2005 Junio C Hamano
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
LF='
'
#
# Resolve two or more trees recorded in $GIT_DIR/FETCH_HEAD.
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die "usage: git octopus"
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
dryrun=
echo=
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
echo >&2 "usage: $0"' [-n] [--no-commit] [--no-summary] [--help]
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die "Usage: git push [--all] [--force] <repository> [<refspec>]"
# Copyright (c) 2005 Junio C Hamano.
#
-. git-sh-setup || die "Not a git archive."
+. git-sh-setup
# The other head is given
other=$(git-rev-parse --verify "$1^0") || exit
# Copyright (c) 2005 Linus Torvalds
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
no_update_info= all_into_one= remove_redundant= local=
while case "$#" in 0) break ;; esac
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die 'Usage: git reset [--mixed | --soft | --hard] [<commit-ish>]'
#
# Resolve two trees.
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
die "git-resolve <head> <remote> <merge-message>"
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2005 Junio C Hamano
#
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
case "$0" in
*-revert* )
#!/bin/sh
#
-# Set up GIT_DIR and GIT_OBJECT_DIRECTORY
-# and return true if everything looks ok
-#
-: ${GIT_DIR=.git}
-: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+# This is included in commands that either have to be run from the toplevel
+# of the repository, or with GIT_DIR environment variable properly.
+# If the GIT_DIR does not look like the right correct git-repository,
+# it dies.
# Having this variable in your environment would break scripts because
# you would cause "cd" to be be taken to unexpected places. If you
# exporting it.
unset CDPATH
+: ${GIT_DIR=.git}
+: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+
die() {
echo >&2 "$@"
exit 1
*) false ;;
esac &&
[ -d "$GIT_DIR/refs" ] &&
-[ -d "$GIT_OBJECT_DIRECTORY/" ]
+[ -d "$GIT_OBJECT_DIRECTORY/" ] ||
+ die "Not a git repository."
#
# Copyright (c) 2005 Linus Torvalds
#
-. git-sh-setup || die "Not a git archive"
+GIT_DIR=$(git-rev-parse --git-dir) || exit
report () {
header="#
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
usage () {
echo >&2 "Usage: git-tag [-a | -s | -u <key-id>] [-f | -d] [-m <msg>] <tagname> [<head>]"
#!/bin/sh
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
die "$1: no such object."