cro3 icon indicating copy to clipboard operation
cro3 copied to clipboard

Add a command to fix the entire commit stack by clang-format.py

Open hikalium opened this issue 2 years ago • 0 comments

When working with a stack of commits, I often have to format individual ones by doing git rebase -i, selecting the commit with bad formatting, running clang-format.py, git commit --amend for each commit with bad formatting.

It'd be nice to have lium format that just iterates over every commit in git rebase -i, runs clang-format.py, and git commit --amend the changes.

FYI: one-liner to apply cros format for every commit

git rebase --keep-base --exec 'git diff-tree --no-commit-id --name-only HEAD -r --relative . | xargs -I {} -- cros format {} && git commit --amend -a --no-edit'

hikalium avatar Jun 26 '23 10:06 hikalium