{"thread":{"id":"15278","subject":"[PATCH] git-am: Pass the --directory option through to git-apply","startedAt":"2008-08-29T22:27:50Z","lastAt":"2008-08-31T06:30:30Z","messageCount":2,"participants":["Kevin Ballard","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"89167","messageId":"1220048870-97641-1-git-send-email-kevin@sb.org","threadId":"15278","inReplyTo":null,"subject":"[PATCH] git-am: Pass the --directory option through to git-apply","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-08-29T22:27:50Z","receivedAt":"2008-08-29T22:27:50Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Signed-off-by: Kevin Ballard <kevin@sb.org>\n---\n Documentation/git-am.txt |    1 +\n git-am.sh                |    3 ++-\n 2 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex b9c6fac..64c8178 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -66,6 +66,7 @@ default.   You could use `--no-utf8` to override this.\n \n -C<n>::\n -p<n>::\n+--directory=<root>::\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 aa60261..7e7a86f 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -18,6 +18,7 @@ k,keep          pass -k flag to git-mailinfo\n whitespace=     pass it through git-apply\n C=              pass it through git-apply\n p=              pass it through git-apply\n+directory=      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@@ -155,7 +156,7 @@ do\n \t\t;;\n \t--resolvemsg)\n \t\tshift; resolvemsg=$1 ;;\n-\t--whitespace)\n+\t--whitespace|--directory)\n \t\tgit_apply_opt=\"$git_apply_opt $1=$2\"; shift ;;\n \t-C|-p)\n \t\tgit_apply_opt=\"$git_apply_opt $1$2\"; shift ;;\n-- \n1.6.0.1.207.g020e5.dirty\n"},{"id":"89288","messageId":"7vfxold7cp.fsf@gitster.siamese.dyndns.org","threadId":"15278","inReplyTo":"1220048870-97641-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] git-am: Pass the --directory option through to git-apply","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-31T06:30:30Z","receivedAt":"2008-08-31T06:30:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index b9c6fac..64c8178 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> @@ -66,6 +66,7 @@ default.   You could use `--no-utf8` to override this.\n>  \n>  -C<n>::\n>  -p<n>::\n> +--directory=<root>::\n>  \tThese flags are passed to the 'git-apply' (see linkgit:git-apply[1])\n>  \tprogram that applies\n>  \tthe patch.\n> diff --git a/git-am.sh b/git-am.sh\n> index aa60261..7e7a86f 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -18,6 +18,7 @@ k,keep          pass -k flag to git-mailinfo\n>  whitespace=     pass it through git-apply\n>  C=              pass it through git-apply\n>  p=              pass it through git-apply\n> +directory=      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> @@ -155,7 +156,7 @@ do\n>  \t\t;;\n>  \t--resolvemsg)\n>  \t\tshift; resolvemsg=$1 ;;\n> -\t--whitespace)\n> +\t--whitespace|--directory)\n>  \t\tgit_apply_opt=\"$git_apply_opt $1=$2\"; shift ;;\n>  \t-C|-p)\n>  \t\tgit_apply_opt=\"$git_apply_opt $1$2\"; shift ;;\n\nThanks, will queue.\n\nThis inherits an ancient breakage that was introduced to the --whitespace\noption by 67dad68 (add -C[NUM] to git-am, 2007-02-08), in that you need to\ngive the next \"git am\" session the same option when you get a conflict and\nneed to restart.  We should fix this ancient breakage by recording the\nmiscellaneous options that we append to $git_apply_opt variable (we should\nremove the use of \"$dotest/whitespace\" that is now a no-op but 67dad68 did\nnot remove).  That is a separate topic anyway, but the end result should:\n\n * Save the options in effect in $dotest/, just like \"sign\", \"utf8\" and\n   \"keep\" are kept;\n\n * Upon command startup, read the saved options, and then let the command\n   line options override them (which is not what the current code does, by\n   the way);\n\nso that you can give necessary --directory, --whitespace, -C etc. options\nwhen you feed your series to \"git-am\", and after fixing up a rejected\npatch, you can continue without typing the same set of options again.\n"}]}