From: Junio C Hamano <gitster@pobox.com>
To: "D. Ben Knoble" <ben.knoble@gmail.com>
Cc: Lutz Lengemann via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Lutz Lengemann <lutz@lengemann.net>
Subject: Re: [PATCH v2] completion: zsh: support completion after "git -C <path>"
Date: Thu, 20 Aug 2026 14:39:51 -0700 [thread overview]
Message-ID: <xmqqo6ewtqs8.fsf@gitster.g> (raw)
In-Reply-To: <CALnO6CC35iuyJpKZtkEN7fGuGK7zKd_jbebyZdKSQ1pyfOBRZA@mail.gmail.com> (D. Ben Knoble's message of "Thu, 20 Aug 2026 08:28:33 -0400")
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
>> ++ ;;
>> ++ -c|--git-dir|--work-tree|--namespace)
>> ++ (( i++ ))
>> ++ ;;
>> ++ -*)
>> ++ ;;
>
> Yep, unlike Bash (which requires at least one command in the "list"
> part between a pattern and the terminator), Zsh accepts empty actions
> here.
This may be a common misconception.
It is true that a compound_list is not allowed to be empty, but
POSIX.1 sh grammar [*] explicitly allows ';;' to come after ')'
without a compound_list in between.
Specifically
case_item : pattern ')' linebreak DSEMI linebreak
| pattern ')' compound_list DSEMI linebreak
| '(' pattern ')' linebreak DSEMI linebreak
| '(' pattern ')' compound_list DSEMI linebreak
;
where "linebreak" is a run of NEWLINE tokens or empty. So
case $foo in
bar) ;;
esac
is allowed.
[Footnote]
* Look for case_clause in
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
and read from there.
prev parent reply other threads:[~2026-08-20 21:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 15:30 [PATCH] completion: zsh: support completion after "git -C <path>" Lutz Lengemann via GitGitGadget
2026-06-17 17:17 ` Ben Knoble
2026-06-17 17:21 ` Junio C Hamano
2026-06-18 17:43 ` D. Ben Knoble
2026-07-14 22:34 ` D. Ben Knoble
2026-08-17 19:29 ` Lutz Lengemann
2026-08-18 12:13 ` D. Ben Knoble
2026-08-18 12:40 ` Lutz Lengemann
2026-08-18 16:35 ` D. Ben Knoble
2026-08-19 13:07 ` [PATCH v2] " Lutz Lengemann via GitGitGadget
2026-08-20 12:28 ` D. Ben Knoble
2026-08-20 21:39 ` Junio C Hamano [this message]
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=xmqqo6ewtqs8.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=lutz@lengemann.net \
/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