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

Re: What's cooking in git.git (Aug 2009, #03; Thu, 20)

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2009, 20:10 UTC
Message-ID
<7vfxbldj31.fsf@alter.siamese.dyndns.org>
In-Reply-To
<200908212006.16333.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 12 quoted lines
>> +cat >>gitweb_config.perl <<EOF
>> +
>> +\$feature{'snapshot'}{'override'} = 0;
>> +EOF
>
> A trick: use '\EOF' and you don't need to escape $ against variable
> expansion by shell.
>
>   +cat >>gitweb_config.perl <<\EOF
>   +
>   +$feature{'snapshot'}{'override'} = 0;
>   +EOF

It is not a "trick" but is a basic courtesy for reviewers. Even if you do not have any $ to worry about, _unless_ you actively know you would want variable substitution to happen, it is easier for readers if you signal the fact that the here-doc is verbatim by quoting the \EOF marker upfront.

Same thing for use of single quotes vs double quotes when writing strings, even though they tend to be small and much less of an issue.

Previous: Jakub NarebskiNext: Mark A Rada
Message 6 of 10 in “What's cooking in git.git (Aug 2009, #03; Thu, 20)”
  1. Junio C HamanoAug 21, 2009
  2. Paolo BonziniAug 21, 2009
  3. Junio C HamanoAug 21, 2009
  4. Mark A RadaAug 21, 2009
  5. Jakub NarebskiAug 21, 2009
  6. Junio C HamanoAug 21, 2009
  7. [RFC] gitweb.perl t9500 t9501Mark A Rada, Aug 22, 2009
  8. Junio C HamanoAug 23, 2009
  9. Mark A RadaAug 23, 2009
  10. Junio C HamanoAug 21, 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.