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

Re: [PATCH] Simple update to bash completions to prevent unbound variable errors.

From
Ted Pavlic <ted@tedpavlic.com>
Date
Jan 13, 2009, 04:50 UTC
Message-ID
<496C1D90.1020609@tedpavlic.com>
In-Reply-To
<496C19E0.6060308@tedpavlic.com>
> Without the modeline, the vim I was using didn't set ft=sh. It seemed
> like the original authors were careful to use tabs everywhere, which was
> the major reason I used the modeline. I added the fdm=marker just in
> case someone would want to clean up the code someday and do some folding.
NOTE: On my system, I save git-completion.bash to .git_bash_completion. 
Because of that, Vim can't ftdetect off of the file name. The modeline 
allows ft=sh even when you don't end in .sh or .bash.
An alternative (to a Vim modeline) is to put
#!bash

at the top of the script. That would do the same thing as the modeline (even though it would never actually get used by the sourced "script").

--Ted
-- 
Ted Pavlic <ted@tedpavlic.com>

   Please visit my ALS association page:
         http://web.alsa.org/goto/tedpavlic
   My family appreciates your support in the fight to defeat ALS.
Previous: Ted PavlicNext: Teemu Likonen
Message 5 of 9 in “Simple update to bash completions to prevent unbound variable errors.”
  1. Simple update to bash completions to prevent unbound variable errors.Ted Pavlic, Jan 13, 2009
  2. Junio C HamanoJan 13, 2009
  3. Boyd Stephen Smith Jr.Jan 13, 2009
  4. Ted PavlicJan 13, 2009
  5. Ted PavlicJan 13, 2009
  6. Teemu LikonenJan 13, 2009
  7. Junio C HamanoJan 13, 2009
  8. Ted PavlicJan 13, 2009
  9. Junio C HamanoJan 13, 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.