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>
This commit is contained in:
Junio C Hamano 2006-08-27 15:53:20 -07:00
Родитель 0e9ee32358
Коммит 8938045a4e
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -70,8 +70,8 @@ OPTIONS
For atomicity, `git apply` fails the whole patch and For atomicity, `git apply` fails the whole patch and
does not touch the working tree when some of the hunks does not touch the working tree when some of the hunks
do not apply by default. This option makes it apply do not apply by default. This option makes it apply
parts of the patch that are applicable, and send the parts of the patch that are applicable, and leave the
rejected hunks to the standard output of the command. rejected hunks in corresponding *.rej files.
-z:: -z::
When showing the index information, do not munge paths, When showing the index information, do not munge paths,

Просмотреть файл

@ -2557,7 +2557,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
continue; continue;
} }
if (!strcmp(arg, "--reject")) { if (!strcmp(arg, "--reject")) {
apply = apply_with_reject = 1; apply = apply_with_reject = apply_verbosely = 1;
continue; continue;
} }
if (!strcmp(arg, "--verbose")) { if (!strcmp(arg, "--verbose")) {