From: Patrick Steinhardt <ps@pks.im>
To: Jiang Xin <worldhello.net@gmail.com>
Cc: Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Jiang Xin <zhiyou.jx@alibaba-inc.com>
Subject: Re: [PATCH v2 1/2] t5574: test porcelain output of atomic fetch
Date: Fri, 15 Dec 2023 10:56:40 +0100 [thread overview]
Message-ID: <ZXwi2MA-KUxszfGj@tanuki> (raw)
In-Reply-To: <210191917bcfa9293622908c291652059576f3e5.1702556642.git.zhiyou.jx@alibaba-inc.com>
[-- Attachment #1: Type: text/plain, Size: 2011 bytes --]
On Thu, Dec 14, 2023 at 08:33:11PM +0800, Jiang Xin wrote:
> From: Jiang Xin <zhiyou.jx@alibaba-inc.com>
[snip]
> @@ -91,36 +85,61 @@ test_expect_success 'fetch porcelain output' '
> git checkout force-updated &&
> git reset --hard HEAD~ &&
> test_commit --no-tag force-update-new &&
> - FORCE_UPDATED_NEW=$(git rev-parse HEAD) &&
> -
> - cat >expect <<-EOF &&
> - - $MAIN_OLD $ZERO_OID refs/forced/deleted-branch
> - - $MAIN_OLD $ZERO_OID refs/unforced/deleted-branch
> - $MAIN_OLD $FAST_FORWARD_NEW refs/unforced/fast-forward
> - ! $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/unforced/force-updated
> - * $ZERO_OID $MAIN_OLD refs/unforced/new-branch
> - $MAIN_OLD $FAST_FORWARD_NEW refs/forced/fast-forward
> - + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/forced/force-updated
> - * $ZERO_OID $MAIN_OLD refs/forced/new-branch
> - $MAIN_OLD $FAST_FORWARD_NEW refs/remotes/origin/fast-forward
> - + $FORCE_UPDATED_OLD $FORCE_UPDATED_NEW refs/remotes/origin/force-updated
> - * $ZERO_OID $MAIN_OLD refs/remotes/origin/new-branch
> - EOF
> -
> - # Execute a dry-run fetch first. We do this to assert that the dry-run
> - # and non-dry-run fetches produces the same output. Execution of the
> - # fetch is expected to fail as we have a rejected reference update.
> - test_must_fail git -C porcelain fetch \
> - --porcelain --dry-run --prune origin $refspecs >actual &&
> - test_cmp expect actual &&
> -
> - # And now we perform a non-dry-run fetch.
> - test_must_fail git -C porcelain fetch \
> - --porcelain --prune origin $refspecs >actual 2>stderr &&
> - test_cmp expect actual &&
> - test_must_be_empty stderr
> + FORCE_UPDATED_NEW=$(git rev-parse HEAD)
> '
>
> +for opt in off on
> +do
> + case $opt in
> + on)
> + opt=--atomic
> + ;;
> + off)
> + opt=
> + ;;
> + esac
Nit: you could also do `for opt in "--atomic" ""` directly to get rid of
this case statement. Not sure whether this is worth a reroll though,
probably not.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-12-15 9:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 14:34 [PATCH 1/2] t5574: test porcelain output of atomic fetch Jiang Xin
2023-10-19 14:34 ` [PATCH 2/2] fetch: no redundant error message for " Jiang Xin
2023-10-23 8:27 ` Patrick Steinhardt
2023-10-23 9:16 ` Jiang Xin
2023-10-23 10:07 ` Patrick Steinhardt
2023-10-23 23:20 ` Jiang Xin
2023-10-25 8:21 ` Patrick Steinhardt
2023-10-24 18:16 ` Junio C Hamano
2023-12-14 12:33 ` [PATCH v2 0/2] jx/fetch-atomic-error-message-fix Jiang Xin
2023-12-14 12:33 ` [PATCH v2 1/2] t5574: test porcelain output of atomic fetch Jiang Xin
2023-12-15 9:56 ` Patrick Steinhardt [this message]
2023-12-15 11:16 ` Jiang Xin
2023-12-15 16:47 ` Junio C Hamano
2023-12-14 12:33 ` [PATCH v2 2/2] fetch: no redundant error message for " Jiang Xin
2023-12-15 9:56 ` Patrick Steinhardt
2023-12-17 14:11 ` [PATCH v3 0/2] fix fetch atomic error message Jiang Xin
2023-12-17 14:11 ` [PATCH v3 1/2] t5574: test porcelain output of atomic fetch Jiang Xin
2023-12-17 14:11 ` [PATCH v3 2/2] fetch: no redundant error message for " Jiang Xin
2023-12-18 8:14 ` [PATCH v3 0/2] fix fetch atomic error message Patrick Steinhardt
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=ZXwi2MA-KUxszfGj@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=worldhello.net@gmail.com \
--cc=zhiyou.jx@alibaba-inc.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.