Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-05-07 Thread Duy Nguyen
On Tue, May 7, 2019 at 10:43 AM Junio C Hamano wrote: > -- >8 -- > Subject: t0040: protect lines that are indented by spaces > > This block is byte-for-byte identical expected output, that contains a > few lines that are indented in many spaces, which makes "git diff --check" > unhappy and will br

Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-05-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > But due to the way the options parsing machinery works this resulted > in the rather absurd situation of: > > $ git clone --recurs [...] > error: ambiguous option: recurs (could be --recursive or > --recurse-submodules) > > Add OPT_ALIAS() to express this

[PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-29 Thread Nguyễn Thái Ngọc Duy
Change the option parsing machinery so that e.g. "clone --recurs ..." doesn't error out because "clone" understands both "--recursive" and "--recurse-submodules" to mean the same thing. Initially "clone" just understood --recursive until the --recurses-submodules alias was added in ccdd3da652 ("cl

Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-19 Thread Junio C Hamano
Duy Nguyen writes: > So an alternative is simply outsource the ambiguity decision back to > git-clone. If the same situation appears again elsewhere, we'll need > to sit back and fix it for real. But this way we don't potentially > introduce any new traps. Sounds like a sensibly safe approach.

Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-18 Thread Duy Nguyen
On Thu, Apr 18, 2019 at 09:48:39AM +0900, Junio C Hamano wrote: > > But on the other hand I can see it's a bit more work to teach > > parse-options OPT_ALIAS to say "--recursive is just an alias of > > --recurse-submodules" and chances of --recursive-hard coming up are > > probably very low. > > T

Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-17 Thread Junio C Hamano
Duy Nguyen writes: >> { OPTION_CALLBACK, 0, "recursive", &option_recurse_submodules, >> N_("pathspec"), N_("initialize submodules in the clone"), >> - PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, recurse_submodules_cb, >> - (intptr_t)"." }, >> + PARSE_OPT_OPTARG

Re: [PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-17 Thread Duy Nguyen
On Wed, Apr 17, 2019 at 7:44 PM Ævar Arnfjörð Bjarmason wrote: > > Change the option parsing machinery so that e.g. "clone --recurs ..." > doesn't error out because "clone" understands both "--recursive" and > "--recurse-submodules" to mean the same thing. > > Initially "clone" just understood --r

[PATCH v2] parse-options: don't emit "ambiguous option" for aliases

2019-04-17 Thread Ævar Arnfjörð Bjarmason
Change the option parsing machinery so that e.g. "clone --recurs ..." doesn't error out because "clone" understands both "--recursive" and "--recurse-submodules" to mean the same thing. Initially "clone" just understood --recursive until the --recurses-submodules alias was added in ccdd3da652 ("cl