From: Junio C Hamano <gitster@pobox.com>
To: Victoria Dye <vdye@github.com>
Cc: Raghul Nanth A <nanth.raghul@gmail.com>,
git@vger.kernel.org, derrickstolee@github.com
Subject: Re: [GSOC][PATCH v1] diff-index: enable diff-index
Date: Wed, 05 Apr 2023 12:28:58 -0700 [thread overview]
Message-ID: <xmqqwn2quo05.fsf@gitster.g> (raw)
In-Reply-To: <91d3fd23-8120-db65-481a-e9f56017bb04@github.com> (Victoria Dye's message of "Wed, 5 Apr 2023 10:53:20 -0700")
Victoria Dye <vdye@github.com> writes:
> Raghul Nanth A wrote:
>> diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh
>> index 3242cfe91a..9e74cb22b9 100755
>> --- a/t/perf/p2000-sparse-operations.sh
>> +++ b/t/perf/p2000-sparse-operations.sh
>> @@ -125,5 +125,7 @@ test_perf_on_all git checkout-index -f --all
>> test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
>> test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
>> test_perf_on_all git grep --cached --sparse bogus -- "f2/f1/f1/*"
>> +test_perf_on_all git diff-index HEAD
>> +test_perf_on_all git diff-index HEAD~1
>
> What is the benefit of testing 'diff-index' with 'HEAD' *and* 'HEAD~1'? I
> wouldn't expect internal behavior in the command to change based on the
> revision, so the performance should be nearly identical. I'd much rather see
> 'diff-index --cached' and/or other options & pathspecs exercised.
Good point. Comparing with HEAD~1 has a chance to compare _more_
paths (i.e. paths changed in the working tree plus paths changed
between the two commits), though it feels a bit too subtle if that
is what these two tests meant.
Testing with pathspec limited comparison, limiting within the cone
of interest or extending to outside the cone, does sound like a good
idea. "diff-index --cached" to ignore working tree changes is also
an obvious thing we want to see working well.
> Seeing that 'diff-files' needed 'pathspec_needs_expanded_index', it's
> possible that this command needs similar treatment. I'm curious as to
> whether 'diff' needs it as well - the tests in 't1092' don't cover 'diff'
> with pathspecs, so it might be behaving incorrectly. If that's the case, it
> would be nice to see pathspecs handled all in one place
> ('run_diff_index()'?), if possible.
Thanks for a careful review and comment.
next prev parent reply other threads:[~2023-04-05 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 19:05 [GSOC][PATCH v1] diff-index: enable diff-index Raghul Nanth A
2023-04-04 0:16 ` Junio C Hamano
2023-04-05 17:53 ` Victoria Dye
2023-04-05 19:28 ` Junio C Hamano [this message]
2023-04-08 11:23 ` [GSOC][PATCH v2] diff-index: enable sparse index Raghul Nanth A
2023-04-13 21:14 ` Victoria Dye
2023-04-19 15:15 ` RAGHUL NANTH
2023-04-22 21:25 ` Shuqi Liang
2023-05-02 9:46 ` [GSOC] " Raghul Nanth A
2023-05-02 17:35 ` Victoria Dye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwn2quo05.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=nanth.raghul@gmail.com \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).