diff options
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r-- | git-sh-setup.sh | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index ebfe8f7a4d..d968760139 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -1,9 +1,6 @@ -#!/bin/sh -# -# 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. +# This shell scriplet is meant to be included by other shell scripts +# to set up some variables pointing at the normal git directories and +# a few helper shell functions. # Having this variable in your environment would break scripts because # you would cause "cd" to be taken to unexpected places. If you @@ -75,6 +72,8 @@ if test -n "$OPTIONS_SPEC"; then parseopt_extra= [ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash" + [ -n "$OPTIONS_STUCKLONG" ] && + parseopt_extra="$parseopt_extra --stuck-long" eval "$( echo "$OPTIONS_SPEC" | @@ -161,8 +160,9 @@ git_pager() { else GIT_PAGER=cat fi - : ${LESS=-FRSX} - export LESS + : ${LESS=-FRX} + : ${LV=-c} + export LESS LV eval "$GIT_PAGER" '"$@"' } @@ -330,8 +330,7 @@ esac # Make sure we are in a valid repository of a vintage we understand, # if we require to be in a git repository. -if test -z "$NONGIT_OK" -then +git_dir_init () { GIT_DIR=$(git rev-parse --git-dir) || exit if [ -z "$SUBDIRECTORY_OK" ] then @@ -346,6 +345,11 @@ then exit 1 } : ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"} +} + +if test -z "$NONGIT_OK" +then + git_dir_init fi peel_committish () { |