summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 16139f9)
raw | patch | inline | side by side (parent: 16139f9)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 11 Feb 2006 20:39:11 +0000 (12:39 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Feb 2006 12:59:25 +0000 (04:59 -0800) |
This is to be nicer to people with unusable GECOS field.
"git-var -l" is currently broken in that when used by a user who
does not have a usable GECOS field and has not corrected it by
exporting GIT_COMMITTER_NAME environment variable it dies when
it tries to output GIT_COMMITTER_IDENT (same thing for AUTHOR).
"git-pull" used "git-var -l" only because it needed to get a
configuration variable before "git-repo-config --get" was
introduced. Use the latter tool designed exactly for this
purpose.
"git-sh-setup" used "git-var GIT_AUTHOR_IDENT" without actually
wanting to use its value. The only purpose was to cause the
command to check and barf if the repository format version
recorded in the $GIT_DIR/config file is too new for us to deal
with correctly. Instead, use "repo-config --get" on a random
property and see if it die()s, and check if the exit status is
128 (comes from die -- missing variable is reported with exit
status 1, so we can tell that case apart).
Signed-off-by: Junio C Hamano <junkio@cox.net>
"git-var -l" is currently broken in that when used by a user who
does not have a usable GECOS field and has not corrected it by
exporting GIT_COMMITTER_NAME environment variable it dies when
it tries to output GIT_COMMITTER_IDENT (same thing for AUTHOR).
"git-pull" used "git-var -l" only because it needed to get a
configuration variable before "git-repo-config --get" was
introduced. Use the latter tool designed exactly for this
purpose.
"git-sh-setup" used "git-var GIT_AUTHOR_IDENT" without actually
wanting to use its value. The only purpose was to cause the
command to check and barf if the repository format version
recorded in the $GIT_DIR/config file is too new for us to deal
with correctly. Instead, use "repo-config --get" on a random
property and see if it die()s, and check if the exit status is
128 (comes from die -- missing variable is reported with exit
status 1, so we can tell that case apart).
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-pull.sh | patch | blob | history | |
git-sh-setup.sh | patch | blob | history |
diff --git a/git-pull.sh b/git-pull.sh
index 0991d5f14cd6d903572a041cfbfe3cde219c738f..6caf1aad471bbf8f894ea20a80c3be082012648b 100755 (executable)
--- a/git-pull.sh
+++ b/git-pull.sh
exit 0
;;
?*' '?*)
- var=`git-var -l | sed -ne 's/^pull\.octopus=/-s /p'`
+ var=`git repo-config --get pull.octopus`
if test '' = "$var"
then
strategy_default_args='-s octopus'
else
- strategy_default_args=$var
+ strategy_default_args="-s $var"
fi
;;
*)
- var=`git-var -l | sed -ne 's/^pull\.twohead=/-s /p'`
+ var=`git repo-config --get pull.twohead`
if test '' = "$var"
then
strategy_default_args='-s recursive'
else
- strategy_default_args=$var
+ strategy_default_args="-s $var"
fi
;;
esac
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 1e638e493d51c9216e3d2e93aad5657cdf9793b4..157c7e4d6ce470191ca4207aaf1ecbf5cd4c7d75 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
# Make sure we are in a valid repository of a vintage we understand.
- GIT_DIR="$GIT_DIR" git-var GIT_AUTHOR_IDENT >/dev/null || exit
+ GIT_DIR="$GIT_DIR" git repo-config --get core.nosuch >/dev/null
+ if test $? == 128
+ then
+ exit
+ fi
else
GIT_DIR=$(git-rev-parse --git-dir) || exit
fi