Skip to content

Honor rebase.autoSquash config in interactive rebase - #5

Open
sei40kr wants to merge 1 commit into
mainfrom
claude/marker-commit-autosquash-ir4gk0
Open

Honor rebase.autoSquash config in interactive rebase#5
sei40kr wants to merge 1 commit into
mainfrom
claude/marker-commit-autosquash-ir4gk0

Conversation

@sei40kr

@sei40kr sei40kr commented Jul 26, 2026

Copy link
Copy Markdown
Owner

When generating the interactive rebase todo ourselves (rather than letting git generate it), we must explicitly honor the rebase.autoSquash git config setting, since git's config-driven autosquash only applies to git-generated todos.

Changes

  • Ensure --autosquash flag is always passed when opening the interactive rebase picker, matching magit's behavior of unconditionally including it on top of any toggled switches.

  • Read rebase.autoSquash config explicitly in open_todo_editor via a new autosquash_configured() helper that queries git config with --type=bool to normalize any spelling git accepts (yes/no/true/false/0/1) into a canonical boolean.

  • Apply autosquash to seeded todo entries when either the --autosquash flag is present OR the config is enabled, since we generate and overwrite the todo ourselves (unlike git, which would apply config to its own generated todo).

  • Updated comments to clarify that both the flag and config must be honored at todo-seeding time, not passed through to the final git rebase invocation.

  • Added integration test (rebase_autosquash_config_reads_as_normalized_bool) to verify that config reads are normalized correctly across different git config spellings and handle the unset case.

https://claude.ai/code/session_018DASEz1jtWjjDeioqjNCaH

The in-app todo editor writes the rebase plan itself and installs it over
whatever git generated (GIT_SEQUENCE_EDITOR is a cp), so autosquash only
happened when the transient's -a switch was toggled explicitly: the
rebase.autoSquash config was silently overridden, and plain "rebase
interactively" left fixup!/squash! commits as picks.

Match git and Magit:

- "Rebase interactively" (r i) now always seeds the plan autosquashed,
  like magit-rebase-interactive's unconditional --autosquash.
- open_todo_editor also honors the rebase.autoSquash config, which git
  would have applied had it generated the todo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018DASEz1jtWjjDeioqjNCaH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants