git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/1] diff --check for indent-with-spaces style
@ 2010-03-27 14:08 Chris Webb
  2010-03-27 14:08 ` [RFC 1/1] Add new indent-with-tab whitespace check Chris Webb
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Webb @ 2010-03-27 14:08 UTC (permalink / raw)
  To: git

I've been preparing some patches against a project (qemu) which has an indent
style of only spaces, i.e. tabs forbidden. I usually use diff --check to make
sure I catch stray spaces when I'm working on tab-indented code, and although
core.whitespace can be set to indent-with-non-tab to enforce the use of tabs,
there's no corresponding 'indent-with-tab' rule to forbid them. The asymmetry
bothered me, so I've added support for this to ws.c in the following small
patch.

Would this rule be more clearly described as indent-with-non-space instead?

For completeness, I'd also like to support core.whitespace = indent-with-tab
in git apply --whitespace=fix (although I don't use this myself). It's trivial
to expand the tabs in ws_fix_copy(), but this would violate the assumption in
the calling code that whitespace cleanup doesn't result in a dst string longer
than src. I think the only sane way I can deal with this correctly is to
properly replumb ws_fix_copy() and its callers to use a strbuf instead of a
char *dst?

 cache.h |    1 +
 ws.c    |   26 ++++++++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-02 10:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-27 14:08 [RFC 0/1] diff --check for indent-with-spaces style Chris Webb
2010-03-27 14:08 ` [RFC 1/1] Add new indent-with-tab whitespace check Chris Webb
2010-03-31 16:23   ` Junio C Hamano
2010-04-01 18:51     ` Re* " Junio C Hamano
2010-04-01 19:02       ` Junio C Hamano
2010-04-02 10:55     ` Chris Webb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).