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

Re: t7005-editor.sh failure

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 26, 2018, 18:16 UTC
Message-ID
<xmqqlg7oktto.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180926121107.GH27036@localhost>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 5 quoted lines
> Having said all that, I didn't omit the quotes in 4362da078e with the
> above in mind; in fact I tend to use quotes even when they are
> unnecessary (e.g. in variable assignments: var="$1"), because unquoted
> variables and command substitutions freak me out before I can think
> through whether its safe to omit the quotes or not :)

I quote >"$file" (but not var=$var) because the CodingGuidelines tells me to:

 - Redirection operators should be written with space before, but no
   space after them.  In other words, write 'echo test >"$file"'
   instead of 'echo test> $file' or 'echo test > $file'.  Note that
   even though it is not required by POSIX to double-quote the
   redirection target in a variable (as shown above), our code does so
   because some versions of bash issue a warning without the quotes.
;-)
> Sidenote: this test should use the write_script helper to create this
> editor script.
Good suggestion.
Previous: Jeff KingNext: Junio C Hamano
Message 12 of 15 in “t7005-editor.sh failure”
  1. Alexander PyhalovSep 26, 2018
  2. Martin ÅgrenSep 26, 2018
  3. Alexander PyhalovSep 26, 2018
  4. Martin ÅgrenSep 26, 2018
  5. Alexander PyhalovSep 26, 2018
  6. Eric SunshineSep 26, 2018
  7. Martin ÅgrenSep 26, 2018
  8. SZEDER GáborSep 26, 2018
  9. t7005-editor: quote filename to fix whitespace-issueMartin Ågren, Sep 26, 2018
  10. Taylor BlauSep 26, 2018
  11. Jeff KingSep 26, 2018
  12. Junio C HamanoSep 26, 2018
  13. Junio C HamanoSep 26, 2018
  14. Andrei RybakSep 26, 2018
  15. SZEDER GáborSep 27, 2018

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.