From: Chris Webb <chris@arachsys.com>
To: git@vger.kernel.org
Subject: [RFC 0/1] diff --check for indent-with-spaces style
Date: Sat, 27 Mar 2010 14:08:00 +0000 [thread overview]
Message-ID: <1269698881-26443-1-git-send-email-chris@arachsys.com> (raw)
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(-)
next reply other threads:[~2010-03-27 14:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-27 14:08 Chris Webb [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1269698881-26443-1-git-send-email-chris@arachsys.com \
--to=chris@arachsys.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).