{"thread":{"id":"6343","subject":"git-commit/git-applypatch whitespace rules different?","startedAt":"2007-01-11T22:12:11Z","lastAt":"2007-01-12T07:49:35Z","messageCount":2,"participants":["Michael S. Tsirkin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"31506","messageId":"20070111221211.GM17999@mellanox.co.il","threadId":"6343","inReplyTo":null,"subject":"git-commit/git-applypatch whitespace rules different?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-11T22:12:11Z","receivedAt":"2007-01-11T22:12:11Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"git-commit/git-applypatch whitespace rules seem to be different.\nIs this expected?\n\nExample:\nI take a patch, apply it and commit without warnings about whitespace:\n\n$patch -p1 -i /tmp/ipoib_cm.patc\n$git commit drivers/infiniband/ulp/ipoib/\nCreated commit f83bc11fd3cadb0b3f27d31fbaaa1a5d409e65d9\n 8 files changed, 339 insertions(+), 31 deletions(-)\n\nbut when try git-applypatch:\n\n$git-applypatch test1 /tmp/ipoib_cm.patch test1\n\nSpace in indent is followed by a tab.\n/tmp/ipoib_cm.patch:174:                test_bit(IPOIB_FLAG_ADMIN_CM,\n\t\t\t\t\t\t &priv->flags);\nSpace in indent is followed by a tab.\n/tmp/ipoib_cm.patch:181:                test_bit(IPOIB_FLAG_ADMIN_CM,\n\t\t\t\t\t\t &priv->flags);\nAdds trailing whitespace.\n/tmp/ipoib_cm.patch:256:        return;\nSpace in indent is followed by a tab.\n/tmp/ipoib_cm.patch:610:                        ret = 0; /* Connection is going\n\t\t\t\t\t\t\t    away already. */\nSpace in indent is followed by a tab.\n/tmp/ipoib_cm.patch:1227:               neigh = tx->neigh;\n\n\nwhy is not git-commit not warning me? I did not set --no-verify ...\n\n-- \nMST\n"},{"id":"31547","messageId":"20070112074935.GB1049@mellanox.co.il","threadId":"6343","inReplyTo":"20070111221211.GM17999@mellanox.co.il","subject":"[PATCH] fix documentation for git-commit --no-verify","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-12T07:49:35Z","receivedAt":"2007-01-12T07:49:35Z","isPatch":true,"sender":{"key":"mst@kernel.org","avatar":null},"body":"Despite what the documentation claims, git-commit does not check commit\nfor suspicious lines: all hooks are disabled by default,\nand the pre-comit hook could be changed to do something else.\n\nSigned-off-by: Michael S. Tsirkin <mst@mellanox.co.il>\n\n---\n\n> Quoting Michael S. Tsirkin <mst@mellanox.co.il>:\n> Subject: git-commit/git-applypatch whitespace rules different?\n> \n> git-commit/git-applypatch whitespace rules seem to be different.\n> Is this expected?\n\nOK I found out why this happens, but the documentation can be improved.\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex a7adf24..cb081cd 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -72,12 +72,8 @@ OPTIONS\n \tAdd Signed-off-by line at the end of the commit message.\n \n --no-verify::\n-\tBy default, the command looks for suspicious lines the\n-\tcommit introduces, and aborts committing if there is one.\n-\tThe definition of 'suspicious lines' is currently the\n-\tlines that has trailing whitespaces, and the lines whose\n-\tindentation has a SP character immediately followed by a\n-\tTAB character.  This option turns off the check.\n+\tThis option bypasses the pre-commit hook.\n+\tSee also link:hooks.html[hooks].\n \n -e|--edit::\n \tThe message taken from file with `-F`, command line with\n-- \nMST\n"}]}