git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v8 0/5] Bisect terms

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Jun 24, 2015, 15:17 UTC
Message-ID
<1435159062-23468-1-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<1435064084-5554-1-git-send-email-Matthieu.Moy@imag.fr>

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
Previous: Junio C HamanoNext: Matthieu Moy
Message 21 of 48 in “bisect: correction of typo”
  1. 1/6 bisect: correction of typoAntoine Delaite, Jun 22, 2015
  2. 2/6 bisect: replace hardcoded "bad|good" by variablesAntoine Delaite, Jun 22, 2015
  3. 3/6 bisect: simplify the addition of new bisect termsAntoine Delaite, Jun 22, 2015
  4. 4/6 bisect: add the terms old/newAntoine Delaite, Jun 22, 2015
  5. 5/6 revision: fix rev-list --bisect in old/new modeAntoine Delaite, Jun 22, 2015
  6. 6/6 bisect: allows any terms set by userAntoine Delaite, Jun 22, 2015
  7. 0/5 git bisect old/newMatthieu Moy, Jun 23, 2015
  8. 1/5 bisect: correction of typoMatthieu Moy, Jun 23, 2015
  9. 2/5 bisect: replace hardcoded "bad|good" by variablesMatthieu Moy, Jun 23, 2015
  10. 3/5 bisect: simplify the addition of new bisect termsMatthieu Moy, Jun 23, 2015
  11. Eric SunshineJun 23, 2015
  12. Matthieu MoyJun 23, 2015
  13. 4/5 bisect: add the terms old/newMatthieu Moy, Jun 23, 2015
  14. Remi Galan AlfonsoJun 23, 2015
  15. Matthieu MoyJun 23, 2015
  16. 5/5 bisect: allows any terms set by userMatthieu Moy, Jun 23, 2015
  17. Junio C HamanoJun 23, 2015
  18. Junio C HamanoJun 23, 2015
  19. Matthieu MoyJun 23, 2015
  20. Junio C HamanoJun 23, 2015
  21. 0/5 Bisect termsMatthieu Moy, Jun 24, 2015
  22. 1/5 bisect: correction of typoMatthieu Moy, Jun 24, 2015
  23. 2/5 bisect: replace hardcoded "bad|good" by variablesMatthieu Moy, Jun 24, 2015
  24. 3/5 bisect: simplify the addition of new bisect termsMatthieu Moy, Jun 24, 2015
  25. Junio C HamanoJun 24, 2015
  26. Matthieu MoyJun 24, 2015
  27. 4/5 bisect: add the terms old/newMatthieu Moy, Jun 24, 2015
  28. 5/5 bisect: allow any terms set by userMatthieu Moy, Jun 24, 2015
  29. Junio C HamanoJun 24, 2015
  30. Matthieu MoyJun 24, 2015
  31. Junio C HamanoJun 24, 2015
  32. Junio C HamanoJun 24, 2015
  33. 0/5 bisect termsMatthieu Moy, Jun 25, 2015
  34. 1/5 bisect: correction of typoMatthieu Moy, Jun 25, 2015
  35. 2/5 bisect: replace hardcoded "bad|good" by variablesMatthieu Moy, Jun 25, 2015
  36. 3/5 bisect: simplify the addition of new bisect termsMatthieu Moy, Jun 25, 2015
  37. 4/5 bisect: add the terms old/newMatthieu Moy, Jun 25, 2015
  38. Christian CouderJun 26, 2015
  39. Matthieu MoyJun 26, 2015
  40. 5/5 bisect: allow any terms set by userMatthieu Moy, Jun 25, 2015
  41. Junio C HamanoJun 25, 2015
  42. Junio C HamanoJun 25, 2015
  43. Matthieu MoyJun 26, 2015
  44. Junio C HamanoJun 26, 2015
  45. Matthieu MoyJun 26, 2015
  46. Junio C HamanoJun 26, 2015
  47. Matthieu MoyJun 26, 2015
  48. Matthieu MoyJun 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.