From: Junio C Hamano <gitster@pobox.com>
To: Jiang Xin <worldhello.net@gmail.com>
Cc: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>,
Git List <git@vger.kernel.org>,
Jonathan Tan <jonathantanmy@google.com>,
Jiang Xin <zhiyou.jx@alibaba-inc.com>
Subject: Re: [PATCH v2 3/3] pkt-line: do not chomp newlines for sideband messages
Date: Wed, 04 Oct 2023 13:05:33 -0700 [thread overview]
Message-ID: <xmqqa5syp302.fsf@gitster.g> (raw)
In-Reply-To: <CANYiYbHp-3YuSPHnR8gjS40UJLrJV5FPzqd_BtjyR8TAALhfRQ@mail.gmail.com> (Jiang Xin's message of "Wed, 4 Oct 2023 21:02:25 +0800")
Jiang Xin <worldhello.net@gmail.com> writes:
> On Tue, Sep 26, 2023 at 4:48 PM Oswald Buddenhagen
> <oswald.buddenhagen@gmx.de> wrote:
>>
>> >Jiang Xin <worldhello.net@gmail.com> writes:
>> >
>> >> +++ b/pkt-line.c
>> >> @@ -462,8 +462,33 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer,
>> >> }
>> >> + case 2:
>> >> + /* fallthrough */
>> >> + case 3:
>> >
>> while not entirely unprecedented, it's unnecessary and even
>> counter-productive to annotate directly adjacent cases with fallthrough.
>
> I see in "blame.c" there are directly adjacent cases like below. I
> will remove the fallthrough statement.
>
> case 'A':
> case 'T':
> /* Did not exist in parent, or type changed */
> break;
Yeah, it is far clearer to understand if it is written without the
"fallthru" comment between the cases and instead a comment that
explains both cases after them (exactly like the example you found
in "blame.c"). When we want "fallthru" comment is if we had some
processing specific to the earlier case ('A' or '2') that is not
done in the later case ('T' or '3'), in which case we may want to
explicitly say we did not forget to "break" by adding the "fallthru"
comment. But it does not apply here.
Thanks.
next prev parent reply other threads:[~2023-10-04 20:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 7:19 [PATCH] pkt-line: do not chomp EOL for sideband progress info Jiang Xin
2023-09-19 22:38 ` Junio C Hamano
2023-09-20 21:08 ` Jonathan Tan
2023-09-25 0:25 ` Jiang Xin
2023-09-25 15:41 ` [PATCH v2 1/3] test-pkt-line: add option parser for unpack-sideband Jiang Xin
2023-09-25 15:41 ` [PATCH v2 2/3] pkt-line: memorize sideband fragment in reader Jiang Xin
2023-09-25 15:41 ` [PATCH v2 3/3] pkt-line: do not chomp newlines for sideband messages Jiang Xin
2023-09-25 21:51 ` Junio C Hamano
2023-09-26 8:48 ` Oswald Buddenhagen
2023-10-04 13:02 ` Jiang Xin
2023-10-04 20:05 ` Junio C Hamano [this message]
2023-10-04 13:18 ` [PATCH v3 0/3] Sideband demultiplexer fixes Jiang Xin
2023-10-04 13:18 ` [PATCH v3 1/3] test-pkt-line: add option parser for unpack-sideband Jiang Xin
2023-10-04 13:18 ` [PATCH v3 2/3] pkt-line: memorize sideband fragment in reader Jiang Xin
2023-10-04 13:18 ` [PATCH v3 3/3] pkt-line: do not chomp newlines for sideband messages Jiang Xin
2023-12-17 14:41 ` [PATCH v4 0/3] Sideband-all demultiplexer fixes Jiang Xin
2023-12-17 14:41 ` [PATCH v4 1/3] test-pkt-line: add option parser for unpack-sideband Jiang Xin
2023-12-17 14:41 ` [PATCH v4 2/3] pkt-line: memorize sideband fragment in reader Jiang Xin
2023-12-17 14:41 ` [PATCH v4 3/3] pkt-line: do not chomp newlines for sideband messages Jiang Xin
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=xmqqa5syp302.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=oswald.buddenhagen@gmx.de \
--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 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 NNTP newsgroup(s).