bisect--helper: `bisect_write` shell function in C
Reimplement the `bisect_write` shell function in C and add a `bisect-write` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--bisect-write` subcommand is a temporary measure to port shell function in C so as to use the existing test suite. As more functions are ported, this subcommand will be retired but its implementation will be called by some other methods. Note: bisect_write() uses two variables namely TERM_GOOD and TERM_BAD from the global shell script thus we need to pass it to the subcommand using the arguments. We then store them in a struct bisect_terms and pass the memory address around functions. Add a log_commit() helper function to write the contents of the commit message header to a file which will be re-used in future parts of the code as well. Also introduce a function free_terms() to free the memory of `struct bisect_terms` and set_terms() to set the values of members in `struct bisect_terms`. Helped-by: NRamsay Jones <ramsay@ramsayjones.plus.com> Mentored-by: NLars Schneider <larsxschneider@gmail.com> Mentored-by: NChristian Couder <chriscool@tuxfamily.org> Mentored-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: NPranit Bauva <pranit.bauva@gmail.com> Signed-off-by: NTanushree Tumane <tanushreetumane@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录