Convert diff opt parser to parse_options()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest76 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/76 | parse-options.h: remove extern on function prototypesparse-options.h | +29 | 0 replies | |
| 2/76 | parse-options: add one-shot modeparse-options.c parse-options.h | +33 | 0 replies | |
| 3/76 | parse-options: allow keep-unknown + stop-at-non-opt combinationparse-options.c | +0 | 1 reply | |
| 4/76 | parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWNparse-options.c t/ | +4 | 0 replies | |
| 5/76 | parse-options: add OPT_BITOP()parse-options.c parse-options.h | +12 | 0 replies | |
| 6/76 | parse-options: stop abusing 'callback' for lowlevel callbacksbuiltin/ builtin/ builtin/ +3 more | +32 | 0 replies | |
| 7/76 | parse-options: avoid magic return codesbuiltin/ builtin/ parse-options-cb.c +2 more | +68 | 0 replies | |
| 8/76 | parse-options: allow ll_callback with OPTION_CALLBACKbuiltin/ builtin/ parse-options-cb.c +2 more | +51 | 0 replies | |
| 9/76 | diff.h: keep forward struct declarations sorteddiff.h | +6 | 0 replies | |
| 10/76 | diff.h: avoid bit fields in struct diff_flagsdiff.h | +33 | 0 replies | |
| 11/76 | diff.c: prepare to use parse_options() for parsingdiff.c diff.h | +29 | 0 replies | |
| 12/76 | diff.c: convert -u|-p|--patchdiff.c | +8 | 0 replies | |
| 13/76 | diff.c: convert -U|--unifiedDocumentation/ diff.c parse-options.h | +24 | 0 replies | |
| 14/76 | diff.c: convert -W|--[no-]function-contextdiff.c | +2 | 0 replies | |
| 15/76 | diff.c: convert --rawdiff.c | +4 | 0 replies | |
| 16/76 | diff.c: convert --patch-with-rawdiff.c | +5 | 0 replies | |
| 17/76 | diff.c: convert --numstat and --shortstatdiff.c | +7 | 0 replies | |
| 18/76 | diff.c: convert --dirstat and friendsDocumentation/ diff.c | +36 | 0 replies | |
| 19/76 | diff.c: convert --checkdiff.c | +4 | 0 replies | |
| 20/76 | diff.c: convert --summarydiff.c | +4 | 0 replies | |
| 21/76 | diff.c: convert --patch-with-statdiff.c | +5 | 0 replies | |
| 22/76 | diff.c: convert --name-onlydiff.c | +4 | 0 replies | |
| 23/76 | diff.c: convert --name-statusdiff.c | +4 | 0 replies | |
| 24/76 | diff.c: convert -s|--no-patchdiff.c | +4 | 0 replies | |
| 25/76 | diff.c: convert --stat*diff.c | +52 | 1 reply | |
| 26/76 | diff.c: convert --[no-]compact-summarydiff.c | +19 | 0 replies | |
| 27/76 | diff.c: convert --output-*Documentation/ diff.c | +63 | 0 replies | |
| 28/76 | diff.c: convert -B|--break-rewritesdiff.c | +37 | 1 reply | |
| 29/76 | diff.c: convert -M|--find-renamesdiff.c | +23 | 0 replies | |
| 30/76 | diff.c: convert -D|--irreversible-deletediff.c | +4 | 0 replies | |
| 31/76 | diff.c: convert -C|--find-copiesdiff.c | +25 | 0 replies | |
| 32/76 | diff.c: convert --find-copies-harderdiff.c | +2 | 0 replies | |
| 33/76 | diff.c: convert --no-renames|--[no--rename-emptyDocumentation/ diff.c | +9 | 0 replies | |
| 34/76 | diff.c: convert --relativediff.c | +17 | 0 replies | |
| 35/76 | diff.c: convert --[no-]minimaldiff.c | +6 | 0 replies | |
| 36/76 | diff.c: convert --ignore-some-changesdiff.c | +16 | 0 replies | |
| 37/76 | diff.c: convert --[no-]indent-heuristicdiff.c | +4 | 0 replies | |
| 38/76 | diff.c: convert --patiencediff.c | +25 | 0 replies | |
| 39/76 | diff.c: convert --histogramdiff.c | +4 | 0 replies | |
| 40/76 | diff.c: convert --diff-algorithmdiff.c | +22 | 0 replies | |
| 41/76 | diff.c: convert --anchoreddiff.c | +17 | 0 replies | |
| 42/76 | diff.c: convert --binaryDocumentation/ diff.c | +17 | 0 replies | |
| 43/76 | diff.c: convert --full-indexdiff.c | +3 | 0 replies | |
| 44/76 | diff.c: convert -a|--textdiff.c | +3 | 0 replies | |
| 45/76 | diff.c: convert -Rdiff.c | +3 | 0 replies | |
| 46/76 | diff.c: convert --[no-]followdiff.c | +19 | 0 replies | |
| 47/76 | diff.c: convert --[no-]colordiff.c | +3 | 0 replies | |
| 48/76 | diff.c: convert --word-diffdiff.c | +29 | 0 replies | |
| 49/76 | diff.c: convert --word-diff-regexdiff.c | +15 | 0 replies | |
| 50/76 | diff.c: convert --color-wordsdiff.c | +16 | 0 replies | |
| 51/76 | diff.c: convert --exit-codediff.c | +3 | 0 replies | |
| 52/76 | diff.c: convert --quietdiff.c | +3 | 0 replies | |
| 53/76 | diff.c: convert --ext-diffdiff.c | +3 | 0 replies | |
| 54/76 | diff.c: convert --textconvdiff.c | +19 | 0 replies | |
| 55/76 | diff.c: convert --ignore-submodulesdiff.c | +17 | 0 replies | |
| 56/76 | diff.c: convert --submodulediff.c | +19 | 0 replies | |
| 57/76 | diff.c: convert --ws-error-highlightdiff.c | +12 | 0 replies | |
| 58/76 | diff.c: convert --ita-[in]visible-in-indexdiff.c | +7 | 0 replies | |
| 59/76 | diff.c: convert -zdiff.c | +3 | 0 replies | |
| 60/76 | diff.c: convert -ldiff.c | +2 | 0 replies | |
| 61/76 | diff.c: convert -S|-Gdiff.c | +28 | 0 replies | |
| 62/76 | diff.c: convert --pickaxe-all|--pickaxe-regexdiff.c | +6 | 0 replies | |
| 63/76 | diff.c: convert -Odiff.c | +3 | 1 reply | |
| 64/76 | diff.c: convert --find-objectdiff.c | +9 | 0 replies | |
| 65/76 | diff.c: convert --diff-filterdiff.c | +9 | 0 replies | |
| 66/76 | diff.c: convert --[no-]abbrevdiff.c parse-options-cb.c | +3 | 0 replies | |
| 67/76 | diff.c: convert --[src|dst]-prefixdiff.c parse-options.h | +8 | 0 replies | |
| 68/76 | diff.c: convert --line-prefixdiff.c | +15 | 0 replies | |
| 69/76 | diff.c: convert --no-prefixdiff.c | +15 | 0 replies | |
| 70/76 | diff.c: convert --inter-hunk-contextdiff.c parse-options.h | +5 | 1 reply | |
| 71/76 | diff.c: convert --color-moveddiff.c | +25 | 0 replies | |
| 72/76 | diff.c: convert --color-moved-wsdiff.c | +18 | 0 replies | |
| 73/76 | diff.c: allow --no-color-moved-wsdiff.c | +6 | 0 replies | |
| 74/76 | range-diff: use parse_options() instead of diff_opt_parse()builtin/ | +6 | 2 replies | |
| 75/76 | diff --no-index: use parse_options() instead of diff_opt_parse()builtin/ diff-no-index.c diff.h +1 more | +35 | 0 replies | |
| 76/76 | am: avoid diff_opt_parse()builtin/ diff.c diff.h | +10 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/76] Convert diff opt parser to parse_options()
This series converts diff option parsing to using parse-options. There are a couple benefits of using parse-options, including "git <cmd> -h" output, completion and less duplicate work.
This is the first half. The second one would be converting the option parser in revision.c. After that, the end game is, any command can take a 'struct option[]' somewhere from diff/rev code, remove the options they are not interested, then merge with their own options and do parse_options() just once. There will be no separate parse phase for revision/diff anymore.
I sent a sneak peek [1] last year and got two good comments. I take it people at least did not oppose to this. The most interesting parts are at the top and bottom. The middle is just boring conversion, usually one option per patch.
This will conflict with pw/diff-color-moved-ws-fix on 'pu' because that series adds --no-color-moved-ws option. I redid the same thing in 73/76 so that conflict resolution could be simply taking this side of change.
This series is also available for fetching here
https://gitlab.com/pclouds/git/commits/diff-opt-parse-options
[1] http://public-inbox.org/git/[email protected]/
Nguyễn Thái Ngọc Duy (76):
parse-options.h: remove extern on function prototypes
parse-options: add one-shot mode
parse-options: allow keep-unknown + stop-at-non-opt combination
parse-options: disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN
parse-options: add OPT_BITOP()
parse-options: stop abusing 'callback' for lowlevel callbacks
parse-options: avoid magic return codes
parse-options: allow ll_callback with OPTION_CALLBACK diff.h: keep forward struct declarations sorted
diff.h: avoid bit fields in struct diff_flags
diff.c: prepare to use parse_options() for parsing
diff.c: convert -u|-p|--patch diff.c: convert -U|--unified diff.c: convert -W|--[no-]function-context diff.c: convert --raw diff.c: convert --patch-with-raw diff.c: convert --numstat and --shortstat diff.c: convert --dirstat and friends diff.c: convert --check diff.c: convert --summary diff.c: convert --patch-with-stat diff.c: convert --name-only diff.c: convert --name-status diff.c: convert -s|--no-patch diff.c: convert --stat* diff.c: convert --[no-]compact-summary diff.c: convert --output-* diff.c: convert -B|--break-rewrites diff.c: convert -M|--find-renames diff.c: convert -D|--irreversible-delete diff.c: convert -C|--find-copies
diff.c: convert --find-copies-harder
diff.c: convert --no-renames|--[no--rename-empty diff.c: convert --relative
diff.c: convert --[no-]minimal
diff.c: convert --ignore-some-changes
diff.c: convert --[no-]indent-heuristic
diff.c: convert --patience
diff.c: convert --histogram
diff.c: convert --diff-algorithm
diff.c: convert --anchored
diff.c: convert --binary
diff.c: convert --full-index
diff.c: convert -a|--text
diff.c: convert -R
diff.c: convert --[no-]follow
diff.c: convert --[no-]color
diff.c: convert --word-diff
diff.c: convert --word-diff-regex
diff.c: convert --color-words
diff.c: convert --exit-code
diff.c: convert --quiet
diff.c: convert --ext-diff
diff.c: convert --textconv
diff.c: convert --ignore-submodules
diff.c: convert --submodule
diff.c: convert --ws-error-highlight
diff.c: convert --ita-[in]visible-in-index
diff.c: convert -z
diff.c: convert -l
diff.c: convert -S|-G
diff.c: convert --pickaxe-all|--pickaxe-regex
diff.c: convert -O
diff.c: convert --find-object
diff.c: convert --diff-filter
diff.c: convert --[no-]abbrev
diff.c: convert --[src|dst]-prefix
diff.c: convert --line-prefix
diff.c: convert --no-prefix
diff.c: convert --inter-hunk-context
diff.c: convert --color-moved
diff.c: convert --color-moved-ws
diff.c: allow --no-color-moved-ws
range-diff: use parse_options() instead of diff_opt_parse() diff --no-index: use parse_options() instead of diff_opt_parse()
am: avoid diff_opt_parse()
Documentation/diff-options.txt | 24 +- builtin/am.c | 4 +- builtin/blame.c | 2 +- builtin/diff.c | 21 +- builtin/merge.c | 9 +- builtin/range-diff.c | 26 +- builtin/update-index.c | 41 +- diff-no-index.c | 49 +- diff.c | 1136 ++++++++++++++++++++------------ diff.h | 85 +-- parse-options-cb.c | 11 +- parse-options.c | 152 +++-- parse-options.h | 114 ++-- t/t4053-diff-no-index.sh | 3 +- t/t7800-difftool.sh | 4 +- 15 files changed, 1054 insertions(+), 627 deletions(-)
Signature · 1 line
2.20.0.482.g66447595a7