* [PATCH] bisect: stop printing raw diff of first bad commit
@ 2015-05-28 16:16 Trevor Saunders
2015-05-28 21:32 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Trevor Saunders @ 2015-05-28 16:16 UTC (permalink / raw)
To: git; +Cc: Trevor Saunders
Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde•org>
---
The test change only kind of tests the change in behavior and doesn't seem all
that useful. However I'm not sure if its preferable to not even try and test
that something isn't output.
bisect.c | 7 ++-----
t/t6030-bisect-porcelain.sh | 3 ++-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/bisect.c b/bisect.c
index 10f5e57..244f9e5 100644
--- a/bisect.c
+++ b/bisect.c
@@ -875,16 +875,13 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
init_revisions(&opt, prefix);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
opt.abbrev = 0;
- opt.diff = 1;
+ opt.diff = 0;
/* This is what "--pretty" does */
opt.verbose_header = 1;
opt.use_terminator = 0;
opt.commit_format = CMIT_FMT_DEFAULT;
-
- /* diff-tree init */
- if (!opt.diffopt.output_format)
- opt.diffopt.output_format = DIFF_FORMAT_RAW;
+ opt.always_show_header = 1;
log_tree_commit(&opt, commit);
}
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 06b4868..eb820b2 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -591,7 +591,8 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
>../defaulted.log
) &&
- grep "$HASH3 is the first bad commit" defaulted.log
+ grep "$HASH3 is the first bad commit" defaulted.log &&
+ test 0 -eq $(grep -c '^:' defaulted.log)
'
#
--
2.4.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bisect: stop printing raw diff of first bad commit
2015-05-28 16:16 [PATCH] bisect: stop printing raw diff of first bad commit Trevor Saunders
@ 2015-05-28 21:32 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2015-05-28 21:32 UTC (permalink / raw)
To: Trevor Saunders; +Cc: git
Trevor Saunders <tbsaunde@tbsaunde•org> writes:
> Signed-off-by: Trevor Saunders <tbsaunde@tbsaunde•org>
> ---
> The test change only kind of tests the change in behavior and doesn't seem all
> that useful. However I'm not sure if its preferable to not even try and test
> that something isn't output.
As the only objective of this patch is to stop showing that raw
format diff output, I think it is sensible to make sure that the
output no longer happens.
I have a feeling that this patch has some backstory? It may be
necessary to summarize it in the log message to explain why this is
a good thing to do.
> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index 06b4868..eb820b2 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -591,7 +591,8 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
> "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
> >../defaulted.log
> ) &&
> - grep "$HASH3 is the first bad commit" defaulted.log
> + grep "$HASH3 is the first bad commit" defaulted.log &&
> + test 0 -eq $(grep -c '^:' defaulted.log)
> '
Your single quotes around the pattern are not doing what you think
they are doing.
Why not write this line like this instead?
! grep "^:" default.log
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-28 21:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28 16:16 [PATCH] bisect: stop printing raw diff of first bad commit Trevor Saunders
2015-05-28 21:32 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox