Re: [PATCH v14 07/27] bisect--helper: `bisect_reset` shell function in C

2016-08-29 Thread Junio C Hamano
Pranit Bauva writes: >> with the original >> >> case $# in >> 0) reset to the branch ;; >> 1) reset to the commit ;; >> *) give usage and die ;; >> esac >> >> and took the difference and reacted "ah, excess parameters are not >> diagnosed in this function". >> >> Your calle

Re: [PATCH v14 07/27] bisect--helper: `bisect_reset` shell function in C

2016-08-27 Thread Pranit Bauva
Hey Junio, On Fri, Aug 26, 2016 at 9:59 PM, Junio C Hamano wrote: > Pranit Bauva writes: > >>> Also this version fails to catch "bisect reset a b c" as an error, I >>> suspect. >> >> It didn't when I tried it right now. Could you please elaborate on why >> you think it can fail? There might be a

Re: [PATCH v14 07/27] bisect--helper: `bisect_reset` shell function in C

2016-08-26 Thread Junio C Hamano
Pranit Bauva writes: >> Also this version fails to catch "bisect reset a b c" as an error, I >> suspect. > > It didn't when I tried it right now. Could you please elaborate on why > you think it can fail? There might be a thing which I haven't tested. My bad. I just compared your bisect_reset()

Re: [PATCH v14 07/27] bisect--helper: `bisect_reset` shell function in C

2016-08-26 Thread Pranit Bauva
Hey Junio, On Thu, Aug 25, 2016 at 2:42 AM, Junio C Hamano wrote: > > Pranit Bauva writes: > > > +static int bisect_reset(const char *commit) > > +{ > > + struct strbuf branch = STRBUF_INIT; > > + > > + if (!commit) { > > + if (strbuf_read_file(&branch, git_path_bisect_start(

Re: [PATCH v14 07/27] bisect--helper: `bisect_reset` shell function in C

2016-08-24 Thread Junio C Hamano
Pranit Bauva writes: > +static int bisect_reset(const char *commit) > +{ > + struct strbuf branch = STRBUF_INIT; > + > + if (!commit) { > + if (strbuf_read_file(&branch, git_path_bisect_start(), 0) < 1) { Hmm, tricky but correct to do the "< 1" comparison. If the file does n