[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 142306e 069/272: counsel.el (counsel-git-stash): New comma
From: |
Oleh Krehel |
Subject: |
[elpa] master 142306e 069/272: counsel.el (counsel-git-stash): New command |
Date: |
Mon, 25 Apr 2016 10:13:17 +0000 |
branch: master
commit 142306edf985e1e641fba08dd00c0cfed70d7760
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-git-stash): New command
* counsel.el (counsel-git-stash-kill-action): New defun.
Fixes #374
---
counsel.el | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/counsel.el b/counsel.el
index d80b5fb..2a6a264 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1522,6 +1522,24 @@ An extra action allows to switch to the process buffer."
("o" counsel-list-processes-action-delete "kill")
("s" counsel-list-processes-action-switch "switch"))))
+(defun counsel-git-stash-kill-action (x)
+ (when (string-match "\\([^:]+\\):" x)
+ (kill-new (message (format "git stash apply %s" (match-string 1 x))))))
+
+;;;###autoload
+(defun counsel-git-stash ()
+ "Search through all available git stashes."
+ (interactive)
+ (let ((dir (locate-dominating-file default-directory ".git")))
+ (if (null dir)
+ (error "Not in a git repository")
+ (let ((cands (split-string (shell-command-to-string
+ "IFS=$'\n'
+for i in `git stash list --format=\"%gd\"`; do
+ git stash show -p $i | grep -H --label=\"$i\" \"$1\"
+done") "\n" t)))
+ (ivy-read "git stash: " cands
+ :action 'counsel-git-stash-kill-action)))))
(provide 'counsel)
;;; counsel.el ends here
- [elpa] master 2877ae1 063/272: ivy.el (ivy-ignore-buffers): New defcustom, (continued)
- [elpa] master 2877ae1 063/272: ivy.el (ivy-ignore-buffers): New defcustom, Oleh Krehel, 2016/04/25
- [elpa] master 480cc85 071/272: README.md: Update, Oleh Krehel, 2016/04/25
- [elpa] master 7b08db8 094/272: ivy.el (ivy-next-history-element): Use "\\_<" instead of "\\b", Oleh Krehel, 2016/04/25
- [elpa] master e94f13e 104/272: counsel.el (counsel-imenu): Add :preselect, Oleh Krehel, 2016/04/25
- [elpa] master 3799d3d 109/272: counsel.el: Shuffle functions and rename headings, Oleh Krehel, 2016/04/25
- [elpa] master 7dd85f5 122/272: counsel.el (counsel--async-sentinel): Recognize error codes other than 1, Oleh Krehel, 2016/04/25
- [elpa] master e85ad2c 116/272: counsel.el (counsel-find-file-ignore-regexp): Fixup :type, Oleh Krehel, 2016/04/25
- [elpa] master b8e373a 127/272: swiper.el (swiper-font-lock-ensure): Don't fail when font-lock is off, Oleh Krehel, 2016/04/25
- [elpa] master d8f04f0 061/272: Add melpa version badge, Oleh Krehel, 2016/04/25
- [elpa] master 00b009e 101/272: ivy.el (ivy-next-line-or-history): Update, Oleh Krehel, 2016/04/25
- [elpa] master 142306e 069/272: counsel.el (counsel-git-stash): New command,
Oleh Krehel <=
- [elpa] master 7869996 102/272: swiper.el: Remove obsolete faces, Oleh Krehel, 2016/04/25
- [elpa] master ded0923 088/272: Customize ivy-occur per command with ivy-set-occur, Oleh Krehel, 2016/04/25
- [elpa] master 0744f57 139/272: counsel.el (counsel-git-grep-occur): Fix greedy-nongreedy bug, Oleh Krehel, 2016/04/25
- [elpa] master 57b6651 118/272: ivy.el: Fix defcustom :type for several variables, Oleh Krehel, 2016/04/25
- [elpa] master 6fbab50 128/272: swiper.el (swiper-all): Now auto-updates position, Oleh Krehel, 2016/04/25
- [elpa] master 26c8246 131/272: counsel.el (counsel-recoll): add unwind, Oleh Krehel, 2016/04/25
- [elpa] master 87da3a2 132/272: counsel.el (counsel-async-split-string-re): New defvar, Oleh Krehel, 2016/04/25
- [elpa] master 9ffa9c7 121/272: ivy.el (ivy--regex): Don't consider \\(?...\) a group, Oleh Krehel, 2016/04/25
- [elpa] master 71bb1c0 144/272: ivy.el (ivy-alt-done): Simplify, Oleh Krehel, 2016/04/25
- [elpa] master e12ff84 125/272: counsel.el (counsel-list-processes-action-switch): Improve, Oleh Krehel, 2016/04/25