Something tells me it wouldn't be insurmountable to help facilitate running quality checks on each commit. While it would be nice for git rebase --continue to simply run the normal git hooks when running pick 12498y feature bug fix (i.e. - treat it like an edit plus undo+redo commit. while also maybe preserving date+author information) - OR maybe there's a good argument to add new hooks around rebase-continue.....
What could absolutely be done, I believe without modifications to git core, would be a pre-push hook that basically creates a worktree in the background, steps though each commit, running the quality checks on each commit. However, if a commit has an issue, you'll have to rebase -> edit that commit anyway.
So, here's something I would consider implementing: 1. pre-push check requires clean git status (seems pretty reasonable to me) 2. pre-push hook will somehow automatically rebase whole branch... but run the commit hooks for each commit for you. It's possible some simple checks could be invoked with rebase exec keyword (sibling of pick, squash, and reword). But I think it would be best to run this cycle:
- git pull origin $pr_target_branch --rebase. 2. Edit git-rebase-todo file - replace all pick with edit. 3. git rebase --continue. 4. undo last commit (git reset --soft HEAD^1 iirc), 5. re-run last commit (so all hooks at that point run as they normally do). Repeat 3-5 for all commits. If any commit fails, developer will have to fix pre-commit checks on that commit.
could also restore "Suggested reviewers"
Really fleshed out this idea in an answer here:
https://stackoverflow.com/questions/22017029/what-git-hooks-apply-to-git-rebase-continue/22017539#comment124307729_22017539