{"thread":{"id":"16602","subject":"[PATCH 1/4] git-am --whitespace: do not lose the command line option","startedAt":"2008-12-05T02:22:56Z","lastAt":"2008-12-05T19:18:43Z","messageCount":7,"participants":["Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"97194","messageId":"1228443780-3386-1-git-send-email-gitster@pobox.com","threadId":"16602","inReplyTo":null,"subject":"[PATCH 0/4] Fix longstanding \"git am\" bug","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T02:22:56Z","receivedAt":"2008-12-05T02:22:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Simon Schubert rerolled a patch to add \"git am --directory=<dir>\" from\nthree months ago, which is a good complement to existing \"git am -p<n>\",\nbut it had the same issue of duplicating an existing bug to the new feature.\n\nLet's fix the existing bug first, before accepting any new feature, which\nwill happen after 1.6.1 goes final.\n\nJunio C Hamano (4):\n  git-am --whitespace: do not lose the command line option\n  git-am: propagate -C<n>, -p<n> options as well\n  git-am: propagate --3way options as well\n  Test that git-am does not lose -C/-p/--whitespace options\n\n git-am.sh             |   15 +++++++++----\n t/t4252-am-options.sh |   54 +++++++++++++++++++++++++++++++++++++++++++++++++\n t/t4252/am-test-1-1   |   19 +++++++++++++++++\n t/t4252/am-test-1-2   |   21 +++++++++++++++++++\n t/t4252/am-test-2-1   |   19 +++++++++++++++++\n t/t4252/am-test-2-2   |   21 +++++++++++++++++++\n t/t4252/am-test-3-1   |   19 +++++++++++++++++\n t/t4252/am-test-3-2   |   21 +++++++++++++++++++\n t/t4252/am-test-4-1   |   19 +++++++++++++++++\n t/t4252/am-test-4-2   |   22 ++++++++++++++++++++\n t/t4252/file-1-0      |    7 ++++++\n t/t4252/file-2-0      |    7 ++++++\n 12 files changed, 239 insertions(+), 5 deletions(-)\n create mode 100755 t/t4252-am-options.sh\n create mode 100644 t/t4252/am-test-1-1\n create mode 100644 t/t4252/am-test-1-2\n create mode 100644 t/t4252/am-test-2-1\n create mode 100644 t/t4252/am-test-2-2\n create mode 100644 t/t4252/am-test-3-1\n create mode 100644 t/t4252/am-test-3-2\n create mode 100644 t/t4252/am-test-4-1\n create mode 100644 t/t4252/am-test-4-2\n create mode 100644 t/t4252/file-1-0\n create mode 100644 t/t4252/file-2-0\n"},{"id":"97193","messageId":"1228443780-3386-2-git-send-email-gitster@pobox.com","threadId":"16602","inReplyTo":"1228443780-3386-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/4] git-am --whitespace: do not lose the command line option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T02:22:57Z","receivedAt":"2008-12-05T02:22:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When you start \"git am --whitespace=fix\" and the patch application process\nis interrupted by an unapplicable patch early in the series, after\nfixing the offending patch, the remainder of the patch should be processed\nstill with --whitespace=fix when restarted with \"git am --resolved\" (or\ndropping the offending patch with \"git am --skip\").\n\nThe breakage was introduced by the commit 67dad68 (add -C[NUM] to git-am,\n2007-02-08); this should fix it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-am.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex aa60261..1bf70d4 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index.\"\n \n prec=4\n dotest=\"$GIT_DIR/rebase-apply\"\n-sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=\n+sign= utf8=t keep= skip= interactive= resolved= rebasing= abort= ws=\n resolvemsg= resume=\n git_apply_opt=\n \n@@ -156,7 +156,7 @@ do\n \t--resolvemsg)\n \t\tshift; resolvemsg=$1 ;;\n \t--whitespace)\n-\t\tgit_apply_opt=\"$git_apply_opt $1=$2\"; shift ;;\n+\t\tws=\"--whitespace=$2\"; shift ;;\n \t-C|-p)\n \t\tgit_apply_opt=\"$git_apply_opt $1$2\"; shift ;;\n \t--)\n@@ -283,7 +283,7 @@ if test \"$(cat \"$dotest/keep\")\" = t\n then\n \tkeep=-k\n fi\n-ws=`cat \"$dotest/whitespace\"`\n+ws=$(cat \"$dotest/whitespace\")\n if test \"$(cat \"$dotest/sign\")\" = t\n then\n \tSIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '\n@@ -454,7 +454,7 @@ do\n \n \tcase \"$resolved\" in\n \t'')\n-\t\tgit apply $git_apply_opt --index \"$dotest/patch\"\n+\t\tgit apply $git_apply_opt $ws --index \"$dotest/patch\"\n \t\tapply_status=$?\n \t\t;;\n \tt)\n-- \n1.6.1.rc1.60.g1d1d7\n\n \n"},{"id":"97195","messageId":"1228443780-3386-3-git-send-email-gitster@pobox.com","threadId":"16602","inReplyTo":"1228443780-3386-2-git-send-email-gitster@pobox.com","subject":"[PATCH 2/4] git-am: propagate -C<n>, -p<n> options as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T02:22:58Z","receivedAt":"2008-12-05T02:22:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"These options are meant to deal with patches that do not apply cleanly\ndue to the differences between the version the patch was based on and\nthe version \"git am\" is working on.\n\nBecause a series of patches applied in the same \"git am\" run tends to\ncome from the same source, it is more useful to propagate these options\nafter the application stops.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-am.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 1bf70d4..ed54e71 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -121,7 +121,7 @@ It does not apply to blobs recorded in its index.\"\n \n prec=4\n dotest=\"$GIT_DIR/rebase-apply\"\n-sign= utf8=t keep= skip= interactive= resolved= rebasing= abort= ws=\n+sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=\n resolvemsg= resume=\n git_apply_opt=\n \n@@ -156,7 +156,7 @@ do\n \t--resolvemsg)\n \t\tshift; resolvemsg=$1 ;;\n \t--whitespace)\n-\t\tws=\"--whitespace=$2\"; shift ;;\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 \t--)\n@@ -247,10 +247,10 @@ else\n \t\texit 1\n \t}\n \n-\t# -s, -u, -k and --whitespace flags are kept for the\n-\t# resuming session after a patch failure.\n+\t# -s, -u, -k, --whitespace, -C and -p flags are kept\n+\t# for the resuming session after a patch failure.\n \t# -3 and -i can and must be given when resuming.\n-\techo \" $ws\" >\"$dotest/whitespace\"\n+\techo \" $git_apply_opt\" >\"$dotest/apply_opt_extra\"\n \techo \"$sign\" >\"$dotest/sign\"\n \techo \"$utf8\" >\"$dotest/utf8\"\n \techo \"$keep\" >\"$dotest/keep\"\n@@ -283,7 +283,7 @@ if test \"$(cat \"$dotest/keep\")\" = t\n then\n \tkeep=-k\n fi\n-ws=$(cat \"$dotest/whitespace\")\n+git_apply_opt=$(cat \"$dotest/apply_opt_extra\")\n if test \"$(cat \"$dotest/sign\")\" = t\n then\n \tSIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '\n@@ -454,7 +454,7 @@ do\n \n \tcase \"$resolved\" in\n \t'')\n-\t\tgit apply $git_apply_opt $ws --index \"$dotest/patch\"\n+\t\tgit apply $git_apply_opt --index \"$dotest/patch\"\n \t\tapply_status=$?\n \t\t;;\n \tt)\n-- \n1.6.1.rc1.60.g1d1d7\n"},{"id":"97196","messageId":"1228443780-3386-4-git-send-email-gitster@pobox.com","threadId":"16602","inReplyTo":"1228443780-3386-3-git-send-email-gitster@pobox.com","subject":"[PATCH 3/4] git-am: propagate --3way options as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T02:22:59Z","receivedAt":"2008-12-05T02:22:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The reasoning is the same as the previous patch, where we made -C<n>\nand -p<n> propagate across a failure.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-am.sh |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex ed54e71..13c02d6 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -247,10 +247,11 @@ else\n \t\texit 1\n \t}\n \n-\t# -s, -u, -k, --whitespace, -C and -p flags are kept\n+\t# -s, -u, -k, --whitespace, -3, -C and -p flags are kept\n \t# for the resuming session after a patch failure.\n-\t# -3 and -i can and must be given when resuming.\n+\t# -i can and must be given when resuming.\n \techo \" $git_apply_opt\" >\"$dotest/apply_opt_extra\"\n+\techo \"$threeway\" >\"$dotest/threeway\"\n \techo \"$sign\" >\"$dotest/sign\"\n \techo \"$utf8\" >\"$dotest/utf8\"\n \techo \"$keep\" >\"$dotest/keep\"\n@@ -283,6 +284,10 @@ if test \"$(cat \"$dotest/keep\")\" = t\n then\n \tkeep=-k\n fi\n+if test \"$(cat \"$dotest/threeway\")\" = t\n+then\n+\tthreeway=t\n+fi\n git_apply_opt=$(cat \"$dotest/apply_opt_extra\")\n if test \"$(cat \"$dotest/sign\")\" = t\n then\n-- \n1.6.1.rc1.60.g1d1d7\n"},{"id":"97197","messageId":"1228443780-3386-5-git-send-email-gitster@pobox.com","threadId":"16602","inReplyTo":"1228443780-3386-4-git-send-email-gitster@pobox.com","subject":"[PATCH 4/4] Test that git-am does not lose -C/-p/--whitespace options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T02:23:00Z","receivedAt":"2008-12-05T02:23:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"These tests make sure that \"git am\" does not lose command line options\nspecified when it was started, after it is interrupted by a patch that\ndoes not apply earlier in the series.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t4252-am-options.sh |   54 +++++++++++++++++++++++++++++++++++++++++++++++++\n t/t4252/am-test-1-1   |   19 +++++++++++++++++\n t/t4252/am-test-1-2   |   21 +++++++++++++++++++\n t/t4252/am-test-2-1   |   19 +++++++++++++++++\n t/t4252/am-test-2-2   |   21 +++++++++++++++++++\n t/t4252/am-test-3-1   |   19 +++++++++++++++++\n t/t4252/am-test-3-2   |   21 +++++++++++++++++++\n t/t4252/am-test-4-1   |   19 +++++++++++++++++\n t/t4252/am-test-4-2   |   22 ++++++++++++++++++++\n t/t4252/file-1-0      |    7 ++++++\n t/t4252/file-2-0      |    7 ++++++\n 11 files changed, 229 insertions(+), 0 deletions(-)\n create mode 100755 t/t4252-am-options.sh\n create mode 100644 t/t4252/am-test-1-1\n create mode 100644 t/t4252/am-test-1-2\n create mode 100644 t/t4252/am-test-2-1\n create mode 100644 t/t4252/am-test-2-2\n create mode 100644 t/t4252/am-test-3-1\n create mode 100644 t/t4252/am-test-3-2\n create mode 100644 t/t4252/am-test-4-1\n create mode 100644 t/t4252/am-test-4-2\n create mode 100644 t/t4252/file-1-0\n create mode 100644 t/t4252/file-2-0\n\ndiff --git a/t/t4252-am-options.sh b/t/t4252-am-options.sh\nnew file mode 100755\nindex 0000000..1a1946d\n--- /dev/null\n+++ b/t/t4252-am-options.sh\n@@ -0,0 +1,54 @@\n+#!/bin/sh\n+\n+test_description='git am not losing options'\n+. ./test-lib.sh\n+\n+tm=\"$TEST_DIRECTORY/t4252\"\n+\n+test_expect_success setup '\n+\tcp \"$tm/file-1-0\" file-1 &&\n+\tcp \"$tm/file-2-0\" file-2 &&\n+\tgit add file-1 file-2 &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\tgit tag initial\n+'\n+\n+test_expect_success 'interrupted am --whitespace=fix' '\n+\trm -rf .git/rebase-apply &&\n+\tgit reset --hard initial &&\n+\ttest_must_fail git am --whitespace=fix \"$tm\"/am-test-1-? &&\n+\tgit am --skip &&\n+\tgrep 3 file-1 &&\n+\tgrep \"^Six$\" file-2\n+'\n+\n+test_expect_success 'interrupted am -C1' '\n+\trm -rf .git/rebase-apply &&\n+\tgit reset --hard initial &&\n+\ttest_must_fail git am -C1 \"$tm\"/am-test-2-? &&\n+\tgit am --skip &&\n+\tgrep 3 file-1 &&\n+\tgrep \"^Three$\" file-2\n+'\n+\n+test_expect_success 'interrupted am -p2' '\n+\trm -rf .git/rebase-apply &&\n+\tgit reset --hard initial &&\n+\ttest_must_fail git am -p2 \"$tm\"/am-test-3-? &&\n+\tgit am --skip &&\n+\tgrep 3 file-1 &&\n+\tgrep \"^Three$\" file-2\n+'\n+\n+test_expect_success 'interrupted am -C1 -p2' '\n+\trm -rf .git/rebase-apply &&\n+\tgit reset --hard initial &&\n+\ttest_must_fail git am -p2 -C1 \"$tm\"/am-test-4-? &&\n+\tcat .git/rebase-apply/apply_opt_extra &&\n+\tgit am --skip &&\n+\tgrep 3 file-1 &&\n+\tgrep \"^Three$\" file-2\n+'\n+\n+test_done\ndiff --git a/t/t4252/am-test-1-1 b/t/t4252/am-test-1-1\nnew file mode 100644\nindex 0000000..b0c09dc\n--- /dev/null\n+++ b/t/t4252/am-test-1-1\n@@ -0,0 +1,19 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Three\n+\n+Application of this should be rejected because the first line in the\n+context does not match.\n+\n+diff --git i/file-1 w/file-1\n+index 06e567b..10f8342 100644\n+--- i/file-1\n++++ w/file-1\n+@@ -1,6 +1,6 @@\n+ One\n+ 2\n+-3\n++Three \n+ 4\n+ 5\n+ 6\ndiff --git a/t/t4252/am-test-1-2 b/t/t4252/am-test-1-2\nnew file mode 100644\nindex 0000000..1b874ae\n--- /dev/null\n+++ b/t/t4252/am-test-1-2\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: Six\n+\n+Applying this patch with --whitespace=fix should lose \n+the trailing whitespace after \"Six\".\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,7 +1,7 @@\n+ 1\n+ 2\n+-3\n++Three\n+ 4\n+ 5\n+-6\n++Six \n+ 7\ndiff --git a/t/t4252/am-test-2-1 b/t/t4252/am-test-2-1\nnew file mode 100644\nindex 0000000..feda94a\n--- /dev/null\n+++ b/t/t4252/am-test-2-1\n@@ -0,0 +1,19 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Three\n+\n+Application of this should be rejected even with -C1 because the\n+preimage line in the context does not match.\n+\n+diff --git i/file-1 w/file-1\n+index 06e567b..10f8342 100644\n+--- i/file-1\n++++ w/file-1\n+@@ -1,6 +1,6 @@\n+ 1\n+ 2\n+-Tres\n++Three \n+ 4\n+ 5\n+ 6\ndiff --git a/t/t4252/am-test-2-2 b/t/t4252/am-test-2-2\nnew file mode 100644\nindex 0000000..2ac6600\n--- /dev/null\n+++ b/t/t4252/am-test-2-2\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: Six\n+\n+Applying this patch with -C1 should be successful even though \n+the first line in the context does not match.\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,7 +1,7 @@\n+ One\n+ 2\n+-3\n++Three\n+ 4\n+ 5\n+-6\n++Six\n+ 7\ndiff --git a/t/t4252/am-test-3-1 b/t/t4252/am-test-3-1\nnew file mode 100644\nindex 0000000..608e5ab\n--- /dev/null\n+++ b/t/t4252/am-test-3-1\n@@ -0,0 +1,19 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Three\n+\n+Application of this should be rejected even with -p2 because the\n+preimage line in the context does not match.\n+\n+diff --git i/junk/file-1 w/junk/file-1\n+index 06e567b..10f8342 100644\n+--- i/junk/file-1\n++++ w/junk/file-1\n+@@ -1,6 +1,6 @@\n+ 1\n+ 2\n+-Tres\n++Three \n+ 4\n+ 5\n+ 6\ndiff --git a/t/t4252/am-test-3-2 b/t/t4252/am-test-3-2\nnew file mode 100644\nindex 0000000..0081b96\n--- /dev/null\n+++ b/t/t4252/am-test-3-2\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: Six\n+\n+Applying this patch with -p2 should be successful even though\n+the patch is against a wrong level.\n+\n+diff --git i/junk/file-2 w/junk/file-2\n+index 06e567b..b6f3a16 100644\n+--- i/junk/file-2\n++++ w/junk/file-2\n+@@ -1,7 +1,7 @@\n+ 1\n+ 2\n+-3\n++Three\n+ 4\n+ 5\n+-6\n++Six\n+ 7\ndiff --git a/t/t4252/am-test-4-1 b/t/t4252/am-test-4-1\nnew file mode 100644\nindex 0000000..e48cd6c\n--- /dev/null\n+++ b/t/t4252/am-test-4-1\n@@ -0,0 +1,19 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Three\n+\n+Application of this should be rejected even with -C1 -p2 because\n+the preimage line in the context does not match.\n+\n+diff --git i/junk/file-1 w/junk/file-1\n+index 06e567b..10f8342 100644\n+--- i/junk/file-1\n++++ w/junk/file-1\n+@@ -1,6 +1,6 @@\n+ 1\n+ 2\n+-Tres\n++Three \n+ 4\n+ 5\n+ 6\ndiff --git a/t/t4252/am-test-4-2 b/t/t4252/am-test-4-2\nnew file mode 100644\nindex 0000000..0e69bfa\n--- /dev/null\n+++ b/t/t4252/am-test-4-2\n@@ -0,0 +1,22 @@\n+From: A U Thor <au.thor@example.com>\n+Date: Thu Dec 4 16:00:00 2008 -0800\n+Subject: Six\n+\n+Applying this patch with -C1 -p2 should be successful even though\n+the patch is against a wrong level and the first context line does\n+not match.\n+\n+diff --git i/junk/file-2 w/junk/file-2\n+index 06e567b..b6f3a16 100644\n+--- i/junk/file-2\n++++ w/junk/file-2\n+@@ -1,7 +1,7 @@\n+ One\n+ 2\n+-3\n++Three\n+ 4\n+ 5\n+-6\n++Six\n+ 7\ndiff --git a/t/t4252/file-1-0 b/t/t4252/file-1-0\nnew file mode 100644\nindex 0000000..06e567b\n--- /dev/null\n+++ b/t/t4252/file-1-0\n@@ -0,0 +1,7 @@\n+1\n+2\n+3\n+4\n+5\n+6\n+7\ndiff --git a/t/t4252/file-2-0 b/t/t4252/file-2-0\nnew file mode 100644\nindex 0000000..06e567b\n--- /dev/null\n+++ b/t/t4252/file-2-0\n@@ -0,0 +1,7 @@\n+1\n+2\n+3\n+4\n+5\n+6\n+7\n-- \n1.6.1.rc1.60.g1d1d7\n"},{"id":"97204","messageId":"alpine.DEB.1.00.0812051320170.7062@intel-tinevez-2-302","threadId":"16602","inReplyTo":"1228443780-3386-3-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 2/4] git-am: propagate -C<n>, -p<n> options as well","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-12-05T12:21:43Z","receivedAt":"2008-12-05T12:21:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 4 Dec 2008, Junio C Hamano wrote:\n\n> -\techo \" $ws\" >\"$dotest/whitespace\"\n> +\techo \" $git_apply_opt\" >\"$dotest/apply_opt_extra\"\n\n>From the other scripts, it appears we have sort of a convention to use \ndashes instead of underscores for file names (see e.g. \n$dotest/patch-merge-tmp-dir).\n\nOther than that, the whole series looks good to me.\n\nThanks for the work, especially the tests,\nDscho\n"},{"id":"97211","messageId":"7v7i6e1ld8.fsf@gitster.siamese.dyndns.org","threadId":"16602","inReplyTo":"alpine.DEB.1.00.0812051320170.7062@intel-tinevez-2-302","subject":"Re: [PATCH 2/4] git-am: propagate -C<n>, -p<n> options as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-05T19:18:43Z","receivedAt":"2008-12-05T19:18:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Thu, 4 Dec 2008, Junio C Hamano wrote:\n>\n>> -\techo \" $ws\" >\"$dotest/whitespace\"\n>> +\techo \" $git_apply_opt\" >\"$dotest/apply_opt_extra\"\n>\n>>From the other scripts, it appears we have sort of a convention to use \n> dashes instead of underscores for file names (see e.g. \n> $dotest/patch-merge-tmp-dir).\n\nYou are right.  And there is no reason to call it \"extra\" either.\n\n\n git-am.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git c/git-am.sh w/git-am.sh\nindex 13c02d6..4b157fe 100755\n--- c/git-am.sh\n+++ w/git-am.sh\n@@ -250,7 +250,7 @@ else\n \t# -s, -u, -k, --whitespace, -3, -C and -p flags are kept\n \t# for the resuming session after a patch failure.\n \t# -i can and must be given when resuming.\n-\techo \" $git_apply_opt\" >\"$dotest/apply_opt_extra\"\n+\techo \" $git_apply_opt\" >\"$dotest/apply-opt\"\n \techo \"$threeway\" >\"$dotest/threeway\"\n \techo \"$sign\" >\"$dotest/sign\"\n \techo \"$utf8\" >\"$dotest/utf8\"\n@@ -288,7 +288,7 @@ if test \"$(cat \"$dotest/threeway\")\" = t\n then\n \tthreeway=t\n fi\n-git_apply_opt=$(cat \"$dotest/apply_opt_extra\")\n+git_apply_opt=$(cat \"$dotest/apply-opt\")\n if test \"$(cat \"$dotest/sign\")\" = t\n then\n \tSIGNOFF=`git var GIT_COMMITTER_IDENT | sed -e '\n"}]}