summaryrefslogtreecommitdiff
path: root/lisp/km-magit.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-12-11 23:10:37 -0500
committerKyle Meyer <kyle@kyleam.com>2016-12-11 23:10:37 -0500
commit3f39a58cf419a11ac01f1f9f8fba6919186f9e2b (patch)
treea04fc6bd428242787ae31aef34d2a20a93e0b9a3 /lisp/km-magit.el
parentd92771c8a3373ca48c9976a94838b280e330093a (diff)
downloademacs.d-3f39a58cf419a11ac01f1f9f8fba6919186f9e2b.tar.gz
Remove km/magit-refs-filter-recent command
I'm not sure why I preferred this to using --sort=-committerdate in the magit-show-refs-popup.
Diffstat (limited to 'lisp/km-magit.el')
-rw-r--r--lisp/km-magit.el34
1 files changed, 0 insertions, 34 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index d4af9d3..cba378d 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -211,40 +211,6 @@ date."
(magit-completing-read
"Ref" (km/magit-list-recent-refs n 'remote))))
-(defun km/magit-refs-filter-recent (n)
- "Limit branch list to N most recent.
-Warning: I find this useful, but it's a hack that breaks
-magit-section-backward and probably other things. Hit `g` to
-refresh the buffer, and all should be right again."
- (interactive (list (or (and current-prefix-arg
- (prefix-numeric-value current-prefix-arg))
- 5)))
- (unless (derived-mode-p 'magit-refs-mode)
- (user-error "Not in Magit Refs mode"))
- (let ((sec (magit-current-section))
- remote refs line-sec)
- (when (eq (magit-section-type sec) 'branch)
- (setq sec (magit-section-parent sec)))
- (when (eq (magit-section-type sec) 'remote)
- (setq remote (magit-section-value sec)))
- (setq refs
- (magit-git-lines
- "for-each-ref" "--sort=-committerdate" "--format=%(refname:short)"
- (format "--count=%s" n)
- (if remote (format "refs/remotes/%s" remote) "refs/heads")))
- (save-excursion
- (save-restriction
- (narrow-to-region (magit-section-content sec) (magit-section-end sec))
- (goto-char (point-min))
- (while (and (not (eobp))
- (setq line-sec (magit-current-section))
- (eq (magit-section-type line-sec) 'branch))
- (if (member (magit-section-value line-sec) refs)
- (forward-line 1)
- (let ((inhibit-read-only t))
- (delete-region (magit-section-start line-sec)
- (magit-section-end line-sec)))))))))
-
(defun km/magit-checkout-master ()
"Checkout master branch.
\n(git checkout master)"