MCPcopy Index your code
hub / github.com/git/git / add_diff_options

Function add_diff_options

diff.c:6038–6322  ·  view source on GitHub ↗

* Consider adding new flags to __git_diff_common_options * in contrib/completion/git-completion.bash */

Source from the content-addressed store, hash-verified

6036 * in contrib/completion/git-completion.bash
6037 */
6038struct option *add_diff_options(const struct option *opts,
6039 struct diff_options *options)
6040{
6041 struct option parseopts[] = {
6042 OPT_GROUP(N_("Diff output format options")),
6043 OPT_BITOP('p', "patch", &options->output_format,
6044 N_("generate patch"),
6045 DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
6046 OPT_SET_INT('s', "no-patch", &options->output_format,
6047 N_("suppress diff output"), DIFF_FORMAT_NO_OUTPUT),
6048 OPT_BITOP('u', NULL, &options->output_format,
6049 N_("generate patch"),
6050 DIFF_FORMAT_PATCH, DIFF_FORMAT_NO_OUTPUT),
6051 OPT_CALLBACK_F('U', "unified", options, N_("<n>"),
6052 N_("generate diffs with <n> lines context"),
6053 PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_unified),
6054 OPT_BOOL('W', "function-context", &options->flags.funccontext,
6055 N_("generate diffs with <n> lines context")),
6056 OPT_BITOP(0, "raw", &options->output_format,
6057 N_("generate the diff in raw format"),
6058 DIFF_FORMAT_RAW, DIFF_FORMAT_NO_OUTPUT),
6059 OPT_BITOP(0, "patch-with-raw", &options->output_format,
6060 N_("synonym for '-p --raw'"),
6061 DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW,
6062 DIFF_FORMAT_NO_OUTPUT),
6063 OPT_BITOP(0, "patch-with-stat", &options->output_format,
6064 N_("synonym for '-p --stat'"),
6065 DIFF_FORMAT_PATCH | DIFF_FORMAT_DIFFSTAT,
6066 DIFF_FORMAT_NO_OUTPUT),
6067 OPT_BITOP(0, "numstat", &options->output_format,
6068 N_("machine friendly --stat"),
6069 DIFF_FORMAT_NUMSTAT, DIFF_FORMAT_NO_OUTPUT),
6070 OPT_BITOP(0, "shortstat", &options->output_format,
6071 N_("output only the last line of --stat"),
6072 DIFF_FORMAT_SHORTSTAT, DIFF_FORMAT_NO_OUTPUT),
6073 OPT_CALLBACK_F('X', "dirstat", options, N_("<param1>,<param2>..."),
6074 N_("output the distribution of relative amount of changes for each sub-directory"),
6075 PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
6076 diff_opt_dirstat),
6077 OPT_CALLBACK_F(0, "cumulative", options, NULL,
6078 N_("synonym for --dirstat=cumulative"),
6079 PARSE_OPT_NONEG | PARSE_OPT_NOARG,
6080 diff_opt_dirstat),
6081 OPT_CALLBACK_F(0, "dirstat-by-file", options, N_("<param1>,<param2>..."),
6082 N_("synonym for --dirstat=files,<param1>,<param2>..."),
6083 PARSE_OPT_NONEG | PARSE_OPT_OPTARG,
6084 diff_opt_dirstat),
6085 OPT_BIT_F(0, "check", &options->output_format,
6086 N_("warn if changes introduce conflict markers or whitespace errors"),
6087 DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG),
6088 OPT_BITOP(0, "summary", &options->output_format,
6089 N_("condensed summary such as creations, renames and mode changes"),
6090 DIFF_FORMAT_SUMMARY, DIFF_FORMAT_NO_OUTPUT),
6091 OPT_BIT_F(0, "name-only", &options->output_format,
6092 N_("show only names of changed files"),
6093 DIFF_FORMAT_NAME, PARSE_OPT_NONEG),
6094 OPT_BIT_F(0, "name-status", &options->output_format,
6095 N_("show only names and status of changed files"),

Callers 4

diff_no_indexFunction · 0.85
diff_opt_parseFunction · 0.85
cmd_range_diffFunction · 0.85
cmd_diff_pairsFunction · 0.85

Calls 1

parse_options_concatFunction · 0.85

Tested by

no test coverage detected