set pull.rebase, and say why core.editor is not set

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) <noreply@anthropic.com>
This commit is contained in:
2026-08-12 19:02:49 +00:00
co-authored by Claude Opus 5
parent 28673869c3
commit 4339ab829d
+14 -1
View File
@@ -1281,12 +1281,14 @@ if ! skip; then
GIT_NAME_NOW="$(git_get user.name)" GIT_NAME_NOW="$(git_get user.name)"
GIT_EMAIL_NOW="$(git_get user.email)" GIT_EMAIL_NOW="$(git_get user.email)"
GIT_BRANCH_NOW="$(git_get init.defaultBranch)" GIT_BRANCH_NOW="$(git_get init.defaultBranch)"
GIT_REBASE_NOW="$(git_get pull.rebase)"
GIT_DO=true GIT_DO=true
if git_has_identity; then if git_has_identity; then
echo " name: ${GIT_NAME_NOW:-not set}" echo " name: ${GIT_NAME_NOW:-not set}"
echo " email: ${GIT_EMAIL_NOW:-not set}" echo " email: ${GIT_EMAIL_NOW:-not set}"
echo " default branch: ${GIT_BRANCH_NOW:-not set (git uses master)}" 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 "" echo ""
# Default no. There is already a working identity, and the common case for # Default no. There is already a working identity, and the common case for
# re-running this script is everything except this. # re-running this script is everything except this.
@@ -1311,6 +1313,16 @@ if ! skip; then
echo " name: ${GIT_NAME}" echo " name: ${GIT_NAME}"
echo " email: ${GIT_EMAIL}" echo " email: ${GIT_EMAIL}"
echo " default branch: ${GIT_BRANCH}" 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 if confirm "Proceed?"; then
# Checked, not assumed. These run as another account and can fail for # 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 # 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.name "$GIT_NAME" || GIT_OK=false
git_set user.email "$GIT_EMAIL" || GIT_OK=false git_set user.email "$GIT_EMAIL" || GIT_OK=false
git_set init.defaultBranch "$GIT_BRANCH" || 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 if $GIT_OK && [[ "$(git_get user.name)" == "$GIT_NAME" ]]; then
ok "written to ${USER_HOME}/.gitconfig" 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 else
warn "could not write the git config for ${USERNAME}" warn "could not write the git config for ${USERNAME}"
ERRORS+=("Git: writing ${USER_HOME}/.gitconfig failed") ERRORS+=("Git: writing ${USER_HOME}/.gitconfig failed")