{"thread":{"id":"17186","subject":"[PATCH/RFC v1 1/1] +5 cases (4 fail), diff whitespace tests","startedAt":"2009-01-15T00:48:24Z","lastAt":"2009-01-18T19:25:54Z","messageCount":4,"participants":["Keith Cascio","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"100527","messageId":"alpine.GSO.2.00.0901141633030.9831@kiwi.cs.ucla.edu","threadId":"17186","inReplyTo":null,"subject":"[PATCH/RFC v1 1/1] +5 cases (4 fail), diff whitespace tests","fromName":"Keith Cascio","fromEmail":"keith@cs.ucla.edu","sentAt":"2009-01-15T00:48:24Z","receivedAt":"2009-01-15T00:48:24Z","isPatch":true,"sender":{"key":"keith@cs.ucla.edu","avatar":"https://gravatar.com/avatar/c5ec3a8f1cd1f449fdf8bdb7125fdbfd10b729507f32cbf0aa4ad07b4f7127ae?d=mp&s=160"},"body":"  +5 cases (4 fail), diff whitespace tests\n  There are 2^3 = eight possible combinations of the three flags:\n  -w -b --ignore-space-at-eol\n  Three of those combinations were already being tested:\n  [none]\n  -w\n  -b\n  Add tests of the other five combinations,\n  four of which fail with git\n  3cf3b838c7b379824c68ee87799aaaa9028b36cd\n  from Tue Jan 13 23:41:32 2009 -0800.\n\nSigned-off-by: Keith Cascio <keith@cs.ucla.edu>\n---\n\nAll four failures involve combining whitespace ignore options.  It's likely the \nfix will involve one or both of the following two functions in xdiff/xutils.c:\nxdl_hash_record_with_whitespace()\nxdl_recmatch()\n\nI played around with it and discovered I could make\n\"git diff -b --ignore-space-at-eol\" work by changing\nif (flags & XDF_IGNORE_WHITESPACE_AT_EOL\nto\nelse if (flags & XDF_IGNORE_WHITESPACE_AT_EOL\nBut I don't know if that would break something else.\n\n                                          -- Keith\n\n  t/t4015-diff-whitespace.sh |   27 +++++++++++++++++++++++++++\n  1 files changed, 27 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex fc2307e..dbb608c 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -98,6 +98,12 @@ index d99af23..8b32fb5 100644\n  EOF\n  git diff -w > out\n  test_expect_success 'another test, with -w' 'test_cmp expect out'\n+git diff -w -b > out\n+test_expect_failure 'another test, with -w -b' 'test_cmp expect out'\n+git diff -w --ignore-space-at-eol > out\n+test_expect_failure 'another test, with -w --ignore-space-at-eol' 'test_cmp expect out'\n+git diff -w -b --ignore-space-at-eol > out\n+test_expect_failure 'another test, with -w -b --ignore-space-at-eol' 'test_cmp expect out'\n\n  tr 'Q' '\\015' << EOF > expect\n  diff --git a/x b/x\n@@ -116,6 +122,27 @@ index d99af23..8b32fb5 100644\n  EOF\n  git diff -b > out\n  test_expect_success 'another test, with -b' 'test_cmp expect out'\n+git diff -b --ignore-space-at-eol > out\n+test_expect_failure 'another test, with -b --ignore-space-at-eol' 'test_cmp expect out'\n+\n+tr 'Q' '\\015' << EOF > expect\n+diff --git a/x b/x\n+index d99af23..8b32fb5 100644\n+--- a/x\n++++ b/x\n+@@ -1,6 +1,6 @@\n+-whitespace at beginning\n+-whitespace change\n+-whitespace in the middle\n++\twhitespace at beginning\n++whitespace \t change\n++white space in the middle\n+ whitespace at end\n+ unchanged line\n+ CR at endQ\n+EOF\n+git diff --ignore-space-at-eol > out\n+test_expect_success 'another test, with --ignore-space-at-eol' 'test_cmp expect out'\n\n  test_expect_success 'check mixed spaces and tabs in indent' '\n\n-- \n1.6.1.137.gb17b6\n"},{"id":"100923","messageId":"7vhc3xys4p.fsf@gitster.siamese.dyndns.org","threadId":"17186","inReplyTo":"alpine.GSO.2.00.0901141633030.9831@kiwi.cs.ucla.edu","subject":"Re: [PATCH/RFC v1 1/1] +5 cases (4 fail), diff whitespace tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-18T07:45:26Z","receivedAt":"2009-01-18T07:45:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, applied.\n"},{"id":"100924","messageId":"7vd4elys21.fsf@gitster.siamese.dyndns.org","threadId":"17186","inReplyTo":"alpine.GSO.2.00.0901141633030.9831@kiwi.cs.ucla.edu","subject":"Re: [PATCH/RFC v1 1/1] +5 cases (4 fail), diff whitespace tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-18T07:47:02Z","receivedAt":"2009-01-18T07:47:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Keith Cascio <keith@CS.UCLA.EDU> writes:\n\n>  +5 cases (4 fail), diff whitespace tests\n>  There are 2^3 = eight possible combinations of the three flags:\n>  -w -b --ignore-space-at-eol\n>  Three of those combinations were already being tested:\n>  [none]\n>  -w\n>  -b\n>  Add tests of the other five combinations,\n\nHmm.  Are these three supposed to be orthogonal?\n"},{"id":"101042","messageId":"alpine.GSO.2.00.0901181106150.5969@kiwi.cs.ucla.edu","threadId":"17186","inReplyTo":"7vd4elys21.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH/RFC v1 1/1] +5 cases (4 fail), diff whitespace tests","fromName":"Keith Cascio","fromEmail":"keith@cs.ucla.edu","sentAt":"2009-01-18T19:25:54Z","receivedAt":"2009-01-18T19:25:54Z","isPatch":true,"sender":{"key":"keith@cs.ucla.edu","avatar":"https://gravatar.com/avatar/c5ec3a8f1cd1f449fdf8bdb7125fdbfd10b729507f32cbf0aa4ad07b4f7127ae?d=mp&s=160"},"body":"On Sat, 17 Jan 2009, Junio C Hamano wrote:\n\n> Hmm.  Are these three supposed to be orthogonal?\n\nThe semantics of those 3 flags are not orthogonal, no.  Their relationship \namongst each other is one of transitive implication:\n\n-w                    implies the other two\n-b                    implies --ignore-space-at-eol\n--ignore-space-at-eol implies only itself\n\nTherefore, it is never *necessary* to specify more than one of these flags on \nthe command line.  However, it is not hard to imagine scenarios where software \nwrappers around git (e.g. GUIs, etc), generate command lines with more than one \nof these flags.  I thought about it, and it seems unreasonable to make it an \nerror to specify more than one, since a new user might not immediately grasp the \nway they imply each other.  I think Git could and should treat it as a legal \ncase.  I contacted Dscho about fixing it, but he is busy so I will submit a fix \npatch myself.\n"}]}