{"thread":{"id":"9012","subject":"[PATCH] Fix git-rebase -i to allow squashing of fast-forwardable commits","startedAt":"2007-07-12T22:30:35Z","lastAt":"2007-07-14T09:53:11Z","messageCount":4,"participants":["Alex Riesen","Junio C Hamano","Andy Parkins","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47213","messageId":"20070712223035.GB30532@steel.home","threadId":"9012","inReplyTo":null,"subject":"[PATCH] Fix git-rebase -i to allow squashing of fast-forwardable commits","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-12T22:30:35Z","receivedAt":"2007-07-12T22:30:35Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Without this change the commits will be left standalone, with\nduplicated commit message.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\nNoticed when trying to blend the second commit in a branch into the\nfirst. Squash didn't work at all (apart from commit message\nduplication).\n\n git-rebase--interactive.sh |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex d9563ec..f395076 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -84,6 +84,7 @@ pick_one () {\n \tcurrent_sha1=$(git rev-parse --verify HEAD)\n \tif [ $current_sha1 = $parent_sha1 ]; then\n \t\tgit reset --hard $sha1\n+\t\ttest \"a$1\" = a-n && git reset --soft $current_sha1\n \t\tsha1=$(git rev-parse --short $sha1)\n \t\twarn Fast forward to $sha1\n \telse\n@@ -193,14 +194,14 @@ do_next () {\n \t\t\tdie \"Cannot 'squash' without a previous commit\"\n \n \t\tmark_action_done\n-\t\tfailed=f\n-\t\tpick_one -n $sha1 || failed=t\n \t\tMSG=\"$DOTEST\"/message\n \t\techo \"# This is a combination of two commits.\" > \"$MSG\"\n \t\techo \"# The first commit's message is:\" >> \"$MSG\"\n \t\techo >> \"$MSG\"\n \t\tgit cat-file commit HEAD | sed -e '1,/^$/d' >> \"$MSG\"\n \t\techo >> \"$MSG\"\n+\t\tfailed=f\n+\t\tpick_one -n $sha1 || failed=t\n \t\techo \"# And this is the 2nd commit message:\" >> \"$MSG\"\n \t\techo >> \"$MSG\"\n \t\tgit cat-file commit $sha1 | sed -e '1,/^$/d' >> \"$MSG\"\n-- \n1.5.3.rc0.116.gc35c1-dirty\n"},{"id":"47314","messageId":"7vejjbmtva.fsf@assigned-by-dhcp.cox.net","threadId":"9012","inReplyTo":"20070712223035.GB30532@steel.home","subject":"Re: [PATCH] Fix git-rebase -i to allow squashing of fast-forwardable commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-14T05:34:01Z","receivedAt":"2007-07-14T05:34:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I think this makes sense.  Thanks for fixing it up.\n"},{"id":"47322","messageId":"200707140809.44619.andyparkins@gmail.com","threadId":"9012","inReplyTo":"7vejjbmtva.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix git-rebase -i to allow squashing of fast-forwardable commits","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-07-14T07:09:43Z","receivedAt":"2007-07-14T07:09:43Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Saturday 2007, July 14, Junio C Hamano wrote:\n> I think this makes sense.  Thanks for fixing it up.\n\nI was experiencing the problem, and this patch fixed it.\n\n\nAcked-by: Andy Parkins\n\n\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"47331","messageId":"Pine.LNX.4.64.0707141052510.14781@racer.site","threadId":"9012","inReplyTo":"20070712223035.GB30532@steel.home","subject":"Re: [PATCH] Fix git-rebase -i to allow squashing of fast-forwardable commits","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-14T09:53:11Z","receivedAt":"2007-07-14T09:53:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 13 Jul 2007, Alex Riesen wrote:\n\n> Without this change the commits will be left standalone, with\n> duplicated commit message.\n\nThanks.\n\nCiao,\nDscho\n"}]}