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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ping Yin <pkufranky@...>
Cc: <git@...>
Date: Monday, November 12, 2007 - 10:46 am

Hello,

A couple of portability nits:

* Ping Yin wrote on Mon, Nov 12, 2007 at 03:21:17PM CET:
[...]

Typo: s/modifiled/modified/

Then, "echo -e" is not portable (and not used elsewhere in git), but you
can just use this instead:
  test ... && { echo "# ..."; echo "#"; }

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\""
?


$' is not portable (and not POSIX either).  For example pdksh, OpenBSD
/bin/sh (which are both similar) will add "$" to the list of sepators
here, compare this: 

  $ foo=$'\n'; echo ".$foo."
  .$
  .

And at least some ash/dash versions will not interpret this as a newline
at all:
  .$\n.

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.

Cheers,
Ralf
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] status&amp;commit: Teach them to show submodule ..., Johannes Schindelin, (Mon Nov 12, 12:13 pm)
Re: [PATCH] status&commit: Teach them to show submodule ..., Ralf Wildenhues, (Mon Nov 12, 10:46 am)