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

[PATCH 2/2] parse-options: remove the unused parse_opt_commits() function

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Mar 2, 2018, 02:56 UTC
Message-ID
<1b5dcc90-896b-9a45-e1eb-c7ee946a2105@ramsayjones.plus.com>

Commit fcfba37337 ('ref-filter: make "--contains <id>" less chatty if <id> is invalid', 2018-02-23), removed the last use of the callback function parse_opt_commits(). Remove this function declaration and definition, since it is now dead code.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
 parse-options-cb.c | 16 ----------------
 parse-options.h    |  1 -
 2 files changed, 17 deletions(-)
diff --git a/parse-options-cb.c b/parse-options-cb.c
index c6679cb2c..c7320a73f 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -78,22 +78,6 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
 	return 0;
 }
 
-int parse_opt_commits(const struct option *opt, const char *arg, int unset)
-{
-	struct object_id oid;
-	struct commit *commit;
-
-	if (!arg)
-		return -1;
-	if (get_oid(arg, &oid))
-		return error("malformed object name %s", arg);
-	commit = lookup_commit_reference(&oid);
-	if (!commit)
-		return error("no such commit %s", arg);
-	commit_list_insert(commit, opt->value);
-	return 0;
-}
-
 int parse_opt_object_name(const struct option *opt, const char *arg, int unset)
 {
 	struct object_id oid;
diff --git a/parse-options.h b/parse-options.h
index 4b4734f2e..2b8378ac1 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -224,7 +224,6 @@ extern int parse_opt_expiry_date_cb(const struct option *, const char *, int);
 extern int parse_opt_color_flag_cb(const struct option *, const char *, int);
 extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
 extern int parse_opt_object_name(const struct option *, const char *, int);
-extern int parse_opt_commits(const struct option *, const char *, int);
 extern int parse_opt_tertiary(const struct option *, const char *, int);
 extern int parse_opt_string_list(const struct option *, const char *, int);
 extern int parse_opt_noop_cb(const struct option *, const char *, int);
-- 
2.16.0
Next: Jonathan Nieder
Message 1 of 2 in “parse-options: remove the unused parse_opt_commits() function”
  1. 2/2 parse-options: remove the unused parse_opt_commits() functionRamsay Jones, Mar 2, 2018
  2. Jonathan NiederMar 2, 2018

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.