diff --git a/scripts/setup/machine-setup/machine-setup.sh b/scripts/setup/machine-setup/machine-setup.sh index f6a8282d..f2cf852f 100755 --- a/scripts/setup/machine-setup/machine-setup.sh +++ b/scripts/setup/machine-setup/machine-setup.sh @@ -1281,12 +1281,14 @@ if ! skip; then GIT_NAME_NOW="$(git_get user.name)" GIT_EMAIL_NOW="$(git_get user.email)" GIT_BRANCH_NOW="$(git_get init.defaultBranch)" + GIT_REBASE_NOW="$(git_get pull.rebase)" GIT_DO=true if git_has_identity; then echo " name: ${GIT_NAME_NOW:-not set}" echo " email: ${GIT_EMAIL_NOW:-not set}" echo " default branch: ${GIT_BRANCH_NOW:-not set (git uses master)}" + echo " git pull: ${GIT_REBASE_NOW:+rebase}${GIT_REBASE_NOW:-not set — git asks every time branches diverge}" echo "" # Default no. There is already a working identity, and the common case for # re-running this script is everything except this. @@ -1311,6 +1313,16 @@ if ! skip; then echo " name: ${GIT_NAME}" echo " email: ${GIT_EMAIL}" echo " default branch: ${GIT_BRANCH}" + echo " git pull: rebase" + echo "" + echo " pull.rebase replays your local commits on top of what was fetched" + echo " instead of adding a merge commit that records nothing. Without it," + echo " git stops on the first divergence and refuses to pull until told" + echo " which to do." + echo "" + echo " core.editor is deliberately not set here. Git falls back to \$EDITOR," + echo " which the shell section sets — so crontab, visudo and git all follow" + echo " one preference instead of two that can drift apart." if confirm "Proceed?"; then # Checked, not assumed. These run as another account and can fail for # reasons that have nothing to do with the values — which is exactly what @@ -1319,10 +1331,11 @@ if ! skip; then git_set user.name "$GIT_NAME" || GIT_OK=false git_set user.email "$GIT_EMAIL" || GIT_OK=false git_set init.defaultBranch "$GIT_BRANCH" || GIT_OK=false + git_set pull.rebase true || GIT_OK=false if $GIT_OK && [[ "$(git_get user.name)" == "$GIT_NAME" ]]; then ok "written to ${USER_HOME}/.gitconfig" - SUMMARY+=("Git: ${GIT_NAME} <${GIT_EMAIL}>, default branch ${GIT_BRANCH}") + SUMMARY+=("Git: ${GIT_NAME} <${GIT_EMAIL}>, default branch ${GIT_BRANCH}, pull rebases") else warn "could not write the git config for ${USERNAME}" ERRORS+=("Git: writing ${USER_HOME}/.gitconfig failed")