{"thread":{"id":"41732","subject":"[PATCHV2 2/2] t3404: cleanup double empty lines between tests","startedAt":"2016-03-17T21:44:18Z","lastAt":"2016-03-19T10:43:17Z","messageCount":10,"participants":["Stefan Beller","Junio C Hamano","Johannes Schindelin","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"281085","messageId":"1458251060-311-1-git-send-email-sbeller@google.com","threadId":"41732","inReplyTo":null,"subject":"[PATCHV2 0/2] Decouple rebase --exec from --interactive","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-17T21:44:18Z","receivedAt":"2016-03-17T21:44:18Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Johannes Sixt:\n * Using test_i18ngrep instead of test_i18ncmp\n * test_line_count on the lines of the execution output instead\n   of rebase stdout\n\nJohannes Schindelin:\n * It's a patch series now (whitespace fixes are in patch 2)\n * you proposed '--exec \"touch executed\", I'd go with\n   --exec \"echo foo >>file\" so I can count it was executed twice.\n\nJunio:\n * added words to the commit message. :)\n   (Essentially quoting Johannes that I am not just testing but also\n   stopping for failure at the right point.)\n\nMatthieu: (who preferred responding \"private reply, top posting and probably HTML, sent from a phone\" ;)\n> Your patch makes the user feel like he is using non-interactive\n> rebase while we internally go through the interactive code path.\n> Did you make sure that the difference between interactive and non\n> interactive do not show up by surprise? For example, iirc the interactive\n> rebase does not accept --preserve-merges. What happens if the user asks\n> --exec --preserve-merges?\n>\n> Also, does the doc need update? \n\nI (as a user) did not know there is a non-interactive mode for rebase,\nassuming -i would show the editor and that would have been the only\ndifference.\n\nI think it won't show up as a surprise (in v1) as the changed code is testing for\nbeing non explicit via:\n\n  if test -n \"$cmd\" &&\n     test \"$interactive_rebase\" != explicit\n  then\n  -\tdie(...) \n  +\tinteractive_rebase=implied\n  fi\n\nand that is the last occurrence where interactive_rebase is touched for writing.\n\nQuoting from the man page for `--preserve-merges`:\n    This uses the --interactive machinery internally, but combining it with\n    the --interactive option explicitly is generally not a good idea unless\n    you know what you are doing (see BUGS below).\n\nThe docs have a similar explanation just the other way round [--exec is supposed\nto be used with --interactive, but I avoided using the word \"suppose\" as that\nsounds like preaching to me (Thou' shall not use --exec without --interactive);\nI did not copy over the \"if you know what you're doing\" as it doesn't help the\nuser here. How are they supposed to know if they are proficient enough for using\nit without -i? And we don't have a BUGS section to point at.]\n\n> What happens if the user asks --exec --preserve-merges?\n\nWe're fine. When parsing `--preserve-merges`:\n\t--preserve-merges)\n\t\tpreserve_merges=t\n\t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n\nEssentially we did the same with --exec in v1 just after parsing all options,\nnow I realize we can do it the same way instead of afterwards, just tossing\nin:\n\n  test -z \"$interactive_rebase\" && interactive_rebase=implied\n\n\nStefan Beller (2):\n  rebase -x: do not die without -i\n  t3404: cleanup double empty lines between tests\n\n Documentation/git-rebase.txt  |  6 +++---\n git-rebase.sh                 |  7 +------\n t/t3404-rebase-interactive.sh | 18 +++++-------------\n 3 files changed, 9 insertions(+), 22 deletions(-)\n\n-- \n2.8.0.rc3.2.ga804a9e\n"},{"id":"281086","messageId":"1458251060-311-2-git-send-email-sbeller@google.com","threadId":"41732","inReplyTo":"1458251060-311-1-git-send-email-sbeller@google.com","subject":"[PATCHV2 1/2] rebase -x: do not die without -i","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-17T21:44:19Z","receivedAt":"2016-03-17T21:44:19Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In the later steps of preparing a patch series I do not want to edit the\npatches any more, but just make sure the test suite passes after each\npatch. Currently I would run\n\n  EDITOR=true git rebase -i <anchor> -x \"make test\"\n\nIn an ideal world the command would be simpler and just be\n\n  git rebase <anchor> -x \"make test\"\n\nto run the test for each commit I am about to send out for review.\nThis patch enables the short line. As things can still break, I'd want\nto be able to fix those failures directly at the commit, so it is not\nsufficient to just use:\n\n        git rev-list old...new |\n        while read rev\n        do\n                $command || break\n        done\n\nas it only tests and does not stop at a breakage to fix it up.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n Documentation/git-rebase.txt  |  6 +++---\n git-rebase.sh                 |  7 +------\n t/t3404-rebase-interactive.sh | 12 +++++-------\n 3 files changed, 9 insertions(+), 16 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 6ed610a..0387b40 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -391,9 +391,6 @@ idea unless you know what you are doing (see BUGS below).\n \tfinal history. <cmd> will be interpreted as one or more shell\n \tcommands.\n +\n-This option can only be used with the `--interactive` option\n-(see INTERACTIVE MODE below).\n-+\n You may execute several commands by either using one instance of `--exec`\n with several commands:\n +\n@@ -406,6 +403,9 @@ or by giving more than one `--exec`:\n If `--autosquash` is used, \"exec\" lines will not be appended for\n the intermediate commits, and will only appear at the end of each\n squash/fixup series.\n++\n+This uses the `--interactive` machinery internally, but it can be run\n+without an explicit `--interactive`.\n \n --root::\n \tRebase all commits reachable from <branch>, instead of\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex cf60c43..0bf41ee 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -248,6 +248,7 @@ do\n \t\t;;\n \t--exec=*)\n \t\tcmd=\"${cmd}exec ${1#--exec=}${LF}\"\n+\t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n \t\t;;\n \t--interactive)\n \t\tinteractive_rebase=explicit\n@@ -348,12 +349,6 @@ do\n done\n test $# -gt 2 && usage\n \n-if test -n \"$cmd\" &&\n-   test \"$interactive_rebase\" != explicit\n-then\n-\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n-fi\n-\n if test -n \"$action\"\n then\n \ttest -z \"$in_progress\" && die \"$(gettext \"No rebase in progress?\")\"\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 544f9ad..c8cc03d 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -876,16 +876,14 @@ test_expect_success 'rebase -ix with --autosquash' '\n \ttest_cmp expected actual\n '\n \n-\n-test_expect_success 'rebase --exec without -i shows error message' '\n+test_expect_success 'rebase --exec works without -i ' '\n \tgit reset --hard execute &&\n-\tset_fake_editor &&\n-\ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n-\techo \"The --exec option must be used with the --interactive option\" >expected &&\n-\ttest_i18ncmp expected actual\n+\trm -rf exec_output &&\n+\tgit rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n+\ttest_i18ngrep  \"Successfully rebased and updated\" actual &&\n+\ttest_line_count = 2 exec_output\n '\n \n-\n test_expect_success 'rebase -i --exec without <CMD>' '\n \tgit reset --hard execute &&\n \tset_fake_editor &&\n-- \n2.8.0.rc3.2.ga804a9e\n"},{"id":"281084","messageId":"1458251060-311-3-git-send-email-sbeller@google.com","threadId":"41732","inReplyTo":"1458251060-311-1-git-send-email-sbeller@google.com","subject":"[PATCHV2 2/2] t3404: cleanup double empty lines between tests","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-17T21:44:20Z","receivedAt":"2016-03-17T21:44:20Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t3404-rebase-interactive.sh | 6 ------\n 1 file changed, 6 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex c8cc03d..f932639 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -771,7 +771,6 @@ test_expect_success 'rebase-i history with funny messages' '\n \ttest_cmp expect actual\n '\n \n-\n test_expect_success 'prepare for rebase -i --exec' '\n \tgit checkout master &&\n \tgit checkout -b execute &&\n@@ -780,7 +779,6 @@ test_expect_success 'prepare for rebase -i --exec' '\n \ttest_commit three_exec main.txt three_exec\n '\n \n-\n test_expect_success 'running \"git rebase -i --exec git show HEAD\"' '\n \tset_fake_editor &&\n \tgit rebase -i --exec \"git show HEAD\" HEAD~2 >actual &&\n@@ -793,7 +791,6 @@ test_expect_success 'running \"git rebase -i --exec git show HEAD\"' '\n \ttest_cmp expected actual\n '\n \n-\n test_expect_success 'running \"git rebase --exec git show HEAD -i\"' '\n \tgit reset --hard execute &&\n \tset_fake_editor &&\n@@ -807,7 +804,6 @@ test_expect_success 'running \"git rebase --exec git show HEAD -i\"' '\n \ttest_cmp expected actual\n '\n \n-\n test_expect_success 'running \"git rebase -ix git show HEAD\"' '\n \tgit reset --hard execute &&\n \tset_fake_editor &&\n@@ -835,7 +831,6 @@ test_expect_success 'rebase -ix with several <CMD>' '\n \ttest_cmp expected actual\n '\n \n-\n test_expect_success 'rebase -ix with several instances of --exec' '\n \tgit reset --hard execute &&\n \tset_fake_editor &&\n@@ -850,7 +845,6 @@ test_expect_success 'rebase -ix with several instances of --exec' '\n \ttest_cmp expected actual\n '\n \n-\n test_expect_success 'rebase -ix with --autosquash' '\n \tgit reset --hard execute &&\n \tgit checkout -b autosquash &&\n-- \n2.8.0.rc3.2.ga804a9e\n"},{"id":"281088","messageId":"xmqqd1qszs03.fsf@gitster.mtv.corp.google.com","threadId":"41732","inReplyTo":"1458251060-311-2-git-send-email-sbeller@google.com","subject":"Re: [PATCHV2 1/2] rebase -x: do not die without -i","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-17T21:58:20Z","receivedAt":"2016-03-17T21:58:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> In the later steps of preparing a patch series I do not want to edit the\n> patches any more, but just make sure the test suite passes after each\n> patch. Currently I would run\n>\n>   EDITOR=true git rebase -i <anchor> -x \"make test\"\n>\n> In an ideal world the command would be simpler and just be\n>\n>   git rebase <anchor> -x \"make test\"\n>\n> to run the test for each commit I am about to send out for review.\n> This patch enables the short line. As things can still break, I'd want\n> to be able to fix those failures directly at the commit, so it is not\n> sufficient to just use:\n>\n>         git rev-list old...new |\n>         while read rev\n>         do\n>                 $command || break\n>         done\n>\n> as it only tests and does not stop at a breakage to fix it up.\n\nThat is overly verbose.\n\n    In the later steps of preparing a patch series I do not want to\n    edit or reorder the patches any more, but just make sure the\n    test suite passes after each patch and also to fix breakage\n    right there if some of the steps fail.  I could run\n\n      EDITOR=true git rebase -i <anchor> -x \"make test\"\n\n    but it would be simpler if it can be spelled like so:\n\n      git rebase <anchor> -x \"make test\"\n\nsays the same thing.\n\nIf you said \"I want to fix breakage right there as well\" upfront,\nlike in the above shortened example, nobody would imagine that\n\"rev-list | while .. do .. done\" could be a viable substitute.\n\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index cf60c43..0bf41ee 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -248,6 +248,7 @@ do\n>  \t\t;;\n>  \t--exec=*)\n>  \t\tcmd=\"${cmd}exec ${1#--exec=}${LF}\"\n> +\t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n>  \t\t;;\n>  \t--interactive)\n>  \t\tinteractive_rebase=explicit\n> @@ -348,12 +349,6 @@ do\n>  done\n>  test $# -gt 2 && usage\n>  \n> -if test -n \"$cmd\" &&\n> -   test \"$interactive_rebase\" != explicit\n> -then\n> -\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n> -fi\n> -\n\nThis makes the code structure for $cmd more in line with how the\n\"--preserve-merges\" option is handled, which feels just right ;-)\n\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 544f9ad..c8cc03d 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -876,16 +876,14 @@ test_expect_success 'rebase -ix with --autosquash' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> -\n> -test_expect_success 'rebase --exec without -i shows error message' '\n> +test_expect_success 'rebase --exec works without -i ' '\n>  \tgit reset --hard execute &&\n> -\tset_fake_editor &&\n> -\ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n> -\techo \"The --exec option must be used with the --interactive option\" >expected &&\n> -\ttest_i18ncmp expected actual\n> +\trm -rf exec_output &&\n> +\tgit rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n> +\ttest_i18ngrep  \"Successfully rebased and updated\" actual &&\n> +\ttest_line_count = 2 exec_output\n>  '\n\nShouldn't this test make sure that\n\n\tGIT_EDITOR=something git rebase --exec \"...\" $range\n\ndoes not invoke 'something', as the point of the new feature is that\nyou will not have to see the editor to reorder the commits?\n\n> -\n>  test_expect_success 'rebase -i --exec without <CMD>' '\n>  \tgit reset --hard execute &&\n>  \tset_fake_editor &&\n"},{"id":"281131","messageId":"alpine.DEB.2.20.1603180745370.4690@virtualbox","threadId":"41732","inReplyTo":"1458251060-311-2-git-send-email-sbeller@google.com","subject":"Re: [PATCHV2 1/2] rebase -x: do not die without -i","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-18T06:46:41Z","receivedAt":"2016-03-18T06:46:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Stefan,\n\nOn Thu, 17 Mar 2016, Stefan Beller wrote:\n\n>         git rev-list old...new |\n>         while read rev\n>         do\n>                 $command || break\n>         done\n\nAs Junio pointed out, there should be only two, not three dots.\n\nCiao,\nDscho\n"},{"id":"281177","messageId":"1458336377-28296-1-git-send-email-sbeller@google.com","threadId":"41732","inReplyTo":"xmqqd1qszs03.fsf@gitster.mtv.corp.google.com","subject":"[PATCHv3 1/2] rebase: decouple --exec from --interactive","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-18T21:26:17Z","receivedAt":"2016-03-18T21:26:17Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In the later steps of preparing a patch series I do not want to\nedit or reorder the patches any more, but just make sure the\ntest suite passes after each patch and also to fix breakage\nright there if some of the steps fail.  I could run\n\n    EDITOR=true git rebase -i <anchor> -x \"make test\"\n\nbut it would be simpler if it can be spelled like so:\n\n    git rebase <anchor> -x \"make test\"\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n\n  Thanks Junio, Johannes for review!\n \n * Reworded the commit message (took your suggestion)\n \n * Diff to v2 in t3404:\n        test_expect_success 'rebase --exec works without -i ' '\n                git reset --hard execute &&\n                rm -rf exec_output &&\n        -\tgit rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n        +\tEDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n                test_i18ngrep  \"Successfully rebased and updated\" actual &&\n        -\ttest_line_count = 2 exec_output\n        +\ttest_line_count = 2 exec_output &&\n        +\ttest_path_is_missing invoked_editor\n        '\n  * I just resend this patch instead of the whole series, so do not expect a\n    [PATCHv3 2/2] nor cover letter 0/2\n        \n\n Documentation/git-rebase.txt  |  6 +++---\n git-rebase.sh                 |  7 +------\n t/t3404-rebase-interactive.sh | 13 ++++++-------\n 3 files changed, 10 insertions(+), 16 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 6ed610a..0387b40 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -391,9 +391,6 @@ idea unless you know what you are doing (see BUGS below).\n \tfinal history. <cmd> will be interpreted as one or more shell\n \tcommands.\n +\n-This option can only be used with the `--interactive` option\n-(see INTERACTIVE MODE below).\n-+\n You may execute several commands by either using one instance of `--exec`\n with several commands:\n +\n@@ -406,6 +403,9 @@ or by giving more than one `--exec`:\n If `--autosquash` is used, \"exec\" lines will not be appended for\n the intermediate commits, and will only appear at the end of each\n squash/fixup series.\n++\n+This uses the `--interactive` machinery internally, but it can be run\n+without an explicit `--interactive`.\n \n --root::\n \tRebase all commits reachable from <branch>, instead of\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex cf60c43..0bf41ee 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -248,6 +248,7 @@ do\n \t\t;;\n \t--exec=*)\n \t\tcmd=\"${cmd}exec ${1#--exec=}${LF}\"\n+\t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n \t\t;;\n \t--interactive)\n \t\tinteractive_rebase=explicit\n@@ -348,12 +349,6 @@ do\n done\n test $# -gt 2 && usage\n \n-if test -n \"$cmd\" &&\n-   test \"$interactive_rebase\" != explicit\n-then\n-\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n-fi\n-\n if test -n \"$action\"\n then\n \ttest -z \"$in_progress\" && die \"$(gettext \"No rebase in progress?\")\"\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 544f9ad..21b1f95 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -876,16 +876,15 @@ test_expect_success 'rebase -ix with --autosquash' '\n \ttest_cmp expected actual\n '\n \n-\n-test_expect_success 'rebase --exec without -i shows error message' '\n+test_expect_success 'rebase --exec works without -i ' '\n \tgit reset --hard execute &&\n-\tset_fake_editor &&\n-\ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n-\techo \"The --exec option must be used with the --interactive option\" >expected &&\n-\ttest_i18ncmp expected actual\n+\trm -rf exec_output &&\n+\tEDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n+\ttest_i18ngrep  \"Successfully rebased and updated\" actual &&\n+\ttest_line_count = 2 exec_output &&\n+\ttest_path_is_missing invoked_editor\n '\n \n-\n test_expect_success 'rebase -i --exec without <CMD>' '\n \tgit reset --hard execute &&\n \tset_fake_editor &&\n-- \n2.8.0.rc3.10.gafa8710.dirty\n"},{"id":"281178","messageId":"xmqqh9g3pj3e.fsf@gitster.mtv.corp.google.com","threadId":"41732","inReplyTo":"1458336377-28296-1-git-send-email-sbeller@google.com","subject":"Re: [PATCHv3 1/2] rebase: decouple --exec from --interactive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-18T21:33:09Z","receivedAt":"2016-03-18T21:33:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> In the later steps of preparing a patch series I do not want to\n> edit or reorder the patches any more, but just make sure the\n> test suite passes after each patch and also to fix breakage\n> right there if some of the steps fail.  I could run\n>\n>     EDITOR=true git rebase -i <anchor> -x \"make test\"\n>\n> but it would be simpler if it can be spelled like so:\n>\n>     git rebase <anchor> -x \"make test\"\n>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>\n>   Thanks Junio, Johannes for review!\n>  \n>  * Reworded the commit message (took your suggestion)\n>  \n>  * Diff to v2 in t3404:\n>         test_expect_success 'rebase --exec works without -i ' '\n>                 git reset --hard execute &&\n>                 rm -rf exec_output &&\n>         -\tgit rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n>         +\tEDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n\nHmph.  If you add \"-i\" to the command line, do you see the\n'invoked_editor' file created?\n\nI ask this because I thought we override GIT_EDITOR, which has\nhigher precedence than EDITOR, in the test-lib framework.\n\n>                 test_i18ngrep  \"Successfully rebased and updated\" actual &&\n>         -\ttest_line_count = 2 exec_output\n>         +\ttest_line_count = 2 exec_output &&\n>         +\ttest_path_is_missing invoked_editor\n>         '\n>   * I just resend this patch instead of the whole series, so do not expect a\n>     [PATCHv3 2/2] nor cover letter 0/2\n>         \n>\n>  Documentation/git-rebase.txt  |  6 +++---\n>  git-rebase.sh                 |  7 +------\n>  t/t3404-rebase-interactive.sh | 13 ++++++-------\n>  3 files changed, 10 insertions(+), 16 deletions(-)\n>\n> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\n> index 6ed610a..0387b40 100644\n> --- a/Documentation/git-rebase.txt\n> +++ b/Documentation/git-rebase.txt\n> @@ -391,9 +391,6 @@ idea unless you know what you are doing (see BUGS below).\n>  \tfinal history. <cmd> will be interpreted as one or more shell\n>  \tcommands.\n>  +\n> -This option can only be used with the `--interactive` option\n> -(see INTERACTIVE MODE below).\n> -+\n>  You may execute several commands by either using one instance of `--exec`\n>  with several commands:\n>  +\n> @@ -406,6 +403,9 @@ or by giving more than one `--exec`:\n>  If `--autosquash` is used, \"exec\" lines will not be appended for\n>  the intermediate commits, and will only appear at the end of each\n>  squash/fixup series.\n> ++\n> +This uses the `--interactive` machinery internally, but it can be run\n> +without an explicit `--interactive`.\n>  \n>  --root::\n>  \tRebase all commits reachable from <branch>, instead of\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index cf60c43..0bf41ee 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -248,6 +248,7 @@ do\n>  \t\t;;\n>  \t--exec=*)\n>  \t\tcmd=\"${cmd}exec ${1#--exec=}${LF}\"\n> +\t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n>  \t\t;;\n>  \t--interactive)\n>  \t\tinteractive_rebase=explicit\n> @@ -348,12 +349,6 @@ do\n>  done\n>  test $# -gt 2 && usage\n>  \n> -if test -n \"$cmd\" &&\n> -   test \"$interactive_rebase\" != explicit\n> -then\n> -\tdie \"$(gettext \"The --exec option must be used with the --interactive option\")\"\n> -fi\n> -\n>  if test -n \"$action\"\n>  then\n>  \ttest -z \"$in_progress\" && die \"$(gettext \"No rebase in progress?\")\"\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 544f9ad..21b1f95 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -876,16 +876,15 @@ test_expect_success 'rebase -ix with --autosquash' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> -\n> -test_expect_success 'rebase --exec without -i shows error message' '\n> +test_expect_success 'rebase --exec works without -i ' '\n>  \tgit reset --hard execute &&\n> -\tset_fake_editor &&\n> -\ttest_must_fail git rebase --exec \"git show HEAD\" HEAD~2 2>actual &&\n> -\techo \"The --exec option must be used with the --interactive option\" >expected &&\n> -\ttest_i18ncmp expected actual\n> +\trm -rf exec_output &&\n> +\tEDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n> +\ttest_i18ngrep  \"Successfully rebased and updated\" actual &&\n> +\ttest_line_count = 2 exec_output &&\n> +\ttest_path_is_missing invoked_editor\n>  '\n>  \n> -\n>  test_expect_success 'rebase -i --exec without <CMD>' '\n>  \tgit reset --hard execute &&\n>  \tset_fake_editor &&\n"},{"id":"281181","messageId":"xmqqd1qrpil1.fsf@gitster.mtv.corp.google.com","threadId":"41732","inReplyTo":"xmqqh9g3pj3e.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCHv3 1/2] rebase: decouple --exec from --interactive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-18T21:44:10Z","receivedAt":"2016-03-18T21:44:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>>         +\tEDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n>\n> Hmph.  If you add \"-i\" to the command line, do you see the\n> 'invoked_editor' file created?\n>\n> I ask this because I thought we override GIT_EDITOR, which has\n> higher precedence than EDITOR, in the test-lib framework.\n\nFalse alarm.  We do use EDITOR=: and arrange GIT_EDITOR from the\noutside world to be ignored by unsetting in test-lib.sh, so\nexporting EDITOR here should be safe and OK.\n\nWill queue once I manage to locate 2/2 ;-).\n"},{"id":"281182","messageId":"CAGZ79kb7_z4q+Q7TXG12Os5Pn-_5CYHx7ajdv3Ct8iQ59qAE=A@mail.gmail.com","threadId":"41732","inReplyTo":"xmqqh9g3pj3e.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCHv3 1/2] rebase: decouple --exec from --interactive","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-18T21:46:19Z","receivedAt":"2016-03-18T21:46:19Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Mar 18, 2016 at 2:33 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>  * Diff to v2 in t3404:\n>>         test_expect_success 'rebase --exec works without -i ' '\n>>                 git reset --hard execute &&\n>>                 rm -rf exec_output &&\n>>         -     git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n>>         +     EDITOR=\"echo >invoked_editor\" git rebase --exec \"echo a line >>exec_output\"  HEAD~2 2>actual &&\n>\n> Hmph.  If you add \"-i\" to the command line, do you see the\n> 'invoked_editor' file created?\n\njust tested that by adding\n\n    EDITOR=\"echo >invoked_editor\" git rebase -i ...\n    test_path_is_file invoked_editor\n\nand it works. I have a patch here with s/EDITOR/EDITOR/,\nwhich I can send out...... and your follow up email came in,\nso I stop bothering about this patch until further reviews, ok?\n"},{"id":"281225","messageId":"vpqbn6an3y2.fsf@anie.imag.fr","threadId":"41732","inReplyTo":"1458251060-311-1-git-send-email-sbeller@google.com","subject":"Re: [PATCHV2 0/2] Decouple rebase --exec from --interactive","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-19T10:43:17Z","receivedAt":"2016-03-19T10:43:17Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>> What happens if the user asks --exec --preserve-merges?\n>\n> We're fine. When parsing `--preserve-merges`:\n> \t--preserve-merges)\n> \t\tpreserve_merges=t\n> \t\ttest -z \"$interactive_rebase\" && interactive_rebase=implied\n\nPerfect, thanks for checking (which I couldn't do myself from a phone).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}