Re: [PATCH 04/30] directory rename detection: basic testcases
- From
Elijah Newren <newren@gmail.com>
- Date
- Nov 14, 2017, 01:40 UTC
- Message-ID
- <CABPp-BGhxK4r_jhniOTT=UsFtu4C9yYPMF3azASQTiY=fVVDrA@mail.gmail.com>
- In-Reply-To
- <CAGZ79kbK-deKq4KR-G5nq8MoCNK77hbr_B32W6Uo4i5Kq4_ojg@mail.gmail.com>
On Mon, Nov 13, 2017 at 5:21 PM, Stefan Beller <sbeller@google.com> wrote:
> On Mon, Nov 13, 2017 at 4:57 PM, Elijah Newren <newren@gmail.com> wrote:
> (slightly dreaming:) > I wonder if we could teach our test suite to accept multiple test_done > or restart_tests or such to resurrect the clean slate.
I'm dreaming now too; I would like that a lot more, although the separate test_create_repo for each case isn't too bad and should be a pretty mechanical switch.
Show 5 quoted lines
>>>> + test 3 -eq $(git ls-files -s | wc -l) && >>> >>> git ls-files >out && >>> test_line_count = 3 out && >>>
> I am not saying it was a cargo-culting reaction, but rather relaying > a well discussed style issue to you. ;)
Ah, gotcha.
Show 8 quoted lines
>> If you feel the return code of ls-files is important, perhaps I could >> just have a separate >> git ls-files -s >/dev/null && >> call before the others? > > I would prefer to not add any further calls; also (speaking generically) > this would bring in potential racing issues (what if the second ls-files > behaves differently than the first?)
Makes sense.
Show 15 quoted lines
>> I'm not following. The "old" and "new" in the filenames were just
>> there so a human reading the testcase could easily tell which
>> filenames were related and involved in renames. There is no rename
>> associated with d, so why would I have called it "old" or "new"?
>
> because a user may be impressed by gits pattern matching in the
> rename detection:
>
> A: z/{oldb,oldc}
> B: z/{newb,newc}
> C: z/{oldb, oldc, oldd}
>
> Obviously A->B is z/{old->new}-* (not a directory rename,
> but just patterns), so one might be tempted to expect newd
> as the expectation. But that is nonsense(!?)Ah, now I see where you were going. Thanks for explaining.
>> I think 2 is insanity. > > or the place where hooks/custom code shines. :)
:)