Skip to content

"final" batch of unused parameter cleanups

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14cmd_{read,write}_tree: rename "unused" variable that is usedbuiltin/read-tree.c builtin/write-tree.c+8 -82 replies
2/14submodule: drop unused prefix parameter from some functionsbuiltin/rm.c builtin/submodule--helper.c submodule.c +1 more+9 -130 replies
3/14builtin: consistently pass cmd_* prefix to parse_optionsbuiltin/column.c builtin/hash-object.c builtin/range-diff.c +2 more+5 -51 reply
4/14clone: drop dest parameter from copy_alternates()builtin/clone.c+2 -30 replies
5/14read-cache: drop unused parameter from threaded loadread-cache.c+2 -20 replies
6/14wt-status: drop unused status parameterwt-status.c+2 -40 replies
7/14mktree: drop unused length parameterbuiltin/mktree.c+2 -20 replies
8/14name-rev: drop unused parameters from is_better_name()builtin/name-rev.c+1 -40 replies
9/14pack-objects: drop unused rev_info parametersbuiltin/pack-objects.c+4 -40 replies
10/14receive-pack: drop unused "commands" from prepare_shallow_update()builtin/receive-pack.c+2 -30 replies
11/14remove_all_fetch_refspecs(): drop unused "remote" parameterbuiltin/remote.c+2 -20 replies
12/14rev-list: drop unused void pointer from finish_commit()builtin/rev-list.c+5 -50 replies
13/14show-branch: drop unused parameter from show_independent()builtin/show-branch.c+1 -20 replies
14/14verify-commit: simplify parameters to run_gpg_verify()builtin/verify-commit.c+8 -151 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/14] "final" batch of unused parameter cleanups

This is a continuation of my efforts to get us compiling with -Wunused-parameter. This round finishes most of the cleanups and fixes I intend to do (though I have a handful of cleanup cases that I'm still poking at to make sure they're not in fact bugs). After that, I have some patches to annotate unused parameters we can't get rid of (e.g., for cases where we're conforming to a callback interface), and then we can finally flip the warning on for developer-mode.

This series has two small conflicts with what's in "pu":

- there's a minor textual conflict in upload-pack

- it changes cmd_rebase__interactive(), which moved into builtin/rebase.c in pw/rebase-i-internal. Because the old file went away, this results in a delete/modified conflict, and you have to manually fix up the result, like so:

builtin/rebase--interactive.c deleted +0 -0
deleted file mode 100644
index 72fd4b53a8..0000000000
builtin/rebase.c +1 -1
index 8c2cbc72f6..cc1e1a997d 100644
@@ -508,7 +508,7 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
 	if (argc == 1)
 		usage_with_options(builtin_rebase_interactive_usage, options);
 
-	argc = parse_options(argc, argv, NULL, options,
+	argc = parse_options(argc, argv, prefix, options,
 			builtin_rebase_interactive_usage, PARSE_OPT_KEEP_ARGV0);
 
 	if (!is_null_oid(&squash_onto))

Most of the patches are pretty straightforward and won't have any behavior change (the thing to review in them is confirming that not using the parameter is the right thing to do; I've tried to make a case for each in the commit message). The trickiest one is patch 14.

[01/14]: cmd_{read,write}_tree: rename "unused" variable that is used [02/14]: submodule: drop unused prefix parameter from some functions [03/14]: builtin: consistently pass cmd_* prefix to parse_options [04/14]: clone: drop dest parameter from copy_alternates() [05/14]: read-cache: drop unused parameter from threaded load [06/14]: wt-status: drop unused status parameter
[07/14]: mktree: drop unused length parameter
[08/14]: name-rev: drop unused parameters from is_better_name() [09/14]: pack-objects: drop unused rev_info parameters
[10/14]: receive-pack: drop unused "commands" from prepare_shallow_update() [11/14]: remove_all_fetch_refspecs(): drop unused "remote" parameter [12/14]: rev-list: drop unused void pointer from finish_commit() [13/14]: show-branch: drop unused parameter from show_independent() [14/14]: verify-commit: simplify parameters to run_gpg_verify()

 builtin/clone.c               |  5 ++---
 builtin/column.c              |  2 +-
 builtin/hash-object.c         |  2 +-
 builtin/mktree.c              |  4 ++--
 builtin/name-rev.c            |  5 +----
 builtin/pack-objects.c        |  8 ++++----
 builtin/range-diff.c          |  2 +-
 builtin/read-tree.c           |  4 ++--
 builtin/rebase--interactive.c |  2 +-
 builtin/receive-pack.c        |  5 ++---
 builtin/remote.c              |  4 ++--
 builtin/rev-list.c            | 10 +++++-----
 builtin/rm.c                  |  6 +++---
 builtin/show-branch.c         |  3 +--
 builtin/submodule--helper.c   |  3 +--
 builtin/upload-pack.c         |  2 +-
 builtin/verify-commit.c       | 23 ++++++++---------------
 builtin/write-tree.c          | 12 ++++++------
 read-cache.c                  |  4 ++--
 submodule.c                   | 10 ++++------
 submodule.h                   |  3 +--
 wt-status.c                   |  6 ++----
 22 files changed, 53 insertions(+), 72 deletions(-)