{"thread":{"id":"26631","subject":"[PATCH] rerere forget: deprecate invocation without pathspec","startedAt":"2011-03-01T13:21:05Z","lastAt":"2011-03-01T13:21:05Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"162547","messageId":"4D6CF2C1.9070805@viscovery.net","threadId":"26631","inReplyTo":null,"subject":"[PATCH] rerere forget: deprecate invocation without pathspec","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-03-01T13:21:05Z","receivedAt":"2011-03-01T13:21:05Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nrerere forget is a destructive command. When invoked without a path, it\noperates on the current directory, potentially deleting many recorded\nconflict resolutions.\n\nTo make the command safer, a path must be specified as of git 1.8.0. Until\nthen, give users time to write 'git rerere forget .' if they really mean\nthe entire current directory.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n I assume that 'rerere forget' is a rarely used command, we can afford\n to change its behavior without a lot of fuzz. Let's not dive into the\n discussion whether it should operate on the current directory or the\n entire repository; rather, require users to be explicit. After all,\n it is destructive!\n\n BTW, notice that documentation for 'remaining' is missing.\n\n -- Hannes\n\n Documentation/git-rerere.txt |    4 ++--\n builtin/rerere.c             |    7 +++++--\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt\nindex db99d47..484fdd5 100644\n--- a/Documentation/git-rerere.txt\n+++ b/Documentation/git-rerere.txt\n@@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges\n \n SYNOPSIS\n --------\n-'git rerere' ['clear'|'forget' [<pathspec>]|'diff'|'status'|'gc']\n+'git rerere' ['clear'|'forget' <pathspec>|'diff'|'status'|'gc']\n \n DESCRIPTION\n -----------\n@@ -43,7 +43,7 @@ will automatically invoke this command.\n 'forget' <pathspec>::\n \n This resets the conflict resolutions which rerere has recorded for the current\n-conflict in <pathspec>.  The <pathspec> is optional.\n+conflict in <pathspec>.\n \n 'diff'::\n \ndiff --git a/builtin/rerere.c b/builtin/rerere.c\nindex 67cbfeb..8235885 100644\n--- a/builtin/rerere.c\n+++ b/builtin/rerere.c\n@@ -8,7 +8,7 @@\n #include \"xdiff-interface.h\"\n \n static const char * const rerere_usage[] = {\n-\t\"git rerere [clear | status | remaining | diff | gc]\",\n+\t\"git rerere [clear | forget path... | status | remaining | diff | gc]\",\n \tNULL,\n };\n \n@@ -136,7 +136,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)\n \t\treturn rerere(flags);\n \n \tif (!strcmp(argv[0], \"forget\")) {\n-\t\tconst char **pathspec = get_pathspec(prefix, argv + 1);\n+\t\tconst char **pathspec;\n+\t\tif (argc < 2)\n+\t\t\twarning(\"'git rerere forget' without paths is deprecated\");\n+\t\tpathspec = get_pathspec(prefix, argv + 1);\n \t\treturn rerere_forget(pathspec);\n \t}\n \n-- \n1.7.4.rc3.76.gfb457d\n"}]}