aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-05-11 22:55:09 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-05-11 22:55:09 +0200
commit4fc60fdb36b74baca7421719f3a2e203ed16e6ed (patch)
tree6b1ea15dd3801901523bfccf3d668a14d8b9d6cb /lisp
parent621e69eb9bc3379511d5e6b8bb82094ef8e71cfa (diff)
magit-rebase--todo: Deal with duplicated commits
Closes #5365.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-sequence.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index 1b3d08e..e2fe295 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -1004,7 +1004,7 @@ status buffer (i.e., the reverse of how they will be applied)."
(forward-line)))
(let ((abbrevs
(magit-git-lines
- "log" "--no-walk" "--format=%h"
+ "log" "--no-walk" "--format=%H %h"
(mapcar (lambda (obj)
(if (eq (oref obj action) 'merge)
(let ((options (oref obj action-options)))
@@ -1012,9 +1012,13 @@ status buffer (i.e., the reverse of how they will be applied)."
(match-string 1 options)))
(oref obj target)))
commits))))
- (while-let ((obj (pop commits))
- (val (pop abbrevs)))
- (oset obj abbrev val)))
+ (while-let ((obj (pop commits)))
+ (let* ((rev (oref obj target))
+ (elt (assoc rev abbrevs)))
+ (cond (elt
+ (setq abbrevs (delq elt abbrevs))
+ (oset obj abbrev (cadr elt)))
+ ((oset obj abbrev (magit-rev-abbrev rev)))))))
actions))
(defun magit-rebase-insert-merge-sequence (onto)