Hi, this patch series addresses the issues raised in [1] and [2]. As discussed in [1], the series also introduces a couple of safeguards to make it harder to misuse `OPT_INTEGER()` and `OPT_MAGNITUDE()`: - We now track the precision of the underlying integer types. This makes it possible to pass arbitrarily-sized integers to those options, not only `int` and `unsigned long`, respectively. - We introduce a build assert to verify that the passed variable has correct signedness. Furthermore, the series introduces `OPT_UNSIGNED()` to adapt all callsites that previously used variables with the wrong signedness. Thanks! Patrick [1]: <89257ab82cd60d135cce02d51eacee7ec35c1c37.camel@xxxxxxxxxxxxxxxxxxx> [2]: <Z8HW6petWuMRWSXf@xxxxxxxxxxxxxxx> --- Patrick Steinhardt (5): global: use designated initializers for options parse-options: introduce precision handling for `OPTION_INTEGER` parse-options: introduce precision handling for `OPTION_MAGNITUDE` parse-options: introduce `OPTION_UNSIGNED` parse-options: detect mismatches in integer signedness apply.c | 4 +- archive.c | 35 +++++++--- builtin/am.c | 28 +++++--- builtin/backfill.c | 4 +- builtin/clone.c | 13 +++- builtin/column.c | 2 +- builtin/commit-tree.c | 12 +++- builtin/commit.c | 62 ++++++++++++++---- builtin/config.c | 13 +++- builtin/describe.c | 24 +++++-- builtin/fetch.c | 10 ++- builtin/fmt-merge-msg.c | 27 ++++++-- builtin/gc.c | 12 +++- builtin/grep.c | 18 ++++-- builtin/init-db.c | 13 ++-- builtin/ls-remote.c | 11 +++- builtin/merge.c | 38 ++++++++--- builtin/read-tree.c | 11 +++- builtin/rebase.c | 25 ++++++-- builtin/revert.c | 12 +++- builtin/show-branch.c | 13 +++- builtin/tag.c | 24 +++++-- builtin/update-index.c | 131 ++++++++++++++++++++++++++------------ builtin/write-tree.c | 12 ++-- diff.c | 13 ++-- git-compat-util.h | 7 ++ parse-options.c | 145 ++++++++++++++++++++++++++++++++++++------ parse-options.h | 23 ++++++- ref-filter.h | 15 +++-- t/helper/test-parse-options.c | 46 +++++++++++--- t/t0040-parse-options.sh | 57 ++++++++++++++++- 31 files changed, 671 insertions(+), 189 deletions(-) --- base-commit: 5b97a56fa0e7d580dc8865b73107407c9b3f0eff change-id: 20250401-b4-pks-parse-options-integers-9b4bbcf21011