Re: [PATCH] parse-opt: migrate builtin-checkout-index.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 19, 2008, 21:45 UTC
- Message-ID
- <7vr66c5kef.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1224292643-28704-1-git-send-email-vmiklos@frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 15 quoted lines
>> > + if (argc && read_from_stdin)
>> > + die("--stdin must be at the end");
>>
>> Is this comment still correct? Do the original and your version act
>> the
>> same way when the user says "checkout --stdin -f", for example? I
>> suspect
>> the original refused it and yours take it (and do much more sensible
>> thing), which would be an improvement, but then the error message
>> should
>> be reworded perhaps?
>
> Unless I missed something, that was a limitation of the option parser.
> checkout-index --stdin -f works fine for me after removing those two
> lines, so I left them out from the updated patch.Thanks. I think you got what I meant and dropping the part is right.
"--stdin -f" was rejected by the original code, and you improved to take it with the new parser. In fact, the above quoted if() statement should not trigger when "--stdin -f" is given, due to the way the new option parser is structured. The original had an explicit "break" in the loop when it saw "--stdin". The above would still trigger if "--stdin foo" is given, but there is a code to catch that already, so it is not necessary.