# git-commit/git-applypatch whitespace rules different?

2 messages from 2007-01-11 to 2007-01-12. Participants: Michael S. Tsirkin.
Thread: https://gitlist.dev/t/6343

## Michael S. Tsirkin, 2007-01-11 22:12

Subject: git-commit/git-applypatch whitespace rules different?
Message-ID: <20070111221211.GM17999@mellanox.co.il>
URL: https://gitlist.dev/e/20070111221211.GM17999%40mellanox.co.il

```
git-commit/git-applypatch whitespace rules seem to be different.
Is this expected?

Example:
I take a patch, apply it and commit without warnings about whitespace:

$patch -p1 -i /tmp/ipoib_cm.patc
$git commit drivers/infiniband/ulp/ipoib/
Created commit f83bc11fd3cadb0b3f27d31fbaaa1a5d409e65d9
 8 files changed, 339 insertions(+), 31 deletions(-)

but when try git-applypatch:

$git-applypatch test1 /tmp/ipoib_cm.patch test1

Space in indent is followed by a tab.
/tmp/ipoib_cm.patch:174:                test_bit(IPOIB_FLAG_ADMIN_CM,
						 &priv->flags);
Space in indent is followed by a tab.
/tmp/ipoib_cm.patch:181:                test_bit(IPOIB_FLAG_ADMIN_CM,
						 &priv->flags);
Adds trailing whitespace.
/tmp/ipoib_cm.patch:256:        return;
Space in indent is followed by a tab.
/tmp/ipoib_cm.patch:610:                        ret = 0; /* Connection is going
							    away already. */
Space in indent is followed by a tab.
/tmp/ipoib_cm.patch:1227:               neigh = tx->neigh;


why is not git-commit not warning me? I did not set --no-verify ...

-- 
MST

```

## Michael S. Tsirkin, 2007-01-12 07:49

Subject: [PATCH] fix documentation for git-commit --no-verify
Message-ID: <20070112074935.GB1049@mellanox.co.il>
URL: https://gitlist.dev/e/20070112074935.GB1049%40mellanox.co.il
In-Reply-To: <20070111221211.GM17999@mellanox.co.il>

```
Despite what the documentation claims, git-commit does not check commit
for suspicious lines: all hooks are disabled by default,
and the pre-comit hook could be changed to do something else.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>

---

> Quoting Michael S. Tsirkin <mst@mellanox.co.il>:
> Subject: git-commit/git-applypatch whitespace rules different?
> 
> git-commit/git-applypatch whitespace rules seem to be different.
> Is this expected?

OK I found out why this happens, but the documentation can be improved.

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index a7adf24..cb081cd 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -72,12 +72,8 @@ OPTIONS
 	Add Signed-off-by line at the end of the commit message.
 
 --no-verify::
-	By default, the command looks for suspicious lines the
-	commit introduces, and aborts committing if there is one.
-	The definition of 'suspicious lines' is currently the
-	lines that has trailing whitespaces, and the lines whose
-	indentation has a SP character immediately followed by a
-	TAB character.  This option turns off the check.
+	This option bypasses the pre-commit hook.
+	See also link:hooks.html[hooks].
 
 -e|--edit::
 	The message taken from file with `-F`, command line with
-- 
MST

```
