aboutsummaryrefslogtreecommitdiff
path: root/bisect.c
Commit message (Collapse)AuthorAge
...
* bisect: remove too much function nestingChristian Couder2009-05-10
| | | | | | | | | | | | | | | | | This patch moves some function calls into "bisect_next_exit" so that functions are nesting less. The call to "bisect_rev_setup" is moved from "bisect_common" into "bisect_next_exit" and the call to "read_bisect_refs" from "bisect_rev_setup" into "bisect_next_exit". While at it, "rev_argv" is moved into "bisect_rev_setup". This will make it easier and cleaner to implement checking merge bases. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: use new "struct argv_array" to prepare argv for "setup_revisions"Christian Couder2009-05-10
| | | | | | | | | | | | Because we will use other instances of this struct. The "rev_argv_push" function is changed into 2 functions "argv_array_push" and "argv_array_push_sha1" that take a "struct argv_array *" as first argument. And these functions are used to simplify "bisect_rev_setup". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: store good revisions in a "sha1_array"Christian Couder2009-05-10
| | | | | | | | | | | | | | | This will make it easier to use good revisions for checking merge bases later. To simplify the code, a new "sha1_array_push" function is also introduced. And while at it we move the earlier part of the code to fill the argv that is passed to "setup_revisions", so that all this code is now completely after "read_bisect_refs". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: implement "rev_argv_push" to fill an argv with revsChristian Couder2009-05-10
| | | | | | | | This patch is a minor clean up right now, but the new function will evolve and be used more later. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: use "sha1_array" to store skipped revisionsChristian Couder2009-05-10
| | | | | | | | | This patch creates a "struct sha1_array" to store skipped revisions, so that the same struct can be reused in a later patch for good revisions. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect--helper: remove "--next-vars" option as it is now uselessChristian Couder2009-05-10
| | | | | | | Because it has been replaced by "--next-exit". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect--helper: add "--next-exit" to output bisect resultsChristian Couder2009-05-10
| | | | | | | | | | | The goal of this patch is to port more shell code from the "bisect_next" function in "git-bisect.sh" to C code in "builtin-bisect--helper.c". So we port the code that interprets the bisection result and stops or continues (by checking out the next revision) the bisection process. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: move common bisect functionality to "bisect_common"Christian Couder2009-05-10
| | | | | | | So we can easily reuse the code in a later patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-list: add "int bisect_show_flags" in "struct rev_list_info"Christian Couder2009-04-07
| | | | | | | | | This is a cleanup patch to make it easier to use the "show_bisect_vars" function and take advantage of the rev_list_info struct. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-list: remove last static vars used in "show_commit"Christian Couder2009-04-07
| | | | | | | | | | | | | | | | | This patch removes the last static variables that were used in the "show_commit" function. To do that, we create a new "rev_list_info" struct that we will pass in the "void *data" argument to "show_commit". This means that we have to change the first argument to "show_bisect_vars" too. While at it, we also remove a "struct commit_list *list" variable in "cmd_rev_list" that is not really needed. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect--helper: string output variables together with "&&"Christian Couder2009-04-05
| | | | | | | | | | | | | | | | | | | | | | | When doing: eval "git bisect--helper --next-vars" | { while read line do echo "$line &&" done echo ':' } the result code comes from the last "echo ':'", not from running "git bisect--helper --next-vars". This patch gets rid of the need to string together the line from the output of "git bisect--helper" with "&&" in the calling script by making "git bisect--helper --next-vars" return output variables already in that format. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-list: pass "int flags" as last argument of "show_bisect_vars"Christian Couder2009-04-05
| | | | | | | | Instead of "int show_all, int show_tried" we now only pass "int flags", because we will add one more flag in a later patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: implement "read_bisect_paths" to read paths in "$GIT_DIR/BISECT_NAMES"Christian Couder2009-04-05
| | | | | | | | | This is needed because "git bisect--helper" must read bisect paths in "$GIT_DIR/BISECT_NAMES", so that a bisection can be performed only on commits that touches paths in this file. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect--helper: implement "git bisect--helper"Christian Couder2009-04-05
| | | | | | | | | | | | | | | | | This patch implements a new "git bisect--helper" builtin plumbing command that will be used to migrate "git-bisect.sh" to C. We start by implementing only the "--next-vars" option that will read bisect refs from "refs/bisect/", and then compute the next bisect step, and output shell variables ready to be eval'ed by the shell. At this step, "git bisect--helper" ignores the paths that may have been put in "$GIT_DIR/BISECT_NAMES". This will be fixed in a later patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* bisect: use the new generic "sha1_pos" function to lookup sha1Christian Couder2009-04-05
| | | | | | | instead of the specific one that was simpler but less efficient. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-list: call new "filter_skip" functionChristian Couder2009-04-05
| | | | | | | | | | | | This patch implements a new "filter_skip" function in C in "bisect.c" that will later replace the existing implementation in shell in "git-bisect.sh". An array is used to store the skipped commits. But the array is not yet fed anything. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-list: move bisect related code into its own fileChristian Couder2009-03-30
This patch creates new "bisect.c" and "bisect.h" files and move bisect related code into these files. While at it, we also remove some include directives that are not needed any more from the beginning of "builtin-rev-list.c". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>