Re: [PATCH v3 5/8] git-prompt: add some missing quotes
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 17, 2024, 09:38 UTC
- Message-ID
- <CAPig+cQVHVoDFD484dxu2gOuvzVHj9-78pyTnCo2-uy6=N5P-g@mail.gmail.com>
- In-Reply-To
- <3a41ad889cc33a1fc0414b8f14af6438b49c88ee.1723886761.git.gitgitgadget@gmail.com>
On Sat, Aug 17, 2024 at 5:26 AM Avi Halachmi (:avih) via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 5 quoted lines
> The issues which this commit fixes are unlikely to be broken > in real life, but the fixes improve correctness, and would prevent > bugs in some uncommon cases, such as weird IFS values. > > Listing some portability guideline here for future reference.
s/guideline/guidelines/
> I'm leaving it to someone else to decide whether to include > it in the file itself, place is as a new file, or not.
perhaps: s/is as/it as/
Show 16 quoted lines
> "Simple command" (POSIX term) is assignment[s] and/or command [args]. > Examples: > foo=bar # one assignment > foo=$bar x=y # two assignments > foo bar # command, no assignments > x=123 foo bar # one assignment and a command > > The assignments part is not IFS-split or glob-expanded. > > The command+args part does get IFS field split and glob expanded, > but only at unquoted expanded/substituted parts. > > In the command+args part, expanded/substituted values must be quoted. > (the commands here are "[" and "local"): > Good: [ "$mode" = yes ]; local s="*" x="$y" e="$?" z="$(cmd ...)" > Bad: [ $mode = yes ]; local s=* x=$y e=$? z=$(cmd...)
This new explanation in v3 is a helpful addition.
> The arguments to "local" do look like assignments, but they're not > the assignment part of a simple command. they're at the command part.
either: s/they're/They're/ or: s/. they're/; they're/
I doubt that any of the above extremely minor commit message botches is worth a reroll.