# [PATCH] rebase: convert revert to squash on autosquash

1 messages from 2014-10-22 to 2014-10-22. Participants: Michael S. Tsirkin.
Thread: https://gitlist.dev/t/37780

## Michael S. Tsirkin, 2014-10-22 06:57

Subject: [PATCH] rebase: convert revert to squash on autosquash
Message-ID: <1413961009-23466-1-git-send-email-mst@redhat.com>
URL: https://gitlist.dev/e/1413961009-23466-1-git-send-email-mst%40redhat.com

```
Reverts can typically be treated like squash.  Eliminating both the
original commit and the revert would be even nicer, but this seems a bit
harder to implement.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 git-rebase--interactive.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 86edac7..a82bbdf 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -745,7 +745,7 @@ rearrange_squash () {
 	while read -r pick sha1 message
 	do
 		case "$message" in
-		"squash! "*|"fixup! "*|"ack! "*)
+		"squash! "*|"fixup! "*|"ack! "*|"Revert \""*)
 			action="${message%%!*}"
 			rest=$message
 			prefix=
@@ -757,6 +757,12 @@ rearrange_squash () {
 					prefix="$prefix${rest%%!*},"
 					rest="${rest#*! }"
 					;;
+				"Revert \""*\")
+					action="squash"
+					prefix="Revert,"
+					rest="${rest#Revert \"}"
+					rest="${rest%%\"}"
+					;;
 				*)
 					break
 					;;
-- 
MST

```
