Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 12, 2017, 18:56 UTC
- Message-ID
- <xmqqwpcvfdao.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170212123630.GA20872@ubuntu-512mb-blr1-01.localdomain>
Siddharth Kannan <kannan.siddharth12@gmail.com> writes:
> This "changing the order" gave me the idea to change the flow. I tried to > implement the above steps without touching the function handle_revision_opt. By > inserting the handle_revision_arg call just before calling handle_revision_opt.
Changing the order is changing the order of the function calls, i.e. changing the flow. So at the idea level we are on the same page.
I was shooting for not having to duplicate calls to handle_revision_arg().
Show 9 quoted lines
>> But I think the resulting code flow is much closer to the >> above ideal. > > (about Junio's version of the patch): Yes, I agree with you on this. It's like > the ideal, but the argv has already been populated, so the only remaining step > is "left++". >> >> Such a change to handle_revision_opt() unfortunately affects other >> callers of the function, so it may not be worth it.
See the 3-patch series I just sent out. I didn't think it through very carefully (especially the error message the other caller produces), but the whole thing _smells_ correct to me.