]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/rev-parse.c
rev-parse parseopt: interpret any whitespace as start of help text
authorBrandon Casey <drafnel@gmail.com>
Sun, 17 Sep 2017 22:28:16 +0000 (15:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Sep 2017 03:13:08 +0000 (12:13 +0900)
commit33e75122f483f887d4db7ccec01f42dea7ee79fb
treed1367c42c2324d2b373abe394aaa3f27f68a8405
parent28a8d0f77a27646dcbd87f0718b79501113cb82c
rev-parse parseopt: interpret any whitespace as start of help text

Currently, rev-parse only interprets a space ' ' character as the
delimiter between the option spec and the help text.  So if a tab
character is placed between the option spec and the help text, it will
be interpreted as part of the long option name or as part of the arg
hint.  If it is interpreted as part of the long option name, then
rev-parse will produce what will be interpreted as multiple arguments
on the command line.

For example, the following option spec (note: there is a <tab> between
"frotz" and "enable"):

    frotz enable frotzing

will produce the following set expression when --frotz is used:

    set -- --frotz --

instead of this:

    set -- --frotz  enable --

Mark t1502.2 as fixed.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c
t/t1502-rev-parse-parseopt.sh