summaryrefslogtreecommitdiff
path: root/builtin/rebase.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-24 17:25:33 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-24 17:25:34 -0700
commit2bc5414c411aab33c155b1070b7764ef6a49a02d (patch)
tree3f2b065f7c9c54838ab380ba5d16e7a9f742344b /builtin/rebase.c
parent68e5342e191a2de216dbf712a6dbfa49282429c4 (diff)
parent791aeddfa2fdb9e830e24c50c97bb5e8bf3613e6 (diff)
Merge branch 'ps/parse-options-integers'
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
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 36e336009c..2e8c4ee678 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1123,9 +1123,15 @@ int cmd_rebase(int argc,
OPT_BIT('v', "verbose", &options.flags,
N_("display a diffstat of what changed upstream"),
REBASE_NO_QUIET | REBASE_VERBOSE | REBASE_DIFFSTAT),
- {OPTION_NEGBIT, 'n', "no-stat", &options.flags, NULL,
- N_("do not show diffstat of what changed upstream"),
- PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
+ {
+ .type = OPTION_NEGBIT,
+ .short_name = 'n',
+ .long_name = "no-stat",
+ .value = &options.flags,
+ .help = N_("do not show diffstat of what changed upstream"),
+ .flags = PARSE_OPT_NOARG,
+ .defval = REBASE_DIFFSTAT,
+ },
OPT_BOOL(0, "signoff", &options.signoff,
N_("add a Signed-off-by trailer to each commit")),
OPT_BOOL(0, "committer-date-is-author-date",
@@ -1191,9 +1197,16 @@ int cmd_rebase(int argc,
OPT_BOOL(0, "update-refs", &options.update_refs,
N_("update branches that point to commits "
"that are being rebased")),
- { OPTION_STRING, 'S', "gpg-sign", &gpg_sign, N_("key-id"),
- N_("GPG-sign commits"),
- PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
+ {
+ .type = OPTION_STRING,
+ .short_name = 'S',
+ .long_name = "gpg-sign",
+ .value = &gpg_sign,
+ .argh = N_("key-id"),
+ .help = N_("GPG-sign commits"),
+ .flags = PARSE_OPT_OPTARG,
+ .defval = (intptr_t) "",
+ },
OPT_AUTOSTASH(&options.autostash),
OPT_STRING_LIST('x', "exec", &options.exec, N_("exec"),
N_("add exec lines after each commit of the "