git/builtin
Ævar Arnfjörð Bjarmason 352e761388 parse-options.[ch]: consistently use "enum parse_opt_result"
Use the "enum parse_opt_result" instead of an "int flags" as the
return value of the applicable functions in parse-options.c.

This will help catch future bugs, such as the missing "case" arms in
the two existing users of the API in "blame.c" and "shortlog.c". A
third caller in 309be813c9 (update-index: migrate to parse-options
API, 2010-12-01) was already checking for these.

As can be seen when trying to sort through the deluge of warnings
produced when compiling this with CC=g++ (mostly unrelated to this
change) we're not consistently using "enum parse_opt_result" even now,
i.e. we'll return error() and "return 0;". See f41179f16b
(parse-options: avoid magic return codes, 2019-01-27) for a commit
which started changing some of that.

I'm not doing any more of that exhaustive migration here, and it's
probably not worthwhile past the point of being able to check "enum
parse_opt_result" in switch().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-10-08 14:13:11 -07:00
..
add.c Merge branch 'ds/sparse-index-ignored-files' 2021-09-20 15:20:44 -07:00
am.c Merge branch 'en/am-abort-fix' 2021-09-23 13:44:45 -07:00
annotate.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
apply.c
archive.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
bisect--helper.c bisect--helper: retire --bisect-next-check subcommand 2021-09-13 13:37:39 -07:00
blame.c parse-options.[ch]: consistently use "enum parse_opt_result" 2021-10-08 14:13:11 -07:00
branch.c branch: allow deleting dangling branches with --force 2021-08-27 15:11:18 -07:00
bugreport.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
bundle.c bundle: show progress on "unbundle" 2021-09-07 10:59:23 -07:00
cat-file.c cat-file: merge two block into one 2021-06-04 07:50:26 +09:00
check-attr.c
check-ignore.c dir.[ch]: replace dir_init() with DIR_INIT 2021-07-01 12:32:22 -07:00
check-mailmap.c shortlog: remove unused(?) "repo-abbrev" feature 2021-01-12 14:04:42 -08:00
check-ref-format.c
checkout--worker.c builtin/checkout--worker: zero-initialise struct to avoid MSAN complaints 2021-06-15 12:07:56 +09:00
checkout-index.c Merge branch 'mt/parallel-checkout-part-3' 2021-05-16 21:05:23 +09:00
checkout.c Merge branch 'ab/retire-advice-config' 2021-09-10 11:46:29 -07:00
clean.c dir.[ch]: replace dir_init() with DIR_INIT 2021-07-01 12:32:22 -07:00
clone.c Merge branch 'ar/submodule-add-more' 2021-09-20 15:20:43 -07:00
column.c column: fix parsing of the '--nl' option 2021-08-26 14:36:27 -07:00
commit-graph.c Merge branch 'tb/multi-pack-bitmaps' 2021-09-20 15:20:39 -07:00
commit-tree.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
commit.c Merge branch 'ab/retire-advice-config' 2021-09-10 11:46:29 -07:00
config.c config: unify code paths to get global config paths 2021-04-19 14:16:59 -07:00
count-objects.c
credential-cache--daemon.c unix-socket: add backlog size option to unix_stream_listen() 2021-03-15 14:32:51 -07:00
credential-cache.c credential-cache: check for windows specific errors 2021-09-14 09:30:54 -07:00
credential-store.c Use a better name for the function interpolating paths 2021-07-26 12:17:16 -07:00
credential.c credential: load default config 2020-10-16 12:30:45 -07:00
describe.c hash: provide per-algorithm null OIDs 2021-04-27 16:31:39 +09:00
diff-files.c Merge branch 'jc/diffcore-rotate' 2021-02-25 16:43:30 -08:00
diff-index.c diff-index: restore -c/--cc options handling 2021-09-07 11:11:35 -07:00
diff-tree.c Merge branch 'jc/diffcore-rotate' 2021-02-25 16:43:30 -08:00
diff.c Merge branch 'dl/diff-merge-base' 2021-07-28 13:17:59 -07:00
difftool.c parse-options API: remove OPTION_ARGUMENT feature 2021-09-12 23:27:38 -07:00
env--helper.c assert PARSE_OPT_NONEG in parse-options callbacks 2020-09-30 12:53:47 -07:00
fast-export.c Merge branch 'tk/fast-export-anonymized-tag-fix' 2021-09-10 11:46:27 -07:00
fast-import.c Use the final_oid_fn to finalize hashing of object IDs 2021-04-27 16:31:38 +09:00
fetch-pack.c connect, transport: encapsulate arg in struct 2021-02-05 13:49:54 -08:00
fetch.c Merge branch 'js/run-command-close-packs' 2021-09-20 15:20:45 -07:00
fmt-merge-msg.c Lib-ify fmt-merge-msg 2020-03-24 15:04:43 -07:00
for-each-ref.c Merge branch 'ah/plugleaks' 2021-05-07 12:47:41 +09:00
for-each-repo.c builtin/for-each-repo: remove unnecessary argv copy to plug leak 2021-07-26 12:19:20 -07:00
fsck.c Merge branch 'ab/fsck-api-cleanup' 2021-06-02 07:34:27 +09:00
gc.c Merge branch 'ab/gc-remove-unused-call' 2021-09-23 13:44:46 -07:00
get-tar-commit-id.c
grep.c grep: add repository to OID grep sources 2021-09-08 11:48:05 -07:00
hash-object.c Merge branch 'jc/prefix-filename-allocates' 2021-09-15 13:15:28 -07:00
help.c help: make sure local html page exists before calling external processes 2021-09-14 10:04:08 -07:00
index-pack.c Merge branch 'rs/use-xopen-in-index-pack' 2021-09-23 13:44:50 -07:00
init-db.c Merge branch 'mt/init-template-userpath-fix' 2021-05-25 16:21:20 +09:00
interpret-trailers.c Use OPT_CALLBACK and OPT_CALLBACK_F 2020-04-28 10:47:10 -07:00
log.c revision: separate walk and unsorted flags 2021-08-05 09:37:28 -07:00
ls-files.c dir.[ch]: replace dir_init() with DIR_INIT 2021-07-01 12:32:22 -07:00
ls-remote.c ls-remote: set packet_trace_identity(<name>) 2021-08-24 14:47:07 -07:00
ls-tree.c tree.h API: simplify read_tree_recursive() signature 2021-03-20 16:09:26 -07:00
mailinfo.c mailinfo: allow squelching quoted CRLF warning 2021-05-10 15:06:22 +09:00
mailsplit.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
merge-base.c rebase: --fork-point regression fix 2020-02-11 09:59:39 -08:00
merge-file.c
merge-index.c merge-index: ensure full index 2021-04-14 13:47:21 -07:00
merge-ours.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
merge-recursive.c
merge-tree.c xdiff users: use designated initializers for out_line 2021-05-11 12:47:31 +09:00
merge.c Merge branch 'js/run-command-close-packs' 2021-09-20 15:20:45 -07:00
mktag.c fsck.c: add an fsck_set_msg_type() API that takes enums 2021-03-28 19:03:10 -07:00
mktree.c builtins + test helpers: use return instead of exit() in cmd_* 2021-06-09 09:15:58 +09:00
multi-pack-index.c Merge branch 'tb/multi-pack-bitmaps' 2021-09-20 15:20:39 -07:00
mv.c builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv 2021-07-26 12:19:20 -07:00
name-rev.c oid_pos(): access table through const pointers 2021-01-28 12:03:26 -08:00
notes.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
pack-objects.c Merge branch 'tb/pack-finalize-ordering' 2021-09-20 15:20:42 -07:00
pack-redundant.c builtin/pack-redundant: avoid casting buffers to struct object_id 2021-04-27 16:31:38 +09:00
pack-refs.c
patch-id.c patch-id: use oid_to_hex() to print multiple object IDs 2019-12-09 12:26:40 -08:00
prune-packed.c Lib-ify prune-packed 2020-03-24 15:04:44 -07:00
prune.c Merge branch 'tb/shallow-cleanup' 2020-05-13 12:19:18 -07:00
pull.c Merge branch 'js/run-command-close-packs' 2021-09-20 15:20:45 -07:00
push.c advice: remove read uses of most global advice_ variables 2021-08-25 12:07:52 -07:00
range-diff.c column, range-diff: downcase option description 2021-03-29 14:06:08 -07:00
read-tree.c Use OPT_CALLBACK and OPT_CALLBACK_F 2020-04-28 10:47:10 -07:00
rebase.c Merge branch 'js/run-command-close-packs' 2021-09-20 15:20:45 -07:00
receive-pack.c Merge branch 'js/run-command-close-packs' 2021-09-20 15:20:45 -07:00
reflog.c reflog expire --stale-fix: be generous about missing objects 2021-02-11 09:21:52 -08:00
remote-ext.c strvec: convert builtin/ callers away from argv_array name 2020-07-28 15:02:18 -07:00
remote-fd.c
remote.c Merge branch 'ah/plugleaks' 2021-04-07 16:54:08 -07:00
repack.c Merge branch 'tb/pack-finalize-ordering' 2021-09-20 15:20:42 -07:00
replace.c advice: move advice.graftFileDeprecated squashing to commit.[ch] 2021-08-25 12:07:52 -07:00
rerere.c xdiff users: use designated initializers for out_line 2021-05-11 12:47:31 +09:00
reset.c advice: remove read uses of most global advice_ variables 2021-08-25 12:07:52 -07:00
rev-list.c rev-list: add option for --pretty=format without header 2021-07-12 10:12:31 -07:00
rev-parse.c rev-parse: mark die() messages for translation 2021-05-17 18:39:53 +09:00
revert.c Merge branch 'ds/mergies-with-sparse-index' 2021-09-20 15:20:45 -07:00
rm.c advice: remove read uses of most global advice_ variables 2021-08-25 12:07:52 -07:00
send-pack.c send-pack: fix push.negotiate with remote helper 2021-07-15 11:58:52 -07:00
shortlog.c parse-options.[ch]: consistently use "enum parse_opt_result" 2021-10-08 14:13:11 -07:00
show-branch.c show-branch: simplify rev_is_head() 2021-08-27 14:12:15 -07:00
show-index.c builtin/show-index: set the algorithm for object IDs 2021-04-27 16:31:39 +09:00
show-ref.c refs: switch peel_ref() to peel_iterated_oid() 2021-01-21 15:51:31 -08:00
sparse-checkout.c sparse-checkout: clear tracked sparse dirs 2021-09-07 22:41:10 -07:00
stash.c Merge branch 'ab/struct-init' 2021-07-16 17:42:53 -07:00
stripspace.c
submodule--helper.c Merge branch 'jt/submodule-name-to-gitdir' 2021-09-23 13:44:49 -07:00
symbolic-ref.c symbolic-ref: don't leak shortened refname in check_symref() 2021-03-14 15:57:59 -07:00
tag.c Merge branch 'rs/xopen-reports-open-failures' 2021-09-08 13:30:32 -07:00
unpack-file.c
unpack-objects.c hash: provide per-algorithm null OIDs 2021-04-27 16:31:39 +09:00
update-index.c use xopen() to handle fatal open(2) failures 2021-08-25 14:39:08 -07:00
update-ref.c update-ref: fix streaming of status updates 2021-09-03 11:35:15 -07:00
update-server-info.c
upload-archive.c strvec: rename struct fields 2020-07-30 19:18:06 -07:00
upload-pack.c upload-pack: document and rename --advertise-refs 2021-08-05 08:59:37 -07:00
var.c
verify-commit.c
verify-pack.c Merge branch 'bc/sha-256-part-3' 2020-08-11 18:04:11 -07:00
verify-tag.c
worktree.c worktree: teach add to accept --reason <string> with --lock 2021-07-15 13:30:59 -07:00
write-tree.c