google / google/cro3

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

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
Rust
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.