+set_user=$(git config --get "user.name")
+set_email=$(git config --get "user.email")
+
+if [ "x$set_user" = "x" ]
+then
+ # Try to guess the user's name by looking it up in the password file
+ new_user=$(getent passwd $(whoami) | awk -F: '{ print $5 }')
+ if [ "x$new_user" = "x" ]
+ then
+ new_user="(no default)"
+ fi
+else
+ new_user=$set_user
+fi
+ask "Your name" "${new_user}" new_user
+if [ "x$new_user" = "x(no default)" ]
+then
+ echo "Cannot continue, git needs to record your name against commits"
+ exit 1
+fi
+
+if [ "x$set_email" = "x" ]
+then
+ new_email="(no_default)"
+else
+ new_email=$set_email
+fi
+
+ask "Your email address (for git commits)" "${new_email}" new_email
+if [ "x$new_email" = "x(no default)" ]
+then
+ echo "Cannot continue, git needs to record your email address against commits"
+ exit 1
+fi
+
+if [ "x$set_user" != "x$new_user" ]
+then
+ git config "user.name" "$new_user"
+fi
+
+if [ "x$set_email" != "x$new_email" ]
+then
+ git config "user.email" "$new_email"
+fi
+
+upstream=$(git config --get "gcc-config.upstream")