Documentation/rev-parse: quoting is required with --parseopt
authorThomas Rast <trast@student.ethz.ch>
Fri, 30 Jul 2010 15:01:50 +0000 (17:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Aug 2010 16:11:28 +0000 (09:11 -0700)
When calling rev-parse --parseopt, as in the (now fixed) documented
example

eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"

the outermost quoting is required, as otherwise all runs of arbitrary
whitespace inside the resulting 'set -- ...' call would be collapsed
into a single space.

This was exposed as a result of our new use of cat <<\EOF since
47e9cd2 (parseopt: wrap rev-parse --parseopt usage for eval
consumption, 2010-06-12), but has always been a problem when handling
arguments containing e.g. newlines.

Point this out in the documentation, and in particular correct the
example that did not have the quotes.

Noticed-by: Joshua Jensen <jjensen@workspacewhiz.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found