Skip to content

Add tab-in-indent whitespace rule

Chris Webb git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6whitespace: we cannot "catch all errors known to git" anymorews.c+4 -20 replies
2/6whitespace: add tab-in-indent error classDocumentation/config.txt cache.h ws.c+25 -51 reply
3/6whitespace: tests for git-diff --check with tab-in-indent error classt/t4015-diff-whitespace.sh+42 -00 replies
4/6whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dstbuiltin/apply.c cache.h ws.c+48 -540 replies
5/6whitespace: add tab-in-indent support for --whitespace=fixws.c+18 -30 replies
6/6whitespace: tests for git-apply --whitespace=fix with tab-in-indentt/t4124-apply-ws-rule.sh+29 -240 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] Add tab-in-indent whitespace rule

This patch set introduces a new whitespace error/fix class for projects and languages with a coding style where no tab character is used to indent the lines.

To implement this feature, we need to rework ws_fix_copy() to append to a strbuf rather than write into a fixed-size output buffer, because tabs may be expanded into multiple spaces when tab-in-indent is applied. We also have to change the "catch all errors known to git" to exclude tab-in-indent, which directly conflicts with the existing indent-with-non-tab rule.

Junio C Hamano (1):
whitespace: we cannot "catch all errors known to git" anymore

Chris Webb (5):
whitespace: add tab-in-indent error class
whitespace: tests for git-diff --check with tab-in-indent error class
whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst
whitespace: add tab-in-indent support for --whitespace=fix
whitespace: tests for git-apply --whitespace=fix with tab-in-indent

 Documentation/config.txt   |    2 +
 builtin/apply.c            |   81 +++++++++++++++++++++-----------------------
 cache.h                    |    3 +-
 t/t4015-diff-whitespace.sh |   42 +++++++++++++++++++++++
 t/t4124-apply-ws-rule.sh   |   53 ++++++++++++++++-------------
 ws.c                       |   73 ++++++++++++++++++++++++++++-----------
 6 files changed, 166 insertions(+), 88 deletions(-)