aboutsummaryrefslogtreecommitdiffstats
path: root/usage.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-12 12:03:06 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-12 13:11:43 -0700
commit4511d56e1a4c09abbe0c6b513fd858072b55cbd8 (patch)
tree271500df982c28552fda1efd74aa7b115156f902 /usage.c
parentCI updates (diff)
downloadgit-4511d56e1a4c09abbe0c6b513fd858072b55cbd8.tar.gz
git-4511d56e1a4c09abbe0c6b513fd858072b55cbd8.zip
you-still-use-that??: help deprecating commands for removal
Commands slated for removal like "git pack-redundant" now require an explicit "--i-still-use-this" option to run. This is to discourage casual use and surface their pending deprecation to users. The warning message is long, so factor it into a helper function you_still_use_that() to simplify reuse by other commands. Also add a missing test to ensure this enforcement works for "pack-redundant". Helped-by: Elijah Newren <newren@gmail.com> [en: log message] Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 38b46bbbfe..4aaad2b553 100644
--- a/usage.c
+++ b/usage.c
@@ -372,3 +372,15 @@ void bug_fl(const char *file, int line, const char *fmt, ...)
trace2_cmd_error_va(fmt, ap);
va_end(ap);
}
+
+NORETURN void you_still_use_that(const char *command_name)
+{
+ fprintf(stderr,
+ _("'%s' is nominated for removal.\n"
+ "If you still use this command, please add an extra\n"
+ "option, '--i-still-use-this', on the command line\n"
+ "and let us know you still use it by sending an e-mail\n"
+ "to <git@vger.kernel.org>. Thanks.\n"),
+ command_name);
+ die(_("refusing to run without --i-still-use-this"));
+}