From 126fd00c30f3866657396f2174fbebe0f24b418f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Aug 2016 14:03:50 +0200 Subject: [PATCH] cat-file: reintroduce deprecated --smudge and --use-path options For backwards compatibility with Git for Windows v2.9.3, we need to support the --smudge and --use-path options (the options are now called --filters and --path). Let's do that, but print out a honking warning that these options are deprecated. The plan is to drop them in v2.10.0 anyway. Signed-off-by: Johannes Schindelin --- builtin/cat-file.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/builtin/cat-file.c b/builtin/cat-file.c index f8a3a081ee..a4cc57e2a3 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -547,7 +547,7 @@ static int batch_option_callback(const struct option *opt, int cmd_cat_file(int argc, const char **argv, const char *prefix) { int opt = 0; - const char *exp_type = NULL, *obj_name = NULL; + const char *exp_type = NULL, *obj_name = NULL, *force_use_path = NULL; struct batch_options batch = {0}; int unknown_type = 0; @@ -564,6 +564,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix) N_("for blob objects, run filters on object's content"), 'w'), OPT_STRING(0, "path", &force_path, N_("blob"), N_("use a specific path for --textconv/--filters")), + OPT_CMDMODE(0, "smudge", &opt, + N_("deprecated, use --filters instead"), 'W'), + OPT_STRING(0, "use-path", &force_use_path, N_("blob"), + N_("deprecated, use --path= instead")), OPT_BOOL(0, "allow-unknown-type", &unknown_type, N_("allow -s and -t to work with broken/corrupt objects")), OPT_BOOL(0, "buffer", &batch.buffer_output, N_("buffer --batch output")), @@ -585,6 +589,16 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix) batch.buffer_output = -1; argc = parse_options(argc, argv, prefix, options, cat_file_usage, 0); + if (opt == 'W') { + warning("--smudge is deprecated, please use --filters instead"); + opt = 'w'; + } + if (force_use_path) { + warning("--use-path= is deprecated, please use " + "--path= instead"); + force_path = force_use_path; + } + if (opt) { if (batch.enabled && (opt == 'c' || opt == 'w')) batch.cmdmode = opt;