git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] rebase: convert revert to squash on autosquash

From
MTMichael S. Tsirkin <mst@redhat.com>
Date
Apr 7, 2016, 15:12 UTC
Message-ID
<1460041965-31526-1-git-send-email-mst@redhat.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 6a766ca..6fc1935 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -777,7 +777,7 @@ rearrange_squash () {
 	do
 		test -z "${format}" || message=$(git log -n 1 --format="%s" ${sha1})
 		case "$message" in
-		"squash! "*|"fixup! "*|"ack! "*)
+		"squash! "*|"fixup! "*|"ack! "*|"Revert \""*)
 			action="${message%%!*}"
 			rest=$message
 			prefix=
@@ -789,6 +789,12 @@ rearrange_squash () {
 					prefix="$prefix${rest%%!*},"
 					rest="${rest#*! }"
 					;;
+				"Revert \""*\")
+					action="squash"
+					prefix="Revert,"
+					rest="${rest#Revert \"}"
+					rest="${rest%%\"}"
+					;;
 				*)
 					break
 					;;
-- 
MST
Next: Johannes Schindelin
Message 1 of 9 in “rebase: convert revert to squash on autosquash”
  1. rebase: convert revert to squash on autosquashMichael S. Tsirkin, Apr 7, 2016
  2. Johannes SchindelinApr 7, 2016
  3. Michael S. TsirkinApr 7, 2016
  4. Johannes SchindelinApr 8, 2016
  5. Matthieu MoyApr 8, 2016
  6. Michael S. TsirkinApr 8, 2016
  7. Michael S. TsirkinApr 8, 2016
  8. Michael S. TsirkinApr 9, 2016
  9. Matthieu MoyApr 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.