summaryrefslogtreecommitdiff
path: root/Utilities/GitSetup/setup-user
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/GitSetup/setup-user')
-rwxr-xr-xUtilities/GitSetup/setup-user9
1 files changed, 8 insertions, 1 deletions
diff --git a/Utilities/GitSetup/setup-user b/Utilities/GitSetup/setup-user
index 0b98879491..4cbd184d41 100755
--- a/Utilities/GitSetup/setup-user
+++ b/Utilities/GitSetup/setup-user
@@ -20,7 +20,14 @@
# Project configuration instructions: NONE
for (( ; ; )); do
- ident="$(git var GIT_AUTHOR_IDENT 2>/dev/null | rev | cut -d' ' -f3- | rev)"
+ if type -p rev >/dev/null && type -p cut >/dev/null; then
+ ident="$(git var GIT_AUTHOR_IDENT 2>/dev/null | rev | cut -d' ' -f3- | rev)"
+ elif user_name=$(git config --get user.name) &&
+ user_email=$(git config --get user.email); then
+ ident="$user_name <$user_email>"
+ else
+ ident=""
+ fi
if test -n "$ident"; then
echo 'Your commits will record as Author: