[PATCH v8 0/5] Bisect terms

2015-06-24 Thread Matthieu Moy
This is a minor iteration over v7 to take into account Junio and
Eric's comments, AND fix an important typo that I introduced in the
strbuf code conversion (I used name_good instead of name_bad). This
fixes the git bisect visualize bug I found earlier. I played a bit
with the result and didn't find any bug.

Except for the last patch, it seems at least close to mergeable.

diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index ef0c03c..a37336e 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -134,7 +134,7 @@ You must run `git bisect start` without commits as argument 
and run
 commits.
 
 Alternative terms: use your own terms
-
+~
 
 If the builtins terms bad/good and new/old do not satisfy you, you can
 set your own terms.
diff --git a/revision.c b/revision.c
index f22923f..24ce842 100644
--- a/revision.c
+++ b/revision.c
@@ -2083,27 +2083,21 @@ extern void read_bisect_terms(const char **bad, const 
char **good);
 
 static int for_each_bad_bisect_ref(const char *submodule, each_ref_fn fn, void 
*cb_data)
 {
-   struct strbuf bisect_refs_buf = STRBUF_INIT;
-   const char *bisect_refs_str;
+   struct strbuf bisect_refs = STRBUF_INIT;
int status;
-   strbuf_addstr(bisect_refs_buf, refs/bisect/);
-   strbuf_addstr(bisect_refs_buf, name_bad);
-   bisect_refs_str = strbuf_detach(bisect_refs_buf, NULL);
-   status = for_each_ref_in_submodule(submodule, bisect_refs_str, fn, 
cb_data);
-   free((char *)bisect_refs_str);
+   strbuf_addf(bisect_refs, refs/bisect/%s, name_bad);
+   status = for_each_ref_in_submodule(submodule, bisect_refs.buf, fn, 
cb_data);
+   strbuf_release(bisect_refs);
return status;
 }
 
 static int for_each_good_bisect_ref(const char *submodule, each_ref_fn fn, 
void *cb_data)
 {
-   struct strbuf bisect_refs_buf = STRBUF_INIT;
-   const char *bisect_refs_str;
+   struct strbuf bisect_refs = STRBUF_INIT;
int status;
-   strbuf_addstr(bisect_refs_buf, refs/bisect/);
-   strbuf_addstr(bisect_refs_buf, name_bad);
-   bisect_refs_str = strbuf_detach(bisect_refs_buf, NULL);
-   status = for_each_ref_in_submodule(submodule, bisect_refs_str, fn, 
cb_data);
-   free((char *)bisect_refs_str);
+   strbuf_addf(bisect_refs, refs/bisect/%s, name_good);
+   status = for_each_ref_in_submodule(submodule, bisect_refs.buf, fn, 
cb_data);
+   strbuf_release(bisect_refs);
return status;
 }
 


Antoine Delaite (5):
  bisect: correction of typo
  bisect: replace hardcoded bad|good by variables
  bisect: simplify the addition of new bisect terms
  bisect: add the terms old/new
  bisect: allow any terms set by user

 Documentation/git-bisect.txt |  67 +-
 bisect.c |  94 +++-
 git-bisect.sh| 207 +++
 revision.c   |  20 -
 t/t6030-bisect-porcelain.sh  |  83 -
 5 files changed, 407 insertions(+), 64 deletions(-)
 mode change 100755 = 100644 git-bisect.sh

-- 
2.4.4.414.g59d82e6

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/5] Bisect terms

2015-06-24 Thread Junio C Hamano
Matthieu Moy matthieu@imag.fr writes:

 This is a minor iteration over v7 to take into account Junio and
 Eric's comments, AND fix an important typo that I introduced in the
 strbuf code conversion (I used name_good instead of name_bad). This
 fixes the git bisect visualize bug I found earlier. I played a bit
 with the result and didn't find any bug.

It seems that [3/5] essentially is the same from the previous round,
though.  I'll have more comments on it In-Reply-To that message.

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 0/5] Bisect terms

2015-06-24 Thread Junio C Hamano
Matthieu Moy matthieu@imag.fr writes:

  Documentation/git-bisect.txt |  67 +-
  bisect.c |  94 +++-
  git-bisect.sh| 207 
 +++
  revision.c   |  20 -
  t/t6030-bisect-porcelain.sh  |  83 -
  5 files changed, 407 insertions(+), 64 deletions(-)
  mode change 100755 = 100644 git-bisect.sh

How come nobody noticed this last line so far, during the 7 rounds
of reviews?

I'll locally fix it up so no need to resend.

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html