{"thread":{"id":"51093","subject":"[PATCH 0/5] Clean up after the removal of the scripted rebase","startedAt":"2019-05-14T11:22:34Z","lastAt":"2019-05-14T11:22:41Z","messageCount":6,"participants":["Johannes Schindelin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"375506","messageId":"pull.194.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":null,"subject":"[PATCH 0/5] Clean up after the removal of the scripted rebase","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:30Z","receivedAt":"2019-05-14T11:22:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Technically, there is still one part that is scripted: git rebase\n--preserve-merges. But that is already deprecated, and the remaining parts\nreally are no longer scripted.\n\nMeaning that we do not need git-rebase--am.sh.\n\nWhile at it, clean up a few other places that reference the scripted rebase,\nand also move the functions from git-rebase--common.sh directly into the -p \nbackend (because it is the sole remaining user).\n\nJohannes Schindelin (5):\n  Drop unused git-rebase--am.sh\n  t3400: stop referring to the scripted rebase\n  .gitignore: there is no longer a built-in `git-rebase--interactive`\n  sequencer: the `am` and `rebase--interactive` scripts are gone\n  rebase: fold git-rebase--common into the -p backend\n\n .gitignore                     |  3 --\n Makefile                       |  2 -\n builtin/rebase.c               |  7 +--\n git-rebase--am.sh              | 85 ----------------------------------\n git-rebase--common.sh          | 69 ---------------------------\n git-rebase--preserve-merges.sh | 55 ++++++++++++++++++++++\n sequencer.c                    |  2 +-\n t/t3400-rebase.sh              |  2 +-\n 8 files changed, 58 insertions(+), 167 deletions(-)\n delete mode 100644 git-rebase--am.sh\n delete mode 100644 git-rebase--common.sh\n\n\nbase-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-194%2Fdscho%2Fdrop-rebase--am.sh-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-194/dscho/drop-rebase--am.sh-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/194\n-- \ngitgitgadget\n"},{"id":"375507","messageId":"fa2b967ce8b7c9da54b2304edc7e7505d262a238.1557832949.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":"pull.194.git.gitgitgadget@gmail.com","subject":"[PATCH 1/5] Drop unused git-rebase--am.sh","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:31Z","receivedAt":"2019-05-14T11:22:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nSince 21853626ea (built-in rebase: call `git am` directly, 2019-01-18),\nthe built-in rebase already uses the built-in `git am` directly.\n\nNow that d03ebd411c (rebase: remove the rebase.useBuiltin setting,\n2019-03-18) even removed the scripted rebase, there is no longer any\nuser of `git-rebase--am.sh`, so let's just remove it.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore        |  1 -\n Makefile          |  1 -\n builtin/rebase.c  |  4 ---\n git-rebase--am.sh | 85 -----------------------------------------------\n 4 files changed, 91 deletions(-)\n delete mode 100644 git-rebase--am.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 2374f77a1a..875f3fc6e8 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -122,7 +122,6 @@\n /git-range-diff\n /git-read-tree\n /git-rebase\n-/git-rebase--am\n /git-rebase--common\n /git-rebase--interactive\n /git-rebase--preserve-merges\ndiff --git a/Makefile b/Makefile\nindex f965509b3c..9370d85ff3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -624,7 +624,6 @@ SCRIPT_SH += git-web--browse.sh\n \n SCRIPT_LIB += git-mergetool--lib\n SCRIPT_LIB += git-parse-remote\n-SCRIPT_LIB += git-rebase--am\n SCRIPT_LIB += git-rebase--common\n SCRIPT_LIB += git-rebase--preserve-merges\n SCRIPT_LIB += git-sh-setup\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex ba3a574e40..d5f6f403e2 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -1153,10 +1153,6 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)\n \t}\n \n \tswitch (opts->type) {\n-\tcase REBASE_AM:\n-\t\tbackend = \"git-rebase--am\";\n-\t\tbackend_func = \"git_rebase__am\";\n-\t\tbreak;\n \tcase REBASE_PRESERVE_MERGES:\n \t\tbackend = \"git-rebase--preserve-merges\";\n \t\tbackend_func = \"git_rebase__preserve_merges\";\ndiff --git a/git-rebase--am.sh b/git-rebase--am.sh\ndeleted file mode 100644\nindex 6416716ee6..0000000000\n--- a/git-rebase--am.sh\n+++ /dev/null\n@@ -1,85 +0,0 @@\n-# This shell script fragment is sourced by git-rebase to implement\n-# its default, fast, patch-based, non-interactive mode.\n-#\n-# Copyright (c) 2010 Junio C Hamano.\n-#\n-\n-git_rebase__am () {\n-\n-case \"$action\" in\n-continue)\n-\tgit am --resolved --resolvemsg=\"$resolvemsg\" \\\n-\t\t${gpg_sign_opt:+\"$gpg_sign_opt\"} &&\n-\tmove_to_original_branch\n-\treturn\n-\t;;\n-skip)\n-\tgit am --skip --resolvemsg=\"$resolvemsg\" &&\n-\tmove_to_original_branch\n-\treturn\n-\t;;\n-show-current-patch)\n-\texec git am --show-current-patch\n-\t;;\n-esac\n-\n-if test -z \"$rebase_root\"\n-\t# this is now equivalent to ! -z \"$upstream\"\n-then\n-\trevisions=$upstream...$orig_head\n-else\n-\trevisions=$onto...$orig_head\n-fi\n-\n-ret=0\n-rm -f \"$GIT_DIR/rebased-patches\"\n-\n-git format-patch -k --stdout --full-index --cherry-pick --right-only \\\n-\t--src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \\\n-\t--pretty=mboxrd --topo-order \\\n-\t$git_format_patch_opt \\\n-\t\"$revisions\" ${restrict_revision+^$restrict_revision} \\\n-\t>\"$GIT_DIR/rebased-patches\"\n-ret=$?\n-\n-if test 0 != $ret\n-then\n-\trm -f \"$GIT_DIR/rebased-patches\"\n-\tcase \"$head_name\" in\n-\trefs/heads/*)\n-\t\tgit checkout -q \"$head_name\"\n-\t\t;;\n-\t*)\n-\t\tgit checkout -q \"$orig_head\"\n-\t\t;;\n-\tesac\n-\n-\tcat >&2 <<-EOF\n-\n-\tgit encountered an error while preparing the patches to replay\n-\tthese revisions:\n-\n-\t    $revisions\n-\n-\tAs a result, git cannot rebase them.\n-\tEOF\n-\treturn $ret\n-fi\n-\n-git am $git_am_opt --rebasing --resolvemsg=\"$resolvemsg\" \\\n-\t--patch-format=mboxrd \\\n-\t$allow_rerere_autoupdate \\\n-\t${gpg_sign_opt:+\"$gpg_sign_opt\"} <\"$GIT_DIR/rebased-patches\"\n-ret=$?\n-\n-rm -f \"$GIT_DIR/rebased-patches\"\n-\n-if test 0 != $ret\n-then\n-\ttest -d \"$state_dir\" && write_basic_state\n-\treturn $ret\n-fi\n-\n-move_to_original_branch\n-\n-}\n-- \ngitgitgadget\n\n"},{"id":"375508","messageId":"b9d1fd14c8ff9cd649a348941f83ec832232eef3.1557832949.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":"pull.194.git.gitgitgadget@gmail.com","subject":"[PATCH 2/5] t3400: stop referring to the scripted rebase","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:31Z","receivedAt":"2019-05-14T11:22:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nOne test case's title mentioned the then-current implementation detail\nthat the `--am` backend was implemented in `git-rebase--am.sh`.\n\nThis is no longer the case, so let's update the title to reflect the\ncurrent reality.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t3400-rebase.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 42f147858d..80b23fd326 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -285,7 +285,7 @@ EOF\n \ttest_cmp From_.msg out\n '\n \n-test_expect_success 'rebase--am.sh and --show-current-patch' '\n+test_expect_success 'rebase --am and --show-current-patch' '\n \ttest_create_repo conflict-apply &&\n \t(\n \t\tcd conflict-apply &&\n-- \ngitgitgadget\n\n"},{"id":"375509","messageId":"70af172e052e62abbf767c21b7d90d70bd69dbbb.1557832949.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":"pull.194.git.gitgitgadget@gmail.com","subject":"[PATCH 5/5] rebase: fold git-rebase--common into the -p backend","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:34Z","receivedAt":"2019-05-14T11:22:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe only remaining scripted part of `git rebase` is the\n`--preserve-merges` backend. Meaning: there is little reason to keep the\n\"library of common rebase functions\" as a separate file.\n\nWhile moving the functions to `git-rebase--preserve-merges.sh`, we also\ndrop the `move_to_original_branch` function that is no longer used.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore                     |  1 -\n Makefile                       |  1 -\n builtin/rebase.c               |  3 +-\n git-rebase--common.sh          | 69 ----------------------------------\n git-rebase--preserve-merges.sh | 55 +++++++++++++++++++++++++++\n 5 files changed, 56 insertions(+), 73 deletions(-)\n delete mode 100644 git-rebase--common.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex bcee4fda81..4470d7cfc0 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -122,7 +122,6 @@\n /git-range-diff\n /git-read-tree\n /git-rebase\n-/git-rebase--common\n /git-rebase--preserve-merges\n /git-receive-pack\n /git-reflog\ndiff --git a/Makefile b/Makefile\nindex 9370d85ff3..9fc617e38f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -624,7 +624,6 @@ SCRIPT_SH += git-web--browse.sh\n \n SCRIPT_LIB += git-mergetool--lib\n SCRIPT_LIB += git-parse-remote\n-SCRIPT_LIB += git-rebase--common\n SCRIPT_LIB += git-rebase--preserve-merges\n SCRIPT_LIB += git-sh-setup\n SCRIPT_LIB += git-sh-i18n\ndiff --git a/builtin/rebase.c b/builtin/rebase.c\nindex d5f6f403e2..9c52144fc4 100644\n--- a/builtin/rebase.c\n+++ b/builtin/rebase.c\n@@ -1163,8 +1163,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)\n \t}\n \n \tstrbuf_addf(&script_snippet,\n-\t\t    \". git-sh-setup && . git-rebase--common &&\"\n-\t\t    \" . %s && %s\", backend, backend_func);\n+\t\t    \". git-sh-setup && . %s && %s\", backend, backend_func);\n \targv[0] = script_snippet.buf;\n \n \tstatus = run_command_v_opt(argv, RUN_USING_SHELL);\ndiff --git a/git-rebase--common.sh b/git-rebase--common.sh\ndeleted file mode 100644\nindex f00e13e5d0..0000000000\n--- a/git-rebase--common.sh\n+++ /dev/null\n@@ -1,69 +0,0 @@\n-\n-resolvemsg=\"\n-$(gettext 'Resolve all conflicts manually, mark them as resolved with\n-\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n-You can instead skip this commit: run \"git rebase --skip\".\n-To abort and get back to the state before \"git rebase\", run \"git rebase --abort\".')\n-\"\n-\n-write_basic_state () {\n-\techo \"$head_name\" > \"$state_dir\"/head-name &&\n-\techo \"$onto\" > \"$state_dir\"/onto &&\n-\techo \"$orig_head\" > \"$state_dir\"/orig-head &&\n-\ttest t = \"$GIT_QUIET\" && : > \"$state_dir\"/quiet\n-\ttest t = \"$verbose\" && : > \"$state_dir\"/verbose\n-\ttest -n \"$strategy\" && echo \"$strategy\" > \"$state_dir\"/strategy\n-\ttest -n \"$strategy_opts\" && echo \"$strategy_opts\" > \\\n-\t\t\"$state_dir\"/strategy_opts\n-\ttest -n \"$allow_rerere_autoupdate\" && echo \"$allow_rerere_autoupdate\" > \\\n-\t\t\"$state_dir\"/allow_rerere_autoupdate\n-\ttest -n \"$gpg_sign_opt\" && echo \"$gpg_sign_opt\" > \"$state_dir\"/gpg_sign_opt\n-\ttest -n \"$signoff\" && echo \"$signoff\" >\"$state_dir\"/signoff\n-\ttest -n \"$reschedule_failed_exec\" && : > \"$state_dir\"/reschedule-failed-exec\n-}\n-\n-apply_autostash () {\n-\tif test -f \"$state_dir/autostash\"\n-\tthen\n-\t\tstash_sha1=$(cat \"$state_dir/autostash\")\n-\t\tif git stash apply $stash_sha1 >/dev/null 2>&1\n-\t\tthen\n-\t\t\techo \"$(gettext 'Applied autostash.')\" >&2\n-\t\telse\n-\t\t\tgit stash store -m \"autostash\" -q $stash_sha1 ||\n-\t\t\tdie \"$(eval_gettext \"Cannot store \\$stash_sha1\")\"\n-\t\t\tgettext 'Applying autostash resulted in conflicts.\n-Your changes are safe in the stash.\n-You can run \"git stash pop\" or \"git stash drop\" at any time.\n-' >&2\n-\t\tfi\n-\tfi\n-}\n-\n-move_to_original_branch () {\n-\tcase \"$head_name\" in\n-\trefs/*)\n-\t\tmessage=\"rebase finished: $head_name onto $onto\"\n-\t\tgit update-ref -m \"$message\" \\\n-\t\t\t$head_name $(git rev-parse HEAD) $orig_head &&\n-\t\tgit symbolic-ref \\\n-\t\t\t-m \"rebase finished: returning to $head_name\" \\\n-\t\t\tHEAD $head_name ||\n-\t\tdie \"$(eval_gettext \"Could not move back to \\$head_name\")\"\n-\t\t;;\n-\tesac\n-}\n-\n-output () {\n-\tcase \"$verbose\" in\n-\t'')\n-\t\toutput=$(\"$@\" 2>&1 )\n-\t\tstatus=$?\n-\t\ttest $status != 0 && printf \"%s\\n\" \"$output\"\n-\t\treturn $status\n-\t\t;;\n-\t*)\n-\t\t\"$@\"\n-\t\t;;\n-\tesac\n-}\ndiff --git a/git-rebase--preserve-merges.sh b/git-rebase--preserve-merges.sh\nindex afbb65765d..dec90e9af6 100644\n--- a/git-rebase--preserve-merges.sh\n+++ b/git-rebase--preserve-merges.sh\n@@ -77,6 +77,61 @@ rewritten_pending=\"$state_dir\"/rewritten-pending\n # and leaves CR at the end instead.\n cr=$(printf \"\\015\")\n \n+resolvemsg=\"\n+$(gettext 'Resolve all conflicts manually, mark them as resolved with\n+\"git add/rm <conflicted_files>\", then run \"git rebase --continue\".\n+You can instead skip this commit: run \"git rebase --skip\".\n+To abort and get back to the state before \"git rebase\", run \"git rebase --abort\".')\n+\"\n+\n+write_basic_state () {\n+\techo \"$head_name\" > \"$state_dir\"/head-name &&\n+\techo \"$onto\" > \"$state_dir\"/onto &&\n+\techo \"$orig_head\" > \"$state_dir\"/orig-head &&\n+\ttest t = \"$GIT_QUIET\" && : > \"$state_dir\"/quiet\n+\ttest t = \"$verbose\" && : > \"$state_dir\"/verbose\n+\ttest -n \"$strategy\" && echo \"$strategy\" > \"$state_dir\"/strategy\n+\ttest -n \"$strategy_opts\" && echo \"$strategy_opts\" > \\\n+\t\t\"$state_dir\"/strategy_opts\n+\ttest -n \"$allow_rerere_autoupdate\" && echo \"$allow_rerere_autoupdate\" > \\\n+\t\t\"$state_dir\"/allow_rerere_autoupdate\n+\ttest -n \"$gpg_sign_opt\" && echo \"$gpg_sign_opt\" > \"$state_dir\"/gpg_sign_opt\n+\ttest -n \"$signoff\" && echo \"$signoff\" >\"$state_dir\"/signoff\n+\ttest -n \"$reschedule_failed_exec\" && : > \"$state_dir\"/reschedule-failed-exec\n+}\n+\n+apply_autostash () {\n+\tif test -f \"$state_dir/autostash\"\n+\tthen\n+\t\tstash_sha1=$(cat \"$state_dir/autostash\")\n+\t\tif git stash apply $stash_sha1 >/dev/null 2>&1\n+\t\tthen\n+\t\t\techo \"$(gettext 'Applied autostash.')\" >&2\n+\t\telse\n+\t\t\tgit stash store -m \"autostash\" -q $stash_sha1 ||\n+\t\t\tdie \"$(eval_gettext \"Cannot store \\$stash_sha1\")\"\n+\t\t\tgettext 'Applying autostash resulted in conflicts.\n+Your changes are safe in the stash.\n+You can run \"git stash pop\" or \"git stash drop\" at any time.\n+' >&2\n+\t\tfi\n+\tfi\n+}\n+\n+output () {\n+\tcase \"$verbose\" in\n+\t'')\n+\t\toutput=$(\"$@\" 2>&1 )\n+\t\tstatus=$?\n+\t\ttest $status != 0 && printf \"%s\\n\" \"$output\"\n+\t\treturn $status\n+\t\t;;\n+\t*)\n+\t\t\"$@\"\n+\t\t;;\n+\tesac\n+}\n+\n strategy_args=${strategy:+--strategy=$strategy}\n test -n \"$strategy_opts\" &&\n eval '\n-- \ngitgitgadget\n"},{"id":"375510","messageId":"158ddcc54e17bef25869a742483a6c3c8a6398ed.1557832949.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":"pull.194.git.gitgitgadget@gmail.com","subject":"[PATCH 4/5] sequencer: the `am` and `rebase--interactive` scripts are gone","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:33Z","receivedAt":"2019-05-14T11:22:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nUpdate a code comment that referred to those files as if they were still\nthere.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n sequencer.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex f88a97fb10..334de14542 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -767,7 +767,7 @@ static int parse_key_value_squoted(char *buf, struct string_list *list)\n  *\tGIT_AUTHOR_DATE='$author_date'\n  *\n  * where $author_name, $author_email and $author_date are quoted. We are strict\n- * with our parsing, as the file was meant to be eval'd in the old\n+ * with our parsing, as the file was meant to be eval'd in the now-removed\n  * git-am.sh/git-rebase--interactive.sh scripts, and thus if the file differs\n  * from what this function expects, it is better to bail out than to do\n  * something that the user does not expect.\n-- \ngitgitgadget\n\n"},{"id":"375511","messageId":"ab1fc1ad2ac88360b2edfe6d621d92adc7f9c03c.1557832949.git.gitgitgadget@gmail.com","threadId":"51093","inReplyTo":"pull.194.git.gitgitgadget@gmail.com","subject":"[PATCH 3/5] .gitignore: there is no longer a built-in `git-rebase--interactive`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-05-14T11:22:32Z","receivedAt":"2019-05-14T11:22:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThis went away in 0609b741a4 (rebase -i: combine rebase--interactive.c\nwith rebase.c, 2019-04-17).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitignore | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 875f3fc6e8..bcee4fda81 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -123,7 +123,6 @@\n /git-read-tree\n /git-rebase\n /git-rebase--common\n-/git-rebase--interactive\n /git-rebase--preserve-merges\n /git-receive-pack\n /git-reflog\n-- \ngitgitgadget\n\n"}]}