Skip to content

Commit

Permalink
git-apply --reject: finishing touches.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Aug 27, 2006
1 parent 0e9ee32 commit 8938045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Documentation/git-apply.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ OPTIONS
For atomicity, `git apply` fails the whole patch and
does not touch the working tree when some of the hunks
do not apply by default. This option makes it apply
parts of the patch that are applicable, and send the
rejected hunks to the standard output of the command.
parts of the patch that are applicable, and leave the
rejected hunks in corresponding *.rej files.

-z::
When showing the index information, do not munge paths,
Expand Down
2 changes: 1 addition & 1 deletion builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(arg, "--reject")) {
apply = apply_with_reject = 1;
apply = apply_with_reject = apply_verbosely = 1;
continue;
}
if (!strcmp(arg, "--verbose")) {
Expand Down

0 comments on commit 8938045

Please sign in to comment.