git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 2/2] parse-options: remove the unused parse_opt_commits() function
@ 2018-03-02  2:56 Ramsay Jones
  2018-03-02  4:00 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2018-03-02  2:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: ungureanupaulsebastian, GIT Mailing-list


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

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

* Re: [PATCH 2/2] parse-options: remove the unused parse_opt_commits() function
  2018-03-02  2:56 [PATCH 2/2] parse-options: remove the unused parse_opt_commits() function Ramsay Jones
@ 2018-03-02  4:00 ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2018-03-02  4:00 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, ungureanupaulsebastian, GIT Mailing-list

Ramsay Jones wrote:

> 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(-)

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.

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

end of thread, other threads:[~2018-03-02  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02  2:56 [PATCH 2/2] parse-options: remove the unused parse_opt_commits() function Ramsay Jones
2018-03-02  4:00 ` Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).