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

[PATCH 2/2] bisect--helper: `bisect_voc` shell function in C

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
May 13, 2016, 20:02 UTC
Message-ID
<1463169737-12701-2-git-send-email-pranit.bauva@gmail.com>
In-Reply-To
<1463169737-12701-1-git-send-email-pranit.bauva@gmail.com>

Reimplement the `bisect_voc` shell function in C. This is a too small function to be called as a subcommand though the working of this function has been tested by calling it as a subcommand.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>

--- The PR for testing of this function by the subcommand approach can be found at: https://github.com/pranitbauva1997/git/pull/5

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
 builtin/bisect--helper.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 87764fe..455f1cb 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -94,6 +94,16 @@ int bisect_log(void)
 	return 0;
 }
 
+int bisect_voc(const char *term)
+{
+	if (!strcmp(term, "bad"))
+		printf("bad|new\n");
+	if (!strcmp(term, "good"))
+		printf("good|old\n");
+
+	return 0;
+}
+
 int cmd_bisect__helper(int argc, const char **argv, const char *prefix)
 {
 	enum {
-- 
2.8.2
Previous: Pranit BauvaNext: Pranit Bauva
Message 2 of 10 in “bisect--helper: `bisect_log` shell function in C”
  1. 1/2 bisect--helper: `bisect_log` shell function in CPranit Bauva, May 13, 2016
  2. 2/2 bisect--helper: `bisect_voc` shell function in CPranit Bauva, May 13, 2016
  3. Pranit BauvaMay 13, 2016
  4. Johannes SchindelinMay 16, 2016
  5. Pranit BauvaMay 20, 2016
  6. Pranit BauvaMay 22, 2016
  7. Johannes SchindelinMay 23, 2016
  8. Matthieu MoyMay 16, 2016
  9. Eric SunshineMay 16, 2016
  10. Pranit BauvaMay 20, 2016

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.