Re: [PATCH v2 1/2] t0001: avoid pipes with Git on LHS
- From
Shubham Mishra <shivam828787@gmail.com>
- Date
- Feb 24, 2022, 05:14 UTC
- Message-ID
- <CAC316V7QDgZL0jOzgE-Ae86Phmf4XpeQdbKfNS3uA8uL_0uzKw@mail.gmail.com>
- In-Reply-To
- <xmqqo82xthjy.fsf@gitster.g>
HI Junio, I acknowledge, this patch is here by mistake, we don't need to merge it.
Thanks, Shubham
On Thu, Feb 24, 2022 at 2:40 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
> > Shubham Mishra <shivam828787@gmail.com> writes: > > > Pipes ignore error codes of LHS command and thu`s we should not use > > them with Git in tests. As an alternative, use a 'tmp' file to write > > the Git output so we can test the exit code. > > I do not know what thu`s is, but the above describes a sensible > criterion to decide which pipe to touch and which pipe to leave > alone. > > > - find .git/worktrees -print | sort >expected && > > + find .git/worktrees -print >tmp && > > + sort tmp >expected && > > And this change or ... > > > git -C ../linked-worktree init && > > test_cmp expected-exclude .git/info/exclude && > > test_cmp expected-config .git/config && > > - find .git/worktrees -print | sort >actual && > > + find .git/worktrees -print >tmp && > > + sort tmp >actual && > > ... this change squarely contradict the reasoning written in the > proposed log message. These pipelines place "find" on the upstream > of their pipe, and "find" is not something we are worried about > introducing new bug into. > > > test_cmp expected actual > > ) > > '