]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/parse-options-integers'
authorJunio C Hamano <gitster@pobox.com>
Fri, 25 Apr 2025 00:25:33 +0000 (17:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Apr 2025 00:25:34 +0000 (17:25 -0700)
Update parse-options API to catch mistakes to pass address of an
integral variable of a wrong type/size.

* ps/parse-options-integers:
  parse-options: detect mismatches in integer signedness
  parse-options: introduce precision handling for `OPTION_UNSIGNED`
  parse-options: introduce precision handling for `OPTION_INTEGER`
  parse-options: rename `OPT_MAGNITUDE()` to `OPT_UNSIGNED()`
  parse-options: support unit factors in `OPT_INTEGER()`
  global: use designated initializers for options
  parse: fix off-by-one for minimum signed values

20 files changed:
1  2 
apply.c
archive.c
builtin/backfill.c
builtin/clone.c
builtin/commit-tree.c
builtin/describe.c
builtin/fetch.c
builtin/gc.c
builtin/grep.c
builtin/init-db.c
builtin/merge.c
builtin/multi-pack-index.c
builtin/pack-objects.c
builtin/rebase.c
builtin/repack.c
builtin/revert.c
builtin/tag.c
builtin/update-index.c
diff.c
git-compat-util.h

diff --cc apply.c
Simple merge
diff --cc archive.c
Simple merge
Simple merge
diff --cc builtin/clone.c
Simple merge
Simple merge
Simple merge
diff --cc builtin/fetch.c
Simple merge
diff --cc builtin/gc.c
Simple merge
diff --cc builtin/grep.c
Simple merge
Simple merge
diff --cc builtin/merge.c
Simple merge
Simple merge
Simple merge
Simple merge
index 1fd2874324aa8a4ef9c7e81104a0ff840c658f3c,8bf9941b2c2ad8d7a180d07e6a7d1d1694e5e594..59214dbdfdfcd537f017e130f5ec38211797e7e6
@@@ -1171,11 -1202,8 +1171,11 @@@ int cmd_repack(int argc
                                   PACK_CRUFT),
                OPT_STRING(0, "cruft-expiration", &cruft_expiration, N_("approxidate"),
                                N_("with --cruft, expire objects older than this")),
-               OPT_MAGNITUDE(0, "combine-cruft-below-size",
-                             &combine_cruft_below_size,
-                             N_("with --cruft, only repack cruft packs smaller than this")),
-               OPT_MAGNITUDE(0, "max-cruft-size", &cruft_po_args.max_pack_size,
-                               N_("with --cruft, limit the size of new cruft packs")),
++              OPT_UNSIGNED(0, "combine-cruft-below-size",
++                           &combine_cruft_below_size,
++                           N_("with --cruft, only repack cruft packs smaller than this")),
+               OPT_UNSIGNED(0, "max-cruft-size", &cruft_po_args.max_pack_size,
+                            N_("with --cruft, limit the size of new cruft packs")),
                OPT_BOOL('d', NULL, &delete_redundant,
                                N_("remove redundant packs, and run git-prune-packed")),
                OPT_BOOL('f', NULL, &po_args.no_reuse_delta,
Simple merge
diff --cc builtin/tag.c
Simple merge
Simple merge
diff --cc diff.c
Simple merge
Simple merge