{"thread":{"id":"31711","subject":"t4055 failure: see error","startedAt":"2012-10-02T12:18:22Z","lastAt":"2012-10-07T22:37:11Z","messageCount":7,"participants":["Brian Charles Gernhardt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200318","messageId":"7667682A-3BDB-484F-A3E4-0E5826FD2076@cs.rochester.edu","threadId":"31711","inReplyTo":null,"subject":"t4055 failure: see error","fromName":"Brian Charles Gernhardt","fromEmail":"gernhard@cs.rochester.edu","sentAt":"2012-10-02T12:18:22Z","receivedAt":"2012-10-02T12:18:22Z","isPatch":false,"sender":{"key":"gernhard@cs.rochester.edu","avatar":null},"body":"Another problem caused by BSD v GNU sed, I think.\n\n$ ./t4055-diff-context.sh -i -v\nInitialized empty Git repository in /Users/brian/dev/git/t/trash directory.t4055-diff-context/.git/\nexpecting success: \n\tcat >x <<-\\EOF &&\n\tfirstline\n\tb\n\tc\n\td\n\te\n\tf\n\tpreline\n\tpostline\n\ti\n\tj\n\tk\n\tl\n\tm\n\tn\n\tEOF\n\tgit update-index --add x &&\n\tgit commit -m initial &&\n\n\tgit cat-file blob HEAD:x |\n\tsed \"/preline/a\\\n\tADDED\" >x &&\n\tgit update-index --add x &&\n\tgit commit -m next &&\n\n\tgit cat-file blob HEAD:x |\n\tsed s/ADDED/MODIFIED/ >x\n\n[master (root-commit) d5fa2e5] initial\n Author: A U Thor <author@example.com>\n 1 file changed, 14 insertions(+)\n create mode 100644 x\nsed: 1: \"/preline/a\tADDED\": command a expects \\ followed by text\n"},{"id":"200354","messageId":"7v7gr890hd.fsf@alter.siamese.dyndns.org","threadId":"31711","inReplyTo":"7667682A-3BDB-484F-A3E4-0E5826FD2076@cs.rochester.edu","subject":"Re: t4055 failure: see error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-02T18:45:34Z","receivedAt":"2012-10-02T18:45:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:\n\n> Another problem caused by BSD v GNU sed, I think.\n\nOh, that again X-<.\n\nWill patch up in a stupid-but-trivial way, unless somebody knows a\nreliable workaround.\n\nThanks.\n"},{"id":"200355","messageId":"7v391w905c.fsf@alter.siamese.dyndns.org","threadId":"31711","inReplyTo":"7v7gr890hd.fsf@alter.siamese.dyndns.org","subject":"Re: t4055 failure: see error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-02T18:52:47Z","receivedAt":"2012-10-02T18:52:47Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:\n>\n>> Another problem caused by BSD v GNU sed, I think.\n>\n> Oh, that again X-<.\n>\n> Will patch up in a stupid-but-trivial way, unless somebody knows a\n> reliable workaround.\n\nI no longer have a BSD handy to test, so I'd appreciate it if\nsomebody can do a quick sanity check.\n\nThanks.\n\n-- >8 --\nSubject: [PATCH] t4055: avoid BSD/GNU sed incompatibilty issues\n\nThe 'a', 'i' and 'c' commands that take literal lines to be added\nfollowed by backslash does not seem to work reliably on some BSD\nsystems.  Avoid it by having an extra line in a template file and\ngenerate test vectors by deleting the line or replacing the line.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t4055-diff-context.sh | 11 +++++------\n 1 file changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh\nindex 3527686..97172b4 100755\n--- a/t/t4055-diff-context.sh\n+++ b/t/t4055-diff-context.sh\n@@ -8,7 +8,7 @@ test_description='diff.context configuration'\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n-\tcat >x <<-\\EOF &&\n+\tcat >template <<-\\EOF &&\n \tfirstline\n \tb\n \tc\n@@ -16,6 +16,7 @@ test_expect_success 'setup' '\n \te\n \tf\n \tpreline\n+\tTARGET\n \tpostline\n \ti\n \tj\n@@ -24,17 +25,15 @@ test_expect_success 'setup' '\n \tm\n \tn\n \tEOF\n+\tsed \"/TARGET/d\" >x <template &&\n \tgit update-index --add x &&\n \tgit commit -m initial &&\n \n-\tgit cat-file blob HEAD:x |\n-\tsed \"/preline/a\\\n-\tADDED\" >x &&\n+\tsed \"s/TARGET/ADDED/\" >x <template &&\n \tgit update-index --add x &&\n \tgit commit -m next &&\n \n-\tgit cat-file blob HEAD:x |\n-\tsed s/ADDED/MODIFIED/ >x\n+\tsed \"s/TARGET/MODIFIED/\" >x <template\n '\n \n test_expect_success 'the default number of context lines is 3' '\n-- \n1.8.0.rc0.45.g7ce8dc5\n"},{"id":"200357","messageId":"7vy5jo7l7r.fsf@alter.siamese.dyndns.org","threadId":"31711","inReplyTo":"7667682A-3BDB-484F-A3E4-0E5826FD2076@cs.rochester.edu","subject":"Re: t4055 failure: see error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-02T19:00:40Z","receivedAt":"2012-10-02T19:00:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:\n\n> Another problem caused by BSD v GNU sed, I think.\n>\n> \tgit cat-file blob HEAD:x |\n> \tsed \"/preline/a\\\n> \tADDED\" >x &&\n\nActually, I think what is happening is that inside \"\", the backslash\nat the end of line is eaten by the shell together with that end of\nline, so it is not BSD vs GNU, but it simply is that my quoting was\nwrong.\n\nThis (disregarding the previous \"TARGET\" patch) may be a smaller fix.\n\n t/t4055-diff-context.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git c/t/t4055-diff-context.sh w/t/t4055-diff-context.sh\nindex 3527686..0f2dd40 100755\n--- c/t/t4055-diff-context.sh\n+++ w/t/t4055-diff-context.sh\n@@ -28,7 +28,7 @@ test_expect_success 'setup' '\n \tgit commit -m initial &&\n \n \tgit cat-file blob HEAD:x |\n-\tsed \"/preline/a\\\n+\tsed \"/preline/a\\\\\n \tADDED\" >x &&\n \tgit update-index --add x &&\n \tgit commit -m next &&\n"},{"id":"200359","messageId":"7vpq507ksy.fsf@alter.siamese.dyndns.org","threadId":"31711","inReplyTo":"7vy5jo7l7r.fsf@alter.siamese.dyndns.org","subject":"Re: t4055 failure: see error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-02T19:09:33Z","receivedAt":"2012-10-02T19:09:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:\n>\n>> Another problem caused by BSD v GNU sed, I think.\n>>\n>> \tgit cat-file blob HEAD:x |\n>> \tsed \"/preline/a\\\n>> \tADDED\" >x &&\n>\n> Actually, I think what is happening is that inside \"\", the backslash\n> at the end of line is eaten by the shell together with that end of\n> line, so it is not BSD vs GNU, but it simply is that my quoting was\n> wrong.\n>\n> This (disregarding the previous \"TARGET\" patch) may be a smaller fix.\n\nI'll find a brown paper bag big enough to hide in.  Please disregard\nit.\n\n-- >8 --\nSubject: [PATCH] t4055: avoid use of sed 'a' command\n\nThe 'a', 'i' and 'c' commands take a literal text to be added\nfollowed by backslash, but then in the source we cannot indent\nthe literal text which makes it ugly.\n\nWe need to also remember to double the backslash inside double\nquotes.\n\nAvoid these issues altogether by having an extra line in a template\nfile and generate test vectors by deleting the line or replacing the\nline and not using the 'a' command.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t4055-diff-context.sh | 11 +++++------\n 1 file changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh\nindex 3527686..97172b4 100755\n--- a/t/t4055-diff-context.sh\n+++ b/t/t4055-diff-context.sh\n@@ -8,7 +8,7 @@ test_description='diff.context configuration'\n . ./test-lib.sh\n \n test_expect_success 'setup' '\n-\tcat >x <<-\\EOF &&\n+\tcat >template <<-\\EOF &&\n \tfirstline\n \tb\n \tc\n@@ -16,6 +16,7 @@ test_expect_success 'setup' '\n \te\n \tf\n \tpreline\n+\tTARGET\n \tpostline\n \ti\n \tj\n@@ -24,17 +25,15 @@ test_expect_success 'setup' '\n \tm\n \tn\n \tEOF\n+\tsed \"/TARGET/d\" >x <template &&\n \tgit update-index --add x &&\n \tgit commit -m initial &&\n \n-\tgit cat-file blob HEAD:x |\n-\tsed \"/preline/a\\\n-\tADDED\" >x &&\n+\tsed \"s/TARGET/ADDED/\" >x <template &&\n \tgit update-index --add x &&\n \tgit commit -m next &&\n \n-\tgit cat-file blob HEAD:x |\n-\tsed s/ADDED/MODIFIED/ >x\n+\tsed \"s/TARGET/MODIFIED/\" >x <template\n '\n \n test_expect_success 'the default number of context lines is 3' '\n-- \n1.8.0.rc0.45.g7ce8dc5\n"},{"id":"200700","messageId":"3C091712-6339-4B77-82D0-2A4C1CE447CD@cs.rochester.edu","threadId":"31711","inReplyTo":"7vpq507ksy.fsf@alter.siamese.dyndns.org","subject":"Re: t4055 failure: see error","fromName":"Brian Charles Gernhardt","fromEmail":"gernhard@cs.rochester.edu","sentAt":"2012-10-07T15:43:54Z","receivedAt":"2012-10-07T15:43:54Z","isPatch":false,"sender":{"key":"gernhard@cs.rochester.edu","avatar":null},"body":"\nOn Oct 2, 2012, at 3:09 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> I'll find a brown paper bag big enough to hide in.  Please disregard\n> it.\n> \n> -- >8 --\n> Subject: [PATCH] t4055: avoid use of sed 'a' command\n\nSorry about being slow to respond.  The patch does work for me.  I see it's already been committed, but thought the confirmation would be nice.\n\n~~ Brian Gernhardt\n"},{"id":"200725","messageId":"7v1uh9q57s.fsf@alter.siamese.dyndns.org","threadId":"31711","inReplyTo":"3C091712-6339-4B77-82D0-2A4C1CE447CD@cs.rochester.edu","subject":"Re: t4055 failure: see error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-07T22:37:11Z","receivedAt":"2012-10-07T22:37:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Charles Gernhardt <gernhard@cs.rochester.edu> writes:\n\n> On Oct 2, 2012, at 3:09 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> I'll find a brown paper bag big enough to hide in.  Please disregard\n>> it.\n>> \n>> -- >8 --\n>> Subject: [PATCH] t4055: avoid use of sed 'a' command\n>\n> Sorry about being slow to respond.  The patch does work for me.  I\n> see it's already been committed, but thought the confirmation\n> would be nice.\n\nThanks.\n"}]}