Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-13 Thread Siddharth Kannan
Hey Junio, > > 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. Okay, got it! I will write-up those changes, and make sure nothing bad happens. (Also, the

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-12 Thread Junio C Hamano
Siddharth Kannan 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 >

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-12 Thread Siddharth Kannan
On Sat, Feb 11, 2017 at 01:08:09PM -0800, Junio C Hamano wrote: > Siddharth Kannan writes: > > > Um, I am sorry, but I feel that decrementing left, and incrementing it > > again is > > also confusing. > > Yes, but it is no more confusing than your original

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-11 Thread Junio C Hamano
Junio C Hamano writes: > Such a change to handle_revision_opt() unfortunately affects other > callers of the function, so it may not be worth it, and I think > "decrement and then increment, because this codepath wants to check > to see something that may ordinarily be

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-11 Thread Junio C Hamano
Siddharth Kannan writes: > On Fri, Feb 10, 2017 at 03:35:47PM -0800, Junio C Hamano wrote: > >> I am wondering if writing it like the following is easier to >> understand. I had a hard time figuring out what you are trying to >> do, partly because "args" is quite a

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-11 Thread Siddharth Kannan
Hey Junio, On Fri, Feb 10, 2017 at 03:35:47PM -0800, Junio C Hamano wrote: > So the difference is just "--left" (by the way, our codebase seem to > prefer "left--" when there is no difference between pre- or post- > decrement/increment) that adjusts the slot in argv[] where the next > unknown

Re: [PATCH 1/2 v3] revision.c: args starting with "-" might be a revision

2017-02-10 Thread Junio C Hamano
Siddharth Kannan writes: > @@ -2234,11 +2235,18 @@ int setup_revisions(int argc, const char **argv, > struct rev_info *revs, struct s > } > if (opts < 0) > exit(128); > -