* [PATCH] git-am: implement --reject option passed to git-apply
@ 2009-01-23 0:31 martin f. krafft
2009-01-24 0:59 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: martin f. krafft @ 2009-01-23 0:31 UTC (permalink / raw)
To: git; +Cc: martin f. krafft, penny leach
With --reject, git-am simply passes the --reject option to git-apply and thus
allows people to work with reject files if they so prefer.
The patch does not touch t/t4252-am-options.sh (yet) because I do not really
understand how the testing system works.
Signed-off-by: martin f. krafft <madduck@madduck.net>
---
Documentation/git-am.txt | 2 ++
git-am.sh | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 5cbbe76..efd311b 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -12,6 +12,7 @@ SYNOPSIS
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
[--3way] [--interactive]
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
+ [--reject]
[<mbox> | <Maildir>...]
'git am' (--skip | --resolved | --abort)
@@ -63,6 +64,7 @@ default. You could use `--no-utf8` to override this.
-C<n>::
-p<n>::
--directory=<dir>::
+--reject::
These flags are passed to the 'git-apply' (see linkgit:git-apply[1])
program that applies
the patch.
diff --git a/git-am.sh b/git-am.sh
index e20dd88..b1c05c9 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -19,6 +19,7 @@ whitespace= pass it through git-apply
directory= pass it through git-apply
C= pass it through git-apply
p= pass it through git-apply
+reject pass it through git-apply
resolvemsg= override error message when patch failure occurs
r,resolved to be used after a patch failure
skip skip the current patch
@@ -168,6 +169,8 @@ do
git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;;
-C|-p)
git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
+ --reject)
+ git_apply_opt="$git_apply_opt $1" ;;
--)
shift; break ;;
*)
--
tg: (9a01387..) git-am--reject (depends on: master)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] git-am: implement --reject option passed to git-apply
2009-01-23 0:31 [PATCH] git-am: implement --reject option passed to git-apply martin f. krafft
@ 2009-01-24 0:59 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2009-01-24 0:59 UTC (permalink / raw)
To: martin f. krafft; +Cc: git, penny leach
"martin f. krafft" <madduck@madduck.net> writes:
> The patch does not touch t/t4252-am-options.sh (yet) because I do not really
> understand how the testing system works.
I'll squash this in, then.
Thanks.
t/t4252-am-options.sh | 11 ++++++++++-
t/t4252/am-test-6-1 | 21 +++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
diff --git c/t/t4252-am-options.sh i/t/t4252-am-options.sh
index 5fdd188..f603c1b 100755
--- c/t/t4252-am-options.sh
+++ i/t/t4252-am-options.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-test_description='git am not losing options'
+test_description='git am with options and not losing them'
. ./test-lib.sh
tm="$TEST_DIRECTORY/t4252"
@@ -66,4 +66,13 @@ test_expect_success 'apply to a funny path' '
test -f "$with_sq/file-5"
'
+test_expect_success 'am --reject' '
+ rm -rf .git/rebase-apply &&
+ git reset --hard initial &&
+ test_must_fail git am --reject "$tm"/am-test-6-1 &&
+ grep "@@ -1,3 +1,3 @@" file-2.rej &&
+ test_must_fail git diff-files --exit-code --quiet file-2 &&
+ grep "[-]-reject" .git/rebase-apply/apply-opt
+'
+
test_done
diff --git c/t/t4252/am-test-6-1 i/t/t4252/am-test-6-1
new file mode 100644
index 0000000..a8859e9
--- /dev/null
+++ i/t/t4252/am-test-6-1
@@ -0,0 +1,21 @@
+From: A U Thor <au.thor@example.com>
+Date: Thu Dec 4 16:00:00 2008 -0800
+Subject: Huh
+
+Should fail and leave rejects
+
+diff --git i/file-2 w/file-2
+index 06e567b..b6f3a16 100644
+--- i/file-2
++++ w/file-2
+@@ -1,3 +1,3 @@
+-0
++One
+ 2
+ 3
+@@ -4,4 +4,4 @@
+ 4
+ 5
+-6
++Six
+ 7
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-24 1:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 0:31 [PATCH] git-am: implement --reject option passed to git-apply martin f. krafft
2009-01-24 0:59 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).