git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] Purest update to bash completions to prevent unbounded variable errors.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 13, 2009, 16:34 UTC
Message-ID
<20090113163421.GQ10179@spearce.org>
In-Reply-To
<496CBC98.7090101@tedpavlic.com>
Ted Pavlic <ted@tedpavlic.com> wrote:
Show 6 quoted lines
>
> First in a series of patches that make bash completions more robust to
> different interactive shell configurations and editors.
>
>
> Signed-off-by: Ted Pavlic <ted@tedpavlic.com>

Your commit message leaves a lot to be desired. I would instead have written something like this:

  bash-completion: Support running when set -u is enabled
  Under set -u semenatics it is an error to access undefined
  variables.  Some user environments may enable this in the
  interactive shell.
  In any context where the completion functions access an undefined
  variable, accessing a default empty string (aka "${1-}" instead of
  "$1") is a reasonable way to code the function, as it silences
  the undefined variable error while still supplying an empty string.
Acked-by: Shawn O. Pearce <spearce@spearce.org>
> ---
>  contrib/completion/git-completion.bash |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
-- 
Shawn.
Previous: Ted PavlicNext: Ted Pavlic
Message 2 of 6 in “Purest update to bash completions to prevent unbounded variable errors.”
  1. 1/3 Purest update to bash completions to prevent unbounded variable errors.Ted Pavlic, Jan 13, 2009
  2. Shawn O. PearceJan 13, 2009
  3. Ted PavlicJan 13, 2009
  4. Shawn O. PearceJan 13, 2009
  5. Junio C HamanoJan 13, 2009
  6. Ted PavlicJan 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.