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".
Kyle Meyer
2 years ago
41 | 41 |
|
42 | 42 |
- In some cases refreshing a buffer caused the cursor to jump to a
|
43 | 43 |
different position. #4148
|
|
44 |
|
|
45 |
- Due to a regression in v2.90.0, ~magit-wip-log~ and
|
|
46 |
~magit-wip-log-current~ failed to extract the previous tips of the
|
|
47 |
wip refs from the reflog (which is relevant when
|
|
48 |
~~magit-wip-merge-branch~ is nil).
|
441 | 441 |
(when-let ((reflog (magit-git-lines "reflog" wipref)))
|
442 | 442 |
(let (tips)
|
443 | 443 |
(while (and reflog (> count 1))
|
444 | |
(setq reflog (cl-member "^[^ ]+ [^:]+: restart autosaving"
|
|
444 |
;; "start autosaving ..." is the current message, but it used
|
|
445 |
;; to be "restart autosaving ...", and those messages may
|
|
446 |
;; still be around (e.g., if gc.reflogExpire is to "never").
|
|
447 |
(setq reflog (cl-member "^[^ ]+ [^:]+: \\(?:re\\)?start autosaving"
|
445 | 448 |
reflog :test #'string-match-p))
|
446 | 449 |
(when (and (cadr reflog)
|
447 | 450 |
(string-match "^[^ ]+ \\([^:]+\\)" (cadr reflog)))
|