From 693d179b751baf58cb52e34a3d51e80aa73e6959 Mon Sep 17 00:00:00 2001 Message-Id: <693d179b751baf58cb52e34a3d51e80aa73e6959.1746976087.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 13 Mar 2009 05:15:37 +0100 Subject: [PATCH] stgit.el: Sort patches correctly before merging them in stgit-squash MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Gustav Hållberg Also document stgit-squash more accurately. Signed-off-by: Gustav Hållberg Signed-off-by: Karl Hasselström --- contrib/stgit.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/stgit.el b/contrib/stgit.el index 6af7623..a506797 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -944,17 +944,22 @@ (defun stgit-move-patches (patchsyms target-patch) (defun stgit-squash (patchsyms) "Squash the patches in PATCHSYMS. -Interactively, squash the marked patches." +Interactively, squash the marked patches. + +Unless there are any conflicts, the patches will be merged into +one patch, which will occupy the same spot in the series as the +deepest patch had before the squash." (interactive (list stgit-marked-patches)) (when (< (length patchsyms) 2) (error "Need at least two patches to squash")) (let ((edit-buf (get-buffer-create "*StGit edit*")) - (dir default-directory)) + (dir default-directory) + (sorted-patchsyms (stgit-sort-patches patchsyms))) (log-edit 'stgit-confirm-squash t nil edit-buf) - (set (make-local-variable 'stgit-patchsyms) patchsyms) + (set (make-local-variable 'stgit-patchsyms) sorted-patchsyms) (setq default-directory dir) (let ((standard-output edit-buf)) - (apply 'stgit-run-silent "squash" "--save-template=-" patchsyms)))) + (apply 'stgit-run-silent "squash" "--save-template=-" sorted-patchsyms)))) (defun stgit-confirm-squash () (interactive) -- [mdw]