[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gited 3aa8b40 07/73: Mark branches by last commit time
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gited 3aa8b40 07/73: Mark branches by last commit time |
Date: |
Sun, 29 Nov 2020 00:00:28 -0500 (EST) |
branch: externals/gited
commit 3aa8b409f2ca6593cec1b6738c760f708e8b7a6c
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>
Mark branches by last commit time
Add command to mark all branches whose last commit time
was after MIN-TIME.
* gited.el (gited-mark-branches-by-date): New command; bind it to '% t'.
---
gited.el | 31 ++++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/gited.el b/gited.el
index 50ab824..b262531 100644
--- a/gited.el
+++ b/gited.el
@@ -10,9 +10,9 @@
;; Compatibility: GNU Emacs: 24.4
;; Version: 0.2.0
;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Mon Jun 05 20:40:08 JST 2017
+;; Last-Updated: Mon Jun 05 21:58:11 JST 2017
;; By: calancha
-;; Update #: 639
+;; Update #: 640
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -117,7 +117,8 @@
;; `gited-goto-first-branch', `gited-goto-last-branch',
;; `gited-kill-line', `gited-list-branches',
;; `gited-log', `gited-log-last-n-commits',
-;; `gited-mark', `gited-mark-branches-containing-commit',
+;; `gited-mark', `gited-mark-branches-by-date',
+;; `gited-mark-branches-containing-commit',
;; `gited-mark-branches-containing-regexp', `gited-mark-branches-regexp',
;; `gited-mark-merged-branches', `gited-mark-unmerged-branches',
;; `gited-merge-branch', `gited-move-to-author',
@@ -2763,6 +2764,29 @@ A prefix argument means to unmark them instead."
(and fn (string-match-p regexp fn))))
"matching branch")))
+(defun gited-mark-branches-by-date (min-time &optional marker-char)
+ "Mark all branches whose last commit time was after MIN-TIME.
+Interactively, a prefix argument means to unmark them instead.
+MIN-TIME must be a string suitable for `date-to-time' like
+\"2017-06-05 20:32:32\"."
+ (interactive
+ (let* ((prefix current-prefix-arg)
+ ;; Default to 1 week before the last commit time in current row.
+ (default (format-time-string
+ "%F %T"
+ (time-subtract (date-to-time (gited-get-date)) (* 7 24 60
60))))
+ (min-time (read-string
+ (concat (if current-prefix-arg "Unmark" "Mark")
+ " branches with last commit after time: ")
+ default)))
+ (list min-time (and prefix ?\s))))
+ (let ((gited-marker-char (or marker-char gited-marker-char)))
+ (gited-mark-if
+ (and (not (eolp))
+ (let ((commit-time (date-to-time (gited-get-date))))
+ (time-less-p (date-to-time min-time) commit-time)))
+ "matching branch")))
+
(defun gited-mark-branches-containing-regexp (regexp &optional marker-char
days)
"Mark all branches containing REGEXP in some commit message.
A prefix argument means to unmark them instead.
@@ -3090,6 +3114,7 @@ in the active region."
;; marking banches
(define-key map (kbd "m") 'gited-mark)
(define-key map (kbd "% n") 'gited-mark-branches-regexp)
+ (define-key map (kbd "% t") 'gited-mark-branches-by-date)
(define-key map (kbd "% c") 'gited-mark-branches-containing-commit)
(define-key map (kbd "% g") 'gited-mark-branches-containing-regexp)
(define-key map (kbd "% m") 'gited-mark-merged-branches)
- [elpa] branch externals/gited created (now 0306980), Stefan Monnier, 2020/11/29
- [elpa] externals/gited 51dc076 14/73: * gited.el (gited-remote-repository-p): Don't include origin in regexp., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 54fb489 10/73: gited-mark-branches-by-date: Provide defaults to HH:MM:SS., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 84a449a 15/73: * gited.el (gited--fill-branch-alist): Fix typo in progress reporter., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 00ef7a4 16/73: * gited.el (gited-move-to-branchname): NOOP when gited-branch-alist is nil., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 3aa8b40 07/73: Mark branches by last commit time,
Stefan Monnier <=
- [elpa] externals/gited 75e0556 08/73: Don't ask deletion confirmation when gited-expert is non-nil, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 0be4308 12/73: Prefer user-error on errors with origin in the user, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 44498a6 22/73: Add commands to add/delete tags, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 37fe689 25/73: * gited.el (gited--fill-branch-alist): Silence harmless warning., Stefan Monnier, 2020/11/29
- [elpa] externals/gited d26d8c4 11/73: Simplify code using gited-branch-exists-p, Stefan Monnier, 2020/11/29
- [elpa] externals/gited d928e5f 29/73: * screenshots/gited-tags-screenshot.png: Update screenshot., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 790c20c 09/73: gited-mark-branches-by-date: Use less verbose default, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 046dffd 20/73: Update documentation, Stefan Monnier, 2020/11/29
- [elpa] externals/gited 5f57f01 21/73: * gited.el (gited-mode-map): Use prefix '* s' for all stash commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gited 8db1633 04/73: gited-update: Don't overwrite `tabulated-list-sort-key', Stefan Monnier, 2020/11/29