Skip to content

Commit bcd5461

Browse files
committed
Merge branch 'js/rerere-forget-always-take-pathspec'
* js/rerere-forget-always-take-pathspec: rerere forget: deprecate invocation without pathspec
2 parents 1e23907 + 5d2c3b0 commit bcd5461

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Documentation/git-rerere.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
77

88
SYNOPSIS
99
--------
10-
'git rerere' ['clear'|'forget' [<pathspec>]|'diff'|'status'|'gc']
10+
'git rerere' ['clear'|'forget' <pathspec>|'diff'|'status'|'gc']
1111

1212
DESCRIPTION
1313
-----------
@@ -43,7 +43,7 @@ will automatically invoke this command.
4343
'forget' <pathspec>::
4444

4545
This resets the conflict resolutions which rerere has recorded for the current
46-
conflict in <pathspec>. The <pathspec> is optional.
46+
conflict in <pathspec>.
4747

4848
'diff'::
4949

builtin/rerere.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "xdiff-interface.h"
99

1010
static const char * const rerere_usage[] = {
11-
"git rerere [clear | status | remaining | diff | gc]",
11+
"git rerere [clear | forget path... | status | remaining | diff | gc]",
1212
NULL,
1313
};
1414

@@ -136,7 +136,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
136136
return rerere(flags);
137137

138138
if (!strcmp(argv[0], "forget")) {
139-
const char **pathspec = get_pathspec(prefix, argv + 1);
139+
const char **pathspec;
140+
if (argc < 2)
141+
warning("'git rerere forget' without paths is deprecated");
142+
pathspec = get_pathspec(prefix, argv + 1);
140143
return rerere_forget(pathspec);
141144
}
142145

0 commit comments

Comments
 (0)