{"thread":{"id":"1672","subject":"[PATCH] Use \"git cherry-pick\" in \"git rebase\"","startedAt":"2005-08-27T01:19:02Z","lastAt":"2005-08-27T01:19:02Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"7832","messageId":"7vacj489dl.fsf@assigned-by-dhcp.cox.net","threadId":"1672","inReplyTo":null,"subject":"[PATCH] Use \"git cherry-pick\" in \"git rebase\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-27T01:19:02Z","receivedAt":"2005-08-27T01:19:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rewrite \"git rebase\" using \"git cherry-pick\".\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n git-rebase-script |   16 ++++++++++------\n 1 files changed, 10 insertions(+), 6 deletions(-)\n\n913404ae6371857c21c696cc3d8b0a04421fdeb2\ndiff --git a/git-rebase-script b/git-rebase-script\n--- a/git-rebase-script\n+++ b/git-rebase-script\n@@ -37,7 +37,7 @@ git-rev-parse --verify \"$upstream^0\" >\"$\n \n tmp=.rebase-tmp$$\n fail=$tmp-fail\n-trap \"rm -rf $tmp-*\" 0 1 2 3 15\n+trap \"rm -rf $tmp-*\" 1 2 3 15\n \n >$fail\n \n@@ -48,14 +48,18 @@ do\n \t-) continue ;;\n \tesac\n \tS=`cat \"$GIT_DIR/HEAD\"` &&\n-        GIT_EXTERNAL_DIFF=git-apply-patch-script git-diff-tree -p $commit &&\n-\tgit-commit-script -C \"$commit\" || {\n+\tgit-cherry-pick-script --replay $commit || {\n+\t\techo >&2 \"* Not applying the patch and continuing.\"\n \t\techo $commit >>$fail\n-\t\tgit-read-tree --reset -u $S\n+\t\tgit-reset-script --hard $S\n \t}\n done\n if test -s $fail\n then\n-\techo Some commits could not be rebased, check by hand:\n-\tcat $fail\n+\techo >&2 Some commits could not be rebased, check by hand:\n+\tcat >&2 $fail\n+\techo >&2 \"(the same list of commits are found in $tmp)\"\n+\texit 1\n+else\n+\trm -f $fail\n fi\n"}]}