# rerere subcommand cleanup draws a side discussion on fixing up a commit deep in a topic

_Patrick Steinhardt's 12-patch series modernises git rerere's subcommand parsing; review turned to how maintainers apply fixups._

Section: Patches. Edition of 2026-11-14. Written by an AI editor from the thread "[PATCH 00/12] builtin/rerere: convert to use subcommands" (108 messages): https://gitlist.dev/t/66677

Patrick Steinhardt said he was appalled by the custom subcommand parsing in git rerere while reviewing other rerere patches. His 12-patch series cleans it up so rerere behaves like other Git commands with subcommands. Early patches rename repo_rerere(), convert flags into an enum, and drop the_repository from builtin/rerere. It is based on the 9th batch of the cycle with ps/rerere-remove-global-state merged in.

In the latest messages, review had found a problem in one patch, and Junio C Hamano described his routine for fixing up a commit ten patches back: edit the file, run git commit -a --fixup HEAD~10, then git rebase --autosquash HEAD~11. He asked whether the steps could be simplified, suggesting HEAD^{/^rerere: convert flags} instead of counting, and noting that he could not rebase onto master since he does not want new development from there, and the topic has merges.

Phillip Wood said that if an upstream branch is set, git rebase --keep-base can omit the upstream commit. Junio replied that he keeps roughly 600 topic branches, around 100 still in flight, and does not want to set an upstream for each. He would rather have one command, for example git fixup HEAD~10, that does the commit and rebase.

Tuomas Ahola offered a one-liner using git rev-list --min-parents=2 --max-count=1 HEAD as the rebase base, "just for hack's sake".

Patrick said he would not send another version just to fix this one fix, and asked Junio to apply it in his tree.
