From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Jonathan Tan <jonathantanmy@google.com>, git@vger.kernel.org
Subject: Re: [PATCH v2 1/3] fetch-pack: return enum from process_acks()
Date: Tue, 28 Apr 2020 09:54:19 -0700 [thread overview]
Message-ID: <xmqqftcn4klg.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200428005333.GE36078@google.com> (Jonathan Nieder's message of "Mon, 27 Apr 2020 17:53:33 -0700")
Jonathan Nieder <jrnieder@gmail.com> writes:
>> /* return 0 if no common, 1 if there are common, or 2 if ready */
>
> This comment can be removed now, which is a nice bonus.
>
>> - return received_ready ? 2 : (received_ack ? 1 : 0);
>> + return received_ready ? READY :
>> + (received_ack ? COMMON_FOUND : NO_COMMON_FOUND);
>> }
>>
>> static void receive_shallow_info(struct fetch_pack_args *args,
>> @@ -1508,13 +1529,13 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
>> case FETCH_PROCESS_ACKS:
>> /* Process ACKs/NAKs */
>> switch (process_acks(negotiator, &reader, &common)) {
>> - case 2:
>> + case READY:
>> state = FETCH_GET_PACK;
>> break;
>> - case 1:
>> + case COMMON_FOUND:
>> in_vain = 0;
>> /* fallthrough */
>> - default:
>> + case NO_COMMON_FOUND:
>> state = FETCH_SEND_REQUEST;
>> break;
>> }
>
> With the extraneous comment removed,
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Yes, the result reads very clearly.
Locally amended.
Thanks.
next prev parent reply other threads:[~2020-04-28 16:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 0:56 [PATCH 0/2] Protocol v2 in_vain fixes Jonathan Tan
2020-04-25 0:56 ` [PATCH 1/2] fetch-pack: in protocol v2, in_vain only after ACK Jonathan Tan
2020-04-25 5:08 ` Junio C Hamano
2020-04-26 0:28 ` Jonathan Nieder
2020-04-27 17:27 ` Jonathan Tan
2020-04-27 22:16 ` Junio C Hamano
2020-04-25 0:56 ` [PATCH 2/2] fetch-pack: in protocol v2, reset in_vain upon ACK Jonathan Tan
2020-04-26 1:10 ` Jonathan Nieder
2020-04-27 17:28 ` Jonathan Tan
2020-04-28 0:01 ` [PATCH v2 0/3] Protocol v2 in_vain fixes Jonathan Tan
2020-04-28 0:01 ` [PATCH v2 1/3] fetch-pack: return enum from process_acks() Jonathan Tan
2020-04-28 0:53 ` Jonathan Nieder
2020-04-28 16:54 ` Junio C Hamano [this message]
2020-04-28 18:00 ` Michal Suchánek
2020-04-28 19:17 ` Junio C Hamano
2020-04-28 0:01 ` [PATCH v2 2/3] fetch-pack: in protocol v2, in_vain only after ACK Jonathan Tan
2020-04-28 0:54 ` Jonathan Nieder
2020-05-06 21:08 ` Johannes Schindelin
2020-05-06 22:07 ` [PATCH] t5500: count objects through stderr, not trace Jonathan Tan
2020-05-06 22:28 ` Junio C Hamano
2020-05-06 22:40 ` Junio C Hamano
2020-05-07 14:35 ` Johannes Schindelin
2020-10-13 14:45 ` Johannes Schindelin
2020-04-28 0:01 ` [PATCH v2 3/3] fetch-pack: in protocol v2, reset in_vain upon ACK Jonathan Tan
2020-04-28 0:55 ` Jonathan Nieder
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqftcn4klg.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=jrnieder@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).