Subject: Re: [PATCH v2] bisect: Honor log.date

From: Junio C Hamano <[email-masked]>
Date: Sun, 31 Mar 2024 15:58:21 -0700

Peter Krefting <[email-masked]> writes:

> There are a lot of parameters to show that I have haven't used in my
> 14+ years of using Git, --summary is one of them. That's why I didn't
> add it.

Yup, that is semi-understandable, but especially given that it is
one of the options used by the original "diff-tree"'s invocation,
and that we are trying to replace it with "show" from the same
family of commands, it is a bit of disappointment.

We know we used to drive "diff-tree" with a known set of options,
and we are replacing the command to use "show" with some other set
of options.  I expected it to be fairly straight-forward and natural
to feed randomly picked commits to the two commands and compare
their output while deciding what that "some other set of options"
should be.  It is exactly the reason why I mentioned v1.0.0^0 is a
good test case.

Again, the output from them do not have to be identical---we are
primarily after catching unintended loss of informatino in such a
comparison, while gaining more confidence that it is a better
approach to use "show" output to produce output for end-user
consumption.

We have changed the bisect output before, as recent as in 2019 with
b02be8b9 (bisect: make diff-tree output prettier, 2019-02-22), and
heard nobody complain, so once we get to a reasonable set of options
and land this patch, maybe we can try improving on it safely.

FYI, attached is a comparison between the diff-tree output and
output from show with my choice of options for "show" picked from
the top of my head.  I do not think I personally like the --stat
output applied to a merge (--stat and --summary do not work N-way
like --cc does for patch text), but I think these options are the
closest parallel to what we have been giving to "diff-tree".

Thanks.

---------------------- >8 ----------------------
$ git diff-tree --pretty --stat --summary --cc v1.0.0^0
commit c2f3bf071ee90b01f2d629921bb04c4f798f02fa
Merge: 1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0 41f93a2c903a45167b26c2dc93d45ffa9a9bbd49
Author: Junio C Hamano <[email-masked]>
Date:   Wed Dec 21 00:01:00 2005 -0800

    GIT 1.0.0
    
    Signed-off-by: Junio C Hamano <[email-masked]>

 .gitignore                                       |   1 -
 Documentation/diff-options.txt                   |   8 +
 ...
 tar-tree.c                                       |   4 +-
 unpack-objects.c                                 |  13 +-
 66 files changed, 778 insertions(+), 617 deletions(-)
 delete mode 100644 Documentation/git-octopus.txt
 ...
 mode change 100644 => 100755 t/t5500-fetch-pack.sh
 mode change 100644 => 100755 t/t6101-rev-parse-parents.sh

---------------------- >8 ----------------------
$ git show -s --stat --summary --first-parent v1.0.0^0
commit c2f3bf071ee90b01f2d629921bb04c4f798f02fa
Merge: 1ed91937e5 41f93a2c90
Author: Junio C Hamano <[email-masked]>
Date:   Wed Dec 21 00:01:00 2005 -0800

    GIT 1.0.0
    
    Signed-off-by: Junio C Hamano <[email-masked]>

 .gitignore                                       |   1 -
 Documentation/diff-options.txt                   |   8 +
 ...
 tar-tree.c                                       |   4 +-
 unpack-objects.c                                 |  13 +-
 66 files changed, 778 insertions(+), 617 deletions(-)
 delete mode 100644 Documentation/git-octopus.txt
 ...
 mode change 100644 => 100755 t/t5500-fetch-pack.sh
 mode change 100644 => 100755 t/t6101-rev-parse-parents.sh