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

Re: [PATCH] status&commit: Teach them to show submodule commit summary

From
Ping Yin <pkufranky@gmail.com>
Date
Nov 12, 2007, 15:17 UTC
Message-ID
<46dff0320711120717gf8a67cdn2b6bdaa9cfa29218@mail.gmail.com>
In-Reply-To
<20071112144605.GA16791@ins.uni-bonn.de>
On Nov 12, 2007 10:46 PM, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
Show 11 quoted lines
> Hello,
>
> A couple of portability nits:
>
> * Ping Yin wrote on Mon, Nov 12, 2007 at 03:21:17PM CET:
> [...]
> > +
> > +     # TODO: quote module names containing space or tab
> > +     test -n "$modules" && echo -e "# Submodules modifiled: "$modules"\n#"
>
> Typo: s/modifiled/modified/
Oops
>
> Then, "echo -e" is not portable (and not used elsewhere in git), but you
> can just use this instead:
>   test ... && { echo "# ..."; echo "#"; }
See
>
> Also, it so happens you leave $modules outside quotes which will drop
> multiple adjacent white spaces.  Did you mean to use
>   echo "# Submodules modified: \"$modules\""

I leave $modules outside quotes to let "\n" change to <space> by auto word splitting. It actually eats white spaces in the module names. So any suggestion to handle this case? To handles module names with spaces, is it ok to display as follows?

Submodules modified: sm1 "sm name with space"
Any good way to only add quoting for names with spaces?
Show 7 quoted lines
> You can instead just use a literal newline:
>   IFS='
>   '
> (minus the indentation).  And add a literal carriage return if need be
> (is that really needed on Mac OS?), though you may want to enclose that
> in another pair of quotes to avoid it being "optimized" away by some
> editor.

I just guess '\r' is need for Mac OS because i havn't Mac OS environment. BTW, how to add a literal carriage return?

>
> Cheers,
> Ralf
>
-- 
Ping Yin
Previous: Ralf WildenhuesNext: Brian Gernhardt
Message 3 of 16 in “status&commit: Teach them to show submodule commit summary”
  1. status&commit: Teach them to show submodule commit summaryPing Yin, Nov 12, 2007
  2. Ralf WildenhuesNov 12, 2007
  3. Ping YinNov 12, 2007
  4. Brian GernhardtNov 12, 2007
  5. Jakub NarebskiNov 12, 2007
  6. Ping YinNov 12, 2007
  7. Johannes SixtNov 12, 2007
  8. Jakub NarebskiNov 12, 2007
  9. Ping YinNov 12, 2007
  10. Johannes SchindelinNov 12, 2007
  11. Ping YinNov 12, 2007
  12. Johannes SixtNov 12, 2007
  13. Ping YinNov 12, 2007
  14. Johannes SixtNov 12, 2007
  15. Lars HjemliNov 12, 2007
  16. Ping YinNov 15, 2007

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.