From 3f39a58cf419a11ac01f1f9f8fba6919186f9e2b Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 11 Dec 2016 23:10:37 -0500 Subject: 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. --- lisp/km-magit.el | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'lisp/km-magit.el') 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)" -- cgit v1.2.3