From: Gustav Hållberg Date: Fri, 13 Mar 2009 04:15:37 +0000 (+0100) Subject: stgit.el: Sort patches correctly before merging them in stgit-squash X-Git-Tag: v0.15-rc1~35 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/693d179b751baf58cb52e34a3d51e80aa73e6959 stgit.el: Sort patches correctly before merging them in stgit-squash Also document stgit-squash more accurately. Signed-off-by: Gustav Hållberg Signed-off-by: Karl Hasselström --- 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 @@ Interactively, move the marked patches to where the point is." (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)