Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2011-03-01 16:21:05 +0300
committerJunio C Hamano <gitster@pobox.com>2011-03-02 23:26:18 +0300
commit5d2c3b01604a170c52262bf2751c55053d6bd8c1 (patch)
treee539b22655c9d8fdb85cb80fa88f2b5d87d22c69 /builtin/rerere.c
parentf70f736bcbb22cfe434eaf20089d9713b991ee31 (diff)
rerere forget: deprecate invocation without pathspec
rerere forget is a destructive command. When invoked without a path, it operates on the current directory, potentially deleting many recorded conflict resolutions. To make the command safer, a path must be specified as of git 1.8.0. Until then, give users time to write 'git rerere forget .' if they really mean the entire current directory. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rerere.c')
-rw-r--r--builtin/rerere.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 67cbfeb152..82358855d1 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -8,7 +8,7 @@
#include "xdiff-interface.h"
static const char * const rerere_usage[] = {
- "git rerere [clear | status | remaining | diff | gc]",
+ "git rerere [clear | forget path... | status | remaining | diff | gc]",
NULL,
};
@@ -136,7 +136,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
return rerere(flags);
if (!strcmp(argv[0], "forget")) {
- const char **pathspec = get_pathspec(prefix, argv + 1);
+ const char **pathspec;
+ if (argc < 2)
+ warning("'git rerere forget' without paths is deprecated");
+ pathspec = get_pathspec(prefix, argv + 1);
return rerere_forget(pathspec);
}