Skip to content

Commit aa55647

Browse files
committed
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 <[email protected]>
1 parent d0bcc2e commit aa55647

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

builtin/cat-file.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static int batch_option_callback(const struct option *opt,
547547
int cmd_cat_file(int argc, const char **argv, const char *prefix)
548548
{
549549
int opt = 0;
550-
const char *exp_type = NULL, *obj_name = NULL;
550+
const char *exp_type = NULL, *obj_name = NULL, *force_use_path = NULL;
551551
struct batch_options batch = {0};
552552
int unknown_type = 0;
553553

@@ -564,6 +564,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
564564
N_("for blob objects, run filters on object's content"), 'w'),
565565
OPT_STRING(0, "path", &force_path, N_("blob"),
566566
N_("use a specific path for --textconv/--filters")),
567+
OPT_CMDMODE(0, "smudge", &opt,
568+
N_("deprecated, use --filters instead"), 'W'),
569+
OPT_STRING(0, "use-path", &force_use_path, N_("blob"),
570+
N_("deprecated, use --path=<path> instead")),
567571
OPT_BOOL(0, "allow-unknown-type", &unknown_type,
568572
N_("allow -s and -t to work with broken/corrupt objects")),
569573
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)
585589
batch.buffer_output = -1;
586590
argc = parse_options(argc, argv, prefix, options, cat_file_usage, 0);
587591

592+
if (opt == 'W') {
593+
warning("--smudge is deprecated, please use --filters instead");
594+
opt = 'w';
595+
}
596+
if (force_use_path) {
597+
warning("--use-path=<path> is deprecated, please use "
598+
"--path=<path> instead");
599+
force_path = force_use_path;
600+
}
601+
588602
if (opt) {
589603
if (batch.enabled && (opt == 'c' || opt == 'w'))
590604
batch.cmdmode = opt;

0 commit comments

Comments
 (0)