From: "Keller, Jacob E" <jacob.e.keller@intel.com>
To: Derrick Stolee <derrickstolee@github.com>,
Junio C Hamano <gitster@pobox.com>,
Jacob Keller <jacob.keller@gmail.com>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH] name-rev: use generation numbers if available
Date: Tue, 1 Mar 2022 19:52:04 +0000 [thread overview]
Message-ID: <f5ca62f4-eb3d-eeb7-e7c8-7fb800f3d6cd@intel.com> (raw)
In-Reply-To: <6b00c67b-01c9-bf22-a8e6-904f47fa7acf@github.com>
On 3/1/2022 7:09 AM, Derrick Stolee wrote:
> On 3/1/2022 2:33 AM, Junio C Hamano wrote:
>> Jacob Keller <jacob.keller@gmail.com> writes:
>>
>>> On Mon, Feb 28, 2022 at 6:36 PM Junio C Hamano <gitster@pobox.com> wrote:
>>>>
>>>> Jacob Keller <jacob.e.keller@intel.com> writes:
>>>>
>>>>> +test_expect_success 'name-rev without commitGraph does not handle non-monotonic timestamps' '
>>>>> + test_config -C non-monotonic core.commitGraph false &&
>>>>> + (
>>>>> + cd non-monotonic &&
>>>>> +
>>>>> + rm -rf .git/info/commit-graph* &&
>>>>> +
>>>>> + echo "main~3 undefined" >expect &&
>>>>> + git name-rev --tags main~3 >actual &&
>>>>> +
>>>>> + test_cmp expect actual
>>>>> + )
>>>>> +'
>>>>
>>>> I doubt it is wise to "test" that a program does _not_ produce a
>>>> correct output, or even worse, it produces a particular wrong
>>>> output. This test, for example, casts in stone that any future
>>>> optimization that does not depend on the commit-graph is forever
>>>> prohibited.
>>>>
>>>> Just dropping the test would be fine, I would think.
>>>
>>> Stolee mentioned it. We could also convert it to a
>>> "test_expect_failure" with the expected output too... But that makes
>>> it look like something we'll fix
>>
>> Neither sounds like a good idea anyway. What we care most is with
>> commit graph, the algorithm will not be fooled by skewed timestamps.
>
> I'm fine with losing this test.
>
> I perhaps lean too hard on "tests should document current behavior"
> so we know when we are changing behavior, and the commit can justify
> that change. For this one, we are really documenting that we have
> an optimization that doesn't walk all commits based on the date of
> the target commit. If we dropped that optimization accidentally,
> then we have no test so far that verifies that we don't walk the
> entire commit history with these name-rev queries.
>
I think the "tests should document current behavior" is handled by the
fact that this specific test fails if you revert the name-rev changes
but keep the test.
> If there is value in documenting that optimization, then a
> comment before the test could describe that the output is not
> desirable, but it's due to an optimization that we want to keep in
> place.
>
> Thanks,
> -Stolee
What about a test which uses something like the trace system to list all
the commits it checked? I guess that might get a bit messy but that
could be used to cover the "this optimization is important" and that
applies to the commit graph implementation rather than keeping a
negative test of the other implementation.
Thanks,
Jake
next prev parent reply other threads:[~2022-03-01 19:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-28 21:50 [PATCH v2 0/1] name-rev: use generation numbers if available Jacob Keller
2022-02-28 21:50 ` [PATCH v2 1/1] " Jacob Keller
2022-02-28 21:50 ` [PATCH] " Jacob Keller
2022-03-01 2:36 ` Junio C Hamano
2022-03-01 7:08 ` Jacob Keller
2022-03-01 7:09 ` Jacob Keller
2022-03-01 7:33 ` Junio C Hamano
2022-03-01 15:09 ` Derrick Stolee
2022-03-01 19:52 ` Keller, Jacob E [this message]
2022-03-01 19:56 ` Derrick Stolee
2022-03-01 20:22 ` Junio C Hamano
2022-03-01 22:46 ` Keller, Jacob E
2022-03-03 1:10 ` Junio C Hamano
2022-03-07 20:22 ` Jacob Keller
2022-03-07 20:26 ` Derrick Stolee
2022-03-07 22:30 ` Keller, Jacob E
2022-03-07 22:43 ` Derrick Stolee
2022-03-07 22:52 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2022-02-28 19:07 Jacob Keller
2022-02-28 19:50 ` Derrick Stolee
2022-02-28 20:20 ` Keller, Jacob E
2022-02-28 20:24 ` Derrick Stolee
2022-02-28 20:59 ` Keller, Jacob E
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=f5ca62f4-eb3d-eeb7-e7c8-7fb800f3d6cd@intel.com \
--to=jacob.e.keller@intel.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.keller@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.