Re: [GSOC][PATCH v3] t3701: don't lose "git" exit codes in test scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 2, 2023 at 7:36 AM Edwin Fernando
<edwinfernando734@xxxxxxxxx> wrote:
> Exit codes are lost due to piping and command substitution:
>
> - "git ... | <command>"
> - "<command> $(git ... )"
>
> Fix these issues using the intermediate step of writing output to file.
>
> Signed-off-by: Edwin Fernando <edwinfernando734@xxxxxxxxx>
> ---
> Changes from v2:
> - use git rebase to squash commit history,
>   and diff with upstream commit for review
> - use present tense for code before the commit.

Thanks. The patch is looking a lot better. One comment, though...

> diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
> @@ -311,9 +315,11 @@ test_expect_success FILEMODE 'stage mode and hunk' '
>         printf "y\\ny\\n" | git add -p &&
> -       git diff --cached file | grep "new mode" &&
> -       git diff --cached file | grep "+content" &&
> -       test -z "$(git diff file)"
> +       git diff --cached file >diff &&
> +       grep "new mode" diff &&
> +       grep "+content" diff &&
> +       git diff file >diff &&
> +       test_must_be_empty diff
>  '

The other changes in your patch are worthwhile, but it seems that you
have based this patch on an outdated copy of the repository. This
particular change had already been made by 9fdc79ecba (tests: don't
lose misc "git" exit codes, 2023-02-06) a couple months ago[1].

So, you'll want to update your repository to the latest available from
Junio, re-roll using "master" as a base for the patch, and drop this
change while keeping the others.

[1]: https://github.com/git/git/commit/9fdc79ecba0f4a3ef885f1409d2db5a1dbabd649



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux