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: Fri, 21 Aug 2026 09:42:38 -0700 [thread overview]
Message-ID: <xmqq5x13qvb5.fsf@gitster.g> (raw)
In-Reply-To: <CALnO6CCr+CMhB6Pxo7KHExcJ7PBcEQODEJa_PmfguCr_WYVS+A@mail.gmail.com> (D. Ben Knoble's message of "Fri, 21 Aug 2026 08:31:46 -0400")
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
>> [Footnote]
>>
>> * Look for case_clause in
>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
>> and read from there.
>
> Oh, thanks! The Bash manual doesn't admit that case in my reading, but
> it clearly does in implementation. Oddly, I seem to recall several
> years ago that both Bash and ShellCheck would complain about empty
> case arms (I got in the habit of writing ": continue" as a bit of a
> comment). Anyway, TIL.
I am afraid that the description in POSIX itself contributes heavily
to this common misconception.
Section 2.9.4.3 (Case Conditional Construct)
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04_05
gives a simplified syntax
The format for the case construct is as follows:
case word in
[[(] pattern[ | pattern] ... ) compound-list terminator] ...
[[(] pattern[ | pattern] ... ) compound-list]
esac
and I think that is where the most people go to learn what is and
what is not kosher in the standard. But as you saw, this simplified
"format" contradicts what the actual grammar, described in Section
2.10 (Shell Grammar) has (notably, you can have linebreak, which is
defined to be zero or more NEWLINEs, instead of compound-list
there).
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_10
prev parent reply other threads:[~2026-08-21 16:42 UTC|newest]
Thread overview: 14+ 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
2026-08-21 12:31 ` D. Ben Knoble
2026-08-21 16:42 ` 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=xmqq5x13qvb5.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 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.