{"thread":{"id":"37780","subject":"[PATCH] rebase: convert revert to squash on autosquash","startedAt":"2014-10-22T06:57:14Z","lastAt":"2014-10-22T06:57:14Z","messageCount":1,"participants":["Michael S. Tsirkin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"250959","messageId":"1413961009-23466-1-git-send-email-mst@redhat.com","threadId":"37780","inReplyTo":null,"subject":"[PATCH] rebase: convert revert to squash on autosquash","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2014-10-22T06:57:14Z","receivedAt":"2014-10-22T06:57:14Z","isPatch":true,"sender":{"key":"mst@kernel.org","avatar":null},"body":"Reverts can typically be treated like squash.  Eliminating both the\noriginal commit and the revert would be even nicer, but this seems a bit\nharder to implement.\n\nSigned-off-by: Michael S. Tsirkin <mst@redhat.com>\n---\n git-rebase--interactive.sh | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 86edac7..a82bbdf 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -745,7 +745,7 @@ rearrange_squash () {\n \twhile read -r pick sha1 message\n \tdo\n \t\tcase \"$message\" in\n-\t\t\"squash! \"*|\"fixup! \"*|\"ack! \"*)\n+\t\t\"squash! \"*|\"fixup! \"*|\"ack! \"*|\"Revert \\\"\"*)\n \t\t\taction=\"${message%%!*}\"\n \t\t\trest=$message\n \t\t\tprefix=\n@@ -757,6 +757,12 @@ rearrange_squash () {\n \t\t\t\t\tprefix=\"$prefix${rest%%!*},\"\n \t\t\t\t\trest=\"${rest#*! }\"\n \t\t\t\t\t;;\n+\t\t\t\t\"Revert \\\"\"*\\\")\n+\t\t\t\t\taction=\"squash\"\n+\t\t\t\t\tprefix=\"Revert,\"\n+\t\t\t\t\trest=\"${rest#Revert \\\"}\"\n+\t\t\t\t\trest=\"${rest%%\\\"}\"\n+\t\t\t\t\t;;\n \t\t\t\t*)\n \t\t\t\t\tbreak\n \t\t\t\t\t;;\n-- \nMST\n"}]}