{"thread":{"id":"17312","subject":"[PATCH] git-am: implement --reject option passed to git-apply","startedAt":"2009-01-23T00:31:21Z","lastAt":"2009-01-24T00:59:49Z","messageCount":2,"participants":["martin f. krafft","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"101585","messageId":"1232670681-25781-1-git-send-email-madduck@madduck.net","threadId":"17312","inReplyTo":null,"subject":"[PATCH] git-am: implement --reject option passed to git-apply","fromName":"martin f. krafft","fromEmail":"madduck@madduck.net","sentAt":"2009-01-23T00:31:21Z","receivedAt":"2009-01-23T00:31:21Z","isPatch":true,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"With --reject, git-am simply passes the --reject option to git-apply and thus\nallows people to work with reject files if they so prefer.\n\nThe patch does not touch t/t4252-am-options.sh (yet) because I do not really\nunderstand how the testing system works.\n\nSigned-off-by: martin f. krafft <madduck@madduck.net>\n\n---\n Documentation/git-am.txt |    2 ++\n git-am.sh                |    3 +++\n 2 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 5cbbe76..efd311b 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -12,6 +12,7 @@ SYNOPSIS\n 'git am' [--signoff] [--keep] [--utf8 | --no-utf8]\n \t [--3way] [--interactive]\n \t [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]\n+\t [--reject]\n \t [<mbox> | <Maildir>...]\n 'git am' (--skip | --resolved | --abort)\n \n@@ -63,6 +64,7 @@ default.   You could use `--no-utf8` to override this.\n -C<n>::\n -p<n>::\n --directory=<dir>::\n+--reject::\n \tThese flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n \tprogram that applies\n \tthe patch.\ndiff --git a/git-am.sh b/git-am.sh\nindex e20dd88..b1c05c9 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -19,6 +19,7 @@ whitespace=     pass it through git-apply\n directory=      pass it through git-apply\n C=              pass it through git-apply\n p=              pass it through git-apply\n+reject          pass it through git-apply\n resolvemsg=     override error message when patch failure occurs\n r,resolved      to be used after a patch failure\n skip            skip the current patch\n@@ -168,6 +169,8 @@ do\n \t\tgit_apply_opt=\"$git_apply_opt $(sq \"$1=$2\")\"; shift ;;\n \t-C|-p)\n \t\tgit_apply_opt=\"$git_apply_opt $(sq \"$1$2\")\"; shift ;;\n+\t--reject)\n+\t\tgit_apply_opt=\"$git_apply_opt $1\" ;;\n \t--)\n \t\tshift; break ;;\n \t*)\n-- \ntg: (9a01387..) git-am--reject (depends on: master)\n"},{"id":"101714","messageId":"7v7i4lr01m.fsf@gitster.siamese.dyndns.org","threadId":"17312","inReplyTo":"1232670681-25781-1-git-send-email-madduck@madduck.net","subject":"Re: [PATCH] git-am: implement --reject option passed to git-apply","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-24T00:59:49Z","receivedAt":"2009-01-24T00:59:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"martin f. krafft\" <madduck@madduck.net> writes:\n\n> The patch does not touch t/t4252-am-options.sh (yet) because I do not really\n> understand how the testing system works.\n\nI'll squash this in, then.\n\nThanks.\n\n t/t4252-am-options.sh |   11 ++++++++++-\n t/t4252/am-test-6-1   |   21 +++++++++++++++++++++\n 2 files changed, 31 insertions(+), 1 deletions(-)\n\ndiff --git c/t/t4252-am-options.sh i/t/t4252-am-options.sh\nindex 5fdd188..f603c1b 100755\n--- c/t/t4252-am-options.sh\n+++ i/t/t4252-am-options.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-test_description='git am not losing options'\n+test_description='git am with options and not losing them'\n . ./test-lib.sh\n \n tm=\"$TEST_DIRECTORY/t4252\"\n@@ -66,4 +66,13 @@ test_expect_success 'apply to a funny path' '\n \ttest -f \"$with_sq/file-5\"\n '\n \n+test_expect_success 'am --reject' '\n+\trm -rf .git/rebase-apply &&\n+\tgit reset --hard initial &&\n+\ttest_must_fail git am --reject \"$tm\"/am-test-6-1 &&\n+\tgrep \"@@ -1,3 +1,3 @@\" file-2.rej &&\n+\ttest_must_fail git diff-files --exit-code --quiet file-2 &&\n+\tgrep \"[-]-reject\" .git/rebase-apply/apply-opt\n+'\n+\n test_done\ndiff --git c/t/t4252/am-test-6-1 i/t/t4252/am-test-6-1\nnew file mode 100644\nindex 0000000..a8859e9\n--- /dev/null\n+++ i/t/t4252/am-test-6-1\n@@ -0,0 +1,21 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Huh\n+\n+Should fail and leave rejects\n+\n+diff --git i/file-2 w/file-2\n+index 06e567b..b6f3a16 100644\n+--- i/file-2\n++++ w/file-2\n+@@ -1,3 +1,3 @@\n+-0\n++One\n+ 2\n+ 3\n+@@ -4,4 +4,4 @@\n+ 4\n+ 5\n+-6\n++Six\n+ 7\n"}]}