git-apply --reject: finishing touches.
After a failed "git am" attempt: git apply --reject --verbose .dotest/patch applies hunks that are applicable and leaves *.rej files the rejected hunks, and it reports what it is doing. With --index, files with a rejected hunk do not get their index entries updated at all, so "git diff" will show the hunks that successfully got applied. Without --verbose to remind the user that the patch updated some other paths cleanly, it is very easy to lose track of the status of the working tree, so --reject implies --verbose. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Aug 27, 2006 at 15:53 UTC
8938045a4eae7a9c39631508a3c3d34c50c6257a
2 files changed
+3
-3
Documentation/git-apply.txt
+2
-2
@@ -70,8 +70,8 @@ OPTIONS
70
For atomicity, `git apply` fails the whole patch and
71
does not touch the working tree when some of the hunks
72
do not apply by default. This option makes it apply
73
- parts of the patch that are applicable, and send the
74
- rejected hunks to the standard output of the command.
73
+ parts of the patch that are applicable, and leave the
74
+ rejected hunks in corresponding *.rej files.
75
76
-z::
77
When showing the index information, do not munge paths,
builtin-apply.c
+1
-1
@@ -2557,7 +2557,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
2557
continue;
2558
}
2559
if (!strcmp(arg, "--reject")) {
2560
- apply = apply_with_reject = 1;
2560
+ apply = apply_with_reject = apply_verbosely = 1;
2561
continue;
2562
}
2563
if (!strcmp(arg, "--verbose")) {