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

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

[nongnu] elpa/git-commit c327824 2/2: magit-wip-log-get-tips: Fix retrie


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit c327824 2/2: magit-wip-log-get-tips: Fix retrieval of previous tips
Date: Sun, 22 Aug 2021 00:57:21 -0400 (EDT)

branch: elpa/git-commit
commit c327824b0e739a6d445e00aa4b77965614335540
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    magit-wip-log-get-tips: Fix retrieval of previous tips
    
    magit-wip-update-wipref switched the reflog message from "restart
    autosaving ..." to "start autosaving ..." in 40c06c51 (wipref: Support
    automatic merging of real branch into wip ref, 2018-08-02).
    magit-wip-log-get-tips searches for this message in order to find
    previous tips of the wip refs, but its regular expression wasn't
    updated with that commit.
    
    Teach magit-wip-log-get-tips to look for the new reflog message in
    addition to the old one.  With Git's default gc settings, it's pretty
    unlikely to encounter the old message at this point, but a user may
    have set gc.reflogExpire to "never".
---
 Documentation/RelNotes/3.3.0.org | 5 +++++
 lisp/magit-wip.el                | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/RelNotes/3.3.0.org b/Documentation/RelNotes/3.3.0.org
index 5c49131..4443e07 100644
--- a/Documentation/RelNotes/3.3.0.org
+++ b/Documentation/RelNotes/3.3.0.org
@@ -42,3 +42,8 @@
 
 - In some cases refreshing a buffer caused the cursor to jump to a
   different position.  #4148
+
+- Due to a regression in v2.90.0, ~magit-wip-log~ and
+  ~magit-wip-log-current~ failed to extract the previous tips of the
+  wip refs from the reflog (which is relevant when
+  ~~magit-wip-merge-branch~ is nil).
diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index 2820cab..3f90af0 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -442,7 +442,10 @@ many \"branches\" of each wip ref are shown."
   (when-let ((reflog (magit-git-lines "reflog" wipref)))
     (let (tips)
       (while (and reflog (> count 1))
-        (setq reflog (cl-member "^[^ ]+ [^:]+: restart autosaving"
+        ;; "start autosaving ..." is the current message, but it used
+        ;; to be "restart autosaving ...", and those messages may
+        ;; still be around (e.g., if gc.reflogExpire is to "never").
+        (setq reflog (cl-member "^[^ ]+ [^:]+: \\(?:re\\)?start autosaving"
                                 reflog :test #'string-match-p))
         (when (and (cadr reflog)
                    (string-match "^[^ ]+ \\([^:]+\\)" (cadr reflog)))



reply via email to

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