"diff --check" and whitespace enhancements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | "diff --check" should affect exit statusDocumentation/ builtin-diff-files.c builtin-diff-index.c +5 more | +184 | 10 replies | |
| 2/5 | New version of pre-commit hooktemplates/ | +7 | 3 replies | |
| 3/5 | Unify whitespace checkingbuiltin-apply.c cache.h diff.c +2 more | +139 | 3 replies | |
| 4/5 | Make "diff --check" output match "git apply"builtin-apply.c diff.c | +3 | 1 reply | |
| 5/5 | Add tests for "git diff --check" with core.whitespace optionst/ | +50 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/5] "diff --check" and whitespace enhancements
This is a repost of the topic I posted yesterday, rebased on top of master and omitting the changes already applied to it.
Of the series the most interesting is [3/5], where I implement Junio's suggestion of further refactoring to get rid of emit_line_with_ws().
[1/5] "diff --check" should affect exit status
[2/5] New version of pre-commit hook
[3/5] Unify whitespace checking
[4/5] Make "diff --check" output match "git apply"
[5/5] Add tests for "git diff --check" with core.whitespace options
I think there are still some opportunities for further refactoring and clean-up, but this is a good start.
Overall the refactoring saves duplication and reduces the line count (apart from the tests, of course, where line count goes unequivocally up).
Documentation/diff-options.txt | 4 +- builtin-apply.c | 56 +++---------- builtin-diff-files.c | 2 + builtin-diff-index.c | 2 + builtin-diff-tree.c | 28 +++--- builtin-diff.c | 3 +- cache.h | 4 + diff.c | 172 +++++++++--------------------------- diff.h | 1 + t/t4015-diff-whitespace.sh | 189 +++++++++++++++++++++++++++++++++++++++- templates/hooks--pre-commit | 67 ++------------- ws.c | 105 ++++++++++++++++++++++ 12 files changed, 379 insertions(+), 254 deletions(-)
Cheers,
Wincent