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

Re: [PATCHv2] Add --reference option to git submodule.

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 28, 2009, 14:51 UTC
Message-ID
<49F717D4.70708@viscovery.net>
In-Reply-To
<49F702C0.8030206@drmicha.warpmail.net>
Michael J Gruber schrieb:
> BTW, even dash has "test STRING" so portability doesn't require -n but I
> think it's OK either way.

It is not if STRING is user input; it could be, e.g., '-f', and then the command gives a syntax error because of a missing argument.

It's safer to use test -z and test -n unless the string to test is completely under the control of the script.

-- Hannes
Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 6 in “[PATCHv2] Add --reference option to git submodule.”
  1. Michael S. TsirkinApr 28, 2009
  2. Michael J GruberApr 28, 2009
  3. Johannes SixtApr 28, 2009
  4. Michael J GruberApr 28, 2009
  5. Junio C HamanoApr 28, 2009
  6. Michael S. TsirkinMay 4, 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.