From 4339ab829d26aec638c819339f0b8bdb3c19b5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 12 Aug 2026 19:02:49 +0000 Subject: [PATCH] set pull.rebase, and say why core.editor is not set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pull.rebase true, which is the setting whose absence stopped this very repository mid-session today: git refuses to pull when branches have diverged and asks which of three things you meant, every time, until told once. Rebasing replays local commits on top of what was fetched rather than adding a merge commit that records nothing but the fact that you had not pulled yet. core.editor stays out, deliberately, and the run says so rather than leaving its absence to look like an oversight. Git's fallback chain is GIT_EDITOR → core.editor → $VISUAL → $EDITOR → system default, so core.editor is a git-only override sitting above $EDITOR. The original set both it and `export EDITOR` in the shell section — two settings for one preference, which drift apart the moment either is changed and leave git using an editor nothing else does. Setting only $EDITOR means git, crontab -e, visudo and systemctl edit all follow one answer. Verified on a throwaway account: .gitconfig comes out with user, init.defaultBranch master and pull.rebase true. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/setup/machine-setup/machine-setup.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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")