]> git.ipfire.org Git - thirdparty/git.git/commit
parse-options: mark unused "opt" parameter in callbacks
authorJeff King <peff@peff.net>
Thu, 31 Aug 2023 21:21:28 +0000 (17:21 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Sep 2023 21:48:17 +0000 (14:48 -0700)
commit34bf44f2d50e835a4824a07c139bdececccf4da1
treeda25bba200bcb5a9ba3918713ac1d7b80b9bbd78
parent66e3309294571ada0e45ea78a2cfb649f08b9dd4
parse-options: mark unused "opt" parameter in callbacks

The previous commit argued that parse-options callbacks should try to
use opt->value rather than touching globals directly. In some cases,
however, that's awkward to do. Some callbacks touch multiple variables,
or may even just call into an abstracted function that does so.

In some of these cases we _could_ convert them by stuffing the multiple
variables into a single struct and passing the struct pointer through
opt->value. But that may make other parts of the code less readable,
as the struct relationship has to be mentioned everywhere.

Let's just accept that these cases are special and leave them as-is. But
we do need to mark their "opt" parameters to satisfy -Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
builtin/log.c
builtin/merge.c
builtin/pack-objects.c
builtin/read-tree.c
builtin/update-index.c