{"thread":{"id":"39452","subject":"[PATCH] bisect: stop printing raw diff of first bad commit","startedAt":"2015-05-28T16:16:13Z","lastAt":"2015-05-28T21:32:27Z","messageCount":2,"participants":["Trevor Saunders","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"262382","messageId":"1432829773-4754-1-git-send-email-tbsaunde@tbsaunde.org","threadId":"39452","inReplyTo":null,"subject":"[PATCH] bisect: stop printing raw diff of first bad commit","fromName":"Trevor Saunders","fromEmail":"tbsaunde@tbsaunde.org","sentAt":"2015-05-28T16:16:13Z","receivedAt":"2015-05-28T16:16:13Z","isPatch":true,"sender":{"key":"tbsaunde@tbsaunde.org","avatar":null},"body":"Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org>\n---\nThe test change only kind of tests the change in behavior and doesn't seem all\nthat useful.  However I'm not sure if its preferable to not even try and test\nthat something isn't output.\n\n bisect.c                    | 7 ++-----\n t/t6030-bisect-porcelain.sh | 3 ++-\n 2 files changed, 4 insertions(+), 6 deletions(-)\n\ndiff --git a/bisect.c b/bisect.c\nindex 10f5e57..244f9e5 100644\n--- a/bisect.c\n+++ b/bisect.c\n@@ -875,16 +875,13 @@ static void show_diff_tree(const char *prefix, struct commit *commit)\n \tinit_revisions(&opt, prefix);\n \tgit_config(git_diff_basic_config, NULL); /* no \"diff\" UI options */\n \topt.abbrev = 0;\n-\topt.diff = 1;\n+\topt.diff = 0;\n \n \t/* This is what \"--pretty\" does */\n \topt.verbose_header = 1;\n \topt.use_terminator = 0;\n \topt.commit_format = CMIT_FMT_DEFAULT;\n-\n-\t/* diff-tree init */\n-\tif (!opt.diffopt.output_format)\n-\t\topt.diffopt.output_format = DIFF_FORMAT_RAW;\n+\topt.always_show_header = 1;\n \n \tlog_tree_commit(&opt, commit);\n }\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 06b4868..eb820b2 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -591,7 +591,8 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '\n \t\t\t\"test \\$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0\" \\\n \t\t\t>../defaulted.log\n \t) &&\n-\tgrep \"$HASH3 is the first bad commit\" defaulted.log\n+\tgrep \"$HASH3 is the first bad commit\" defaulted.log &&\n+\ttest 0 -eq $(grep -c '^:' defaulted.log)\n '\n \n #\n-- \n2.4.0\n"},{"id":"262384","messageId":"xmqqegm0fkwk.fsf@gitster.dls.corp.google.com","threadId":"39452","inReplyTo":"1432829773-4754-1-git-send-email-tbsaunde@tbsaunde.org","subject":"Re: [PATCH] bisect: stop printing raw diff of first bad commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-28T21:32:27Z","receivedAt":"2015-05-28T21:32:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Trevor Saunders <tbsaunde@tbsaunde.org> writes:\n\n> Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde.org>\n> ---\n> The test change only kind of tests the change in behavior and doesn't seem all\n> that useful.  However I'm not sure if its preferable to not even try and test\n> that something isn't output.\n\nAs the only objective of this patch is to stop showing that raw\nformat diff output, I think it is sensible to make sure that the\noutput no longer happens.\n\nI have a feeling that this patch has some backstory?  It may be\nnecessary to summarize it in the log message to explain why this is\na good thing to do.\n\n> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\n> index 06b4868..eb820b2 100755\n> --- a/t/t6030-bisect-porcelain.sh\n> +++ b/t/t6030-bisect-porcelain.sh\n> @@ -591,7 +591,8 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '\n>  \t\t\t\"test \\$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0\" \\\n>  \t\t\t>../defaulted.log\n>  \t) &&\n> -\tgrep \"$HASH3 is the first bad commit\" defaulted.log\n> +\tgrep \"$HASH3 is the first bad commit\" defaulted.log &&\n> +\ttest 0 -eq $(grep -c '^:' defaulted.log)\n>  '\n\nYour single quotes around the pattern are not doing what you think\nthey are doing.\n\nWhy not write this line like this instead?\n\n\t! grep \"^:\" default.log\n\nThanks.\n"}]}