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

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

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

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

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(, git_path_bisect_start(), 0) < 1) { Hmm, tricky but correct to do the "< 1" comparison.

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

2016-08-23 Thread Pranit Bauva
Reimplement `bisect_reset` shell function in C and add a `--bisect-reset` subcommand to `git bisect--helper` to call it from git-bisect.sh . Using `bisect_reset` subcommand is a temporary measure to port shell functions to C so as to use the existing test suite. As more functions are ported, this