emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/magit e4e46a775d 5/8: magit-format-ref-labels: Remove anci


From: Jonas Bernoulli
Subject: [nongnu] elpa/magit e4e46a775d 5/8: magit-format-ref-labels: Remove ancient kludge
Date: Mon, 23 Dec 2024 16:44:26 -0500 (EST)

branch: elpa/magit
commit e4e46a775de6884cd2b92838b815bb5398c9aa9a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-format-ref-labels: Remove ancient kludge
    
    Remove an ancient kludge, added in [1: 1314554cf4].
    Since TODO `--simplify-by-decoration' no longer causes the `full'
    in `--decorate=full' to be ignored.
    
    1: 2015-01-22 1314554cf40e48bfc391d8392bb97e382ec0b1a5
       magit-log-popup: add --simplify-by-decoration
---
 lisp/magit-git.el | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index d0afadc983..5b483e5094 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2302,24 +2302,11 @@ and this option only controls what face is used.")
 
 (defun magit-format-ref-labels (string)
   (save-match-data
-    (let ((regexp "\\(, \\|tag: \\|HEAD -> \\)")
-          names)
-      (if (and (derived-mode-p 'magit-log-mode)
-               (member "--simplify-by-decoration" magit-buffer-log-args))
-          (let ((branches (magit-list-local-branch-names))
-                (re (format "^%s/.+" (regexp-opt (magit-list-remotes)))))
-            (setq names
-                  (--map (cond ((string-equal it "HEAD")     it)
-                               ((string-prefix-p "refs/" it) it)
-                               ((member it branches) (concat "refs/heads/" it))
-                               ((string-match re it) (concat "refs/remotes/" 
it))
-                               (t                    (concat "refs/" it)))
-                         (split-string
-                          (string-replace "tag: " "refs/tags/" string)
-                          regexp t))))
-        (setq names (split-string string regexp t)))
+    (let ((refs (split-string
+                 (replace-regexp-in-string "\\(tag: \\|HEAD -> \\)" "" string)
+                 ", " t)))
       (let (state head upstream tags branches remotes other combined)
-        (dolist (ref names)
+        (dolist (ref refs)
           (let* ((face (cdr (--first (string-match (car it) ref)
                                      magit-ref-namespaces)))
                  (name (magit--propertize-face



reply via email to

[Prev in Thread] Current Thread [Next in Thread]