All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 5/7] bisect: change read_bisect_terms parameters
@ 2015-06-10 19:01 Antoine Delaite
  2015-06-10 19:01 ` [PATCH v2 6/7] revision: fix rev-list --bisect in old/new mode Antoine Delaite
  2015-06-10 19:01 ` [PATCH v2 7/7] bisect: allows any terms set by user Antoine Delaite
  0 siblings, 2 replies; 23+ messages in thread
From: Antoine Delaite @ 2015-06-10 19:01 UTC (permalink / raw)
  To: git
  Cc: remi.lespinet, louis--alexandre.stuber, remi.galan-alfonso,
	guillaume.pages, antoine.delaite, Matthieu.Moy, chriscool,
	thomasxnguy, valentinduperray, Louis Stuber

From: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>

The function reads BISECT_TERMS and stores it at the adress given in
parameters (instead of global variables name_bad and name_good).

This allows to use the function outside bisect.c.

Signed-off-by: Antoine Delaite <antoine.delaite@ensimag.grenoble-inp.fr>
Signed-off-by: Louis Stuber <stuberl@ensimag.grenoble-inp.fr>
---
 bisect.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/bisect.c b/bisect.c
index eaa85b6..7afd335 100644
--- a/bisect.c
+++ b/bisect.c
@@ -908,12 +908,11 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
 }
 
 /*
- * The terms used for this bisect session are stored in
- * BISECT_TERMS: it can be bad/good or new/old.
- * We read them and store them to adapt the messages
- * accordingly. Default is bad/good.
+ * The terms used for this bisect session are stored in BISECT_TERMS.
+ * We read them and store them to adapt the messages accordingly.
+ * Default is bad/good.
  */
-void read_bisect_terms(void)
+void read_bisect_terms(const char **read_bad, const char **read_good)
 {
 	struct strbuf str = STRBUF_INIT;
 	const char *filename = git_path("BISECT_TERMS");
@@ -924,9 +923,9 @@ void read_bisect_terms(void)
 			strerror(errno));
 	} else {
 		strbuf_getline(&str, fp, '\n');
-		name_bad = strbuf_detach(&str, NULL);
+		*read_bad = strbuf_detach(&str, NULL);
 		strbuf_getline(&str, fp, '\n');
-		name_good = strbuf_detach(&str, NULL);
+		*read_good = strbuf_detach(&str, NULL);
 	}
 	strbuf_release(&str);
 	fclose(fp);
@@ -948,7 +947,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
 	const unsigned char *bisect_rev;
 	char bisect_rev_hex[GIT_SHA1_HEXSZ + 1];
 
-	read_bisect_terms();
+	read_bisect_terms(&name_bad, &name_good);
 	if (read_bisect_refs())
 		die("reading bisect refs failed");
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-06-17  8:18 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 19:01 [PATCH v2 5/7] bisect: change read_bisect_terms parameters Antoine Delaite
2015-06-10 19:01 ` [PATCH v2 6/7] revision: fix rev-list --bisect in old/new mode Antoine Delaite
2015-06-10 19:01 ` [PATCH v2 7/7] bisect: allows any terms set by user Antoine Delaite
2015-06-10 21:16   ` Junio C Hamano
2015-06-10 22:19     ` Junio C Hamano
2015-06-11  9:42       ` Matthieu Moy
2015-06-11 14:57         ` Junio C Hamano
2015-06-11  9:22     ` Matthieu Moy
2015-06-11 15:03       ` Junio C Hamano
2015-06-11 15:28   ` Matthieu Moy
2015-06-14 12:39     ` Louis-Alexandre Stuber
2015-06-14 19:30       ` Antoine Delaite
2015-06-15  8:37         ` Matthieu Moy
2015-06-15 16:08           ` Junio C Hamano
2015-06-16 21:18           ` Antoine Delaite
2015-06-17  7:05             ` Matthieu Moy
2015-06-17  8:01               ` Antoine Delaite
2015-06-17  8:18                 ` Matthieu Moy
2015-06-14 19:40     ` Antoine Delaite
2015-06-14 20:05       ` Antoine Delaite
2015-06-15  8:56         ` Matthieu Moy
2015-06-15  8:52       ` Matthieu Moy
2015-06-16 21:07         ` Antoine Delaite

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.