From: "\"Peter Valdemar Mørch (Lists)\"" <4ux6as402@sneakemail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] Document disabling core.whitespace values trailing-space and space-before-tab
Date: Fri, 25 Jul 2008 08:13:17 +0200 [thread overview]
Message-ID: <48896EFD.8010209@sneakemail.com> (raw)
In-Reply-To: <7vbq0m608w.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 532 bytes --]
> So I think Peter's patch is going in the right direction.
Thus encouraged, I've created a file with two more patches like I
described in my previous mail: one that fixes up .gitattributes and one
that fixes up t/* to conform to documented syntax of core.whitespace.
(For the future: Is it better to have one file with tree patches like I
have created with "git format-patch -M -s --stdout", 3 individual
numbered files, or one single patch created with git-merge --squash?)
Peter
--
Peter Valdemar Mørch
http://www.morch.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: core.whitespace.patch --]
[-- Type: text/x-patch; name="core.whitespace.patch", Size: 5595 bytes --]
>From 900455ce5a4e8bf771aea2e3dbdbab38e440cdf4 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Peter=20Valdemar=20M=C3=B8rch?= <peter@morch.com>
Date: Thu, 24 Jul 2008 07:18:48 +0200
Subject: [PATCH] Document disabling core.whitespace values trailing-space and space-before-tab
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Valdemar Mørch <peter@morch.com>
---
Documentation/config.txt | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index e784805..a198b3c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -361,10 +361,12 @@ core.whitespace::
consider them as errors:
+
* `trailing-space` treats trailing whitespaces at the end of the line
- as an error (enabled by default).
+ as an error (enabled by default - disable with 'git config core.whitespace
+ "-trailing-space"').
* `space-before-tab` treats a space character that appears immediately
before a tab character in the initial indent part of the line as an
- error (enabled by default).
+ error (enabled by default - disable with 'git config core.whitespace
+ "-space-before-tab"').
* `indent-with-non-tab` treats a line that is indented with 8 or more
space characters as an error (not enabled by default).
* `cr-at-eol` treats a carriage-return at the end of line as
--
1.5.6
>From c73dd588bef2a56fc44af2ce10cedef1b779a510 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Peter=20Valdemar=20M=C3=B8rch?= <peter@morch.com>
Date: Fri, 25 Jul 2008 07:33:07 +0200
Subject: [PATCH] Fixed up .gitattributes to allign with git-config.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Valdemar Mørch <peter@morch.com>
---
.gitattributes | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gitattributes b/.gitattributes
index 6b9c715..1a903b6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,2 @@
-* whitespace=!indent,trail,space
-*.[ch] whitespace
+* whitespace=-indent-with-non-tab,trailing-space,space-before-tab
+*.[ch] !whitespace
--
1.5.6
>From 45889568fec2b952e10aef2fac78ba6dfda9f46d Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Peter=20Valdemar=20M=C3=B8rch?= <peter@morch.com>
Date: Fri, 25 Jul 2008 07:59:24 +0200
Subject: [PATCH] tests now use git-config's core.whitespace only with documented values
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Valdemar Mørch <peter@morch.com>
---
t/t4019-diff-wserror.sh | 14 +++++++-------
t/t4124-apply-ws-rule.sh | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh
index 0d9cbb6..ecff30d 100755
--- a/t/t4019-diff-wserror.sh
+++ b/t/t4019-diff-wserror.sh
@@ -33,9 +33,9 @@ test_expect_success default '
'
-test_expect_success 'without -trail' '
+test_expect_success 'without -trailing-space' '
- git config core.whitespace -trail
+ git config core.whitespace -trailing-space
git diff --color >output
grep "$blue_grep" output >error
grep -v "$blue_grep" output >normal
@@ -48,10 +48,10 @@ test_expect_success 'without -trail' '
'
-test_expect_success 'without -trail (attribute)' '
+test_expect_success 'without -trailing-space (attribute)' '
git config --unset core.whitespace
- echo "F whitespace=-trail" >.gitattributes
+ echo "F whitespace=-trailing-space" >.gitattributes
git diff --color >output
grep "$blue_grep" output >error
grep -v "$blue_grep" output >normal
@@ -99,7 +99,7 @@ test_expect_success 'without -space (attribute)' '
test_expect_success 'with indent-non-tab only' '
rm -f .gitattributes
- git config core.whitespace indent,-trailing,-space
+ git config core.whitespace indent-with-non-tab,-trailing-space,-space-before-tab
git diff --color >output
grep "$blue_grep" output >error
grep -v "$blue_grep" output >normal
@@ -115,7 +115,7 @@ test_expect_success 'with indent-non-tab only' '
test_expect_success 'with indent-non-tab only (attribute)' '
git config --unset core.whitespace
- echo "F whitespace=indent,-trailing,-space" >.gitattributes
+ echo "F whitespace=indent-with-non-tab,-trailing-space,-space-before-tab" >.gitattributes
git diff --color >output
grep "$blue_grep" output >error
grep -v "$blue_grep" output >normal
@@ -147,7 +147,7 @@ test_expect_success 'with cr-at-eol' '
test_expect_success 'with cr-at-eol (attribute)' '
git config --unset core.whitespace
- echo "F whitespace=trailing,cr-at-eol" >.gitattributes
+ echo "F whitespace=trailing-space,cr-at-eol" >.gitattributes
git diff --color >output
grep "$blue_grep" output >error
grep -v "$blue_grep" output >normal
diff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh
index 85f3da2..644aadc 100755
--- a/t/t4124-apply-ws-rule.sh
+++ b/t/t4124-apply-ws-rule.sh
@@ -106,7 +106,7 @@ test_expect_success 'whitespace=error-all, default rule' '
test_expect_success 'whitespace=error-all, no rule' '
- git config core.whitespace -trailing,-space-before,-indent &&
+ git config core.whitespace -trailing-space,-space-before-tab,-indent-with-non-tab &&
apply_patch --whitespace=error-all &&
diff file target
@@ -130,7 +130,7 @@ do
for i in - ''
do
case "$i" in '') ti='#' ;; *) ti= ;; esac
- rule=${t}trailing,${s}space,${i}indent
+ rule=${t}trailing-space,${s}space-before-tab,${i}indent-with-non-tab
rm -f .gitattributes
test_expect_success "rule=$rule" '
--
1.5.6
next prev parent reply other threads:[~2008-07-25 6:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-24 5:34 [PATCH] Document disabling core.whitespace values trailing-space and space-before-tab "Peter Valdemar Mørch (Lists)"
2008-07-24 8:29 ` Nanako Shiraishi
2008-07-24 9:41 ` "Peter Valdemar Mørch (Lists)"
2008-07-25 4:44 ` Junio C Hamano
2008-07-25 6:11 ` Peter Valdemar Mørch
2008-07-25 6:13 ` "Peter Valdemar Mørch (Lists)" [this message]
2008-07-25 8:49 ` Junio C Hamano
2008-07-25 7:28 ` Junio C Hamano
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=48896EFD.8010209@sneakemail.com \
--to=4ux6as402@sneakemail.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).