Honor rebase.autoSquash config in interactive rebase - #5
Open
sei40kr wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When generating the interactive rebase todo ourselves (rather than letting git generate it), we must explicitly honor the
rebase.autoSquashgit config setting, since git's config-driven autosquash only applies to git-generated todos.Changes
Ensure
--autosquashflag 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.autoSquashconfig explicitly inopen_todo_editorvia a newautosquash_configured()helper that queries git config with--type=boolto normalize any spelling git accepts (yes/no/true/false/0/1) into a canonical boolean.Apply autosquash to seeded todo entries when either the
--autosquashflag 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 rebaseinvocation.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