[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got 6ab1c7b 102/145: implement the tag creation part
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got 6ab1c7b 102/145: implement the tag creation part of vc-got-create-tag |
Date: |
Thu, 9 Sep 2021 15:58:42 -0400 (EDT) |
branch: externals/vc-got
commit 6ab1c7b4401cfbb856b00bb6e6690620a20a52f7
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
implement the tag creation part of vc-got-create-tag
it pops up a log-edit buffer where one can type the tag message and
creates it on C-c C-c.
---
vc-got.el | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index f70e048..fadebe6 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -89,9 +89,7 @@
;; - mergebase NOT IMPLEMENTED
;;
;; TAG SYSTEM
-;; - create-tag PARTIALLY IMPLEMENTED
-;; figure out how to read a message for the tag; can only create
-;; branches.
+;; - create-tag DONE
;; - retrieve-tag NOT IMPLEMENTED
;;
;; MISCELLANEOUS NOT IMPLEMENTED
@@ -799,15 +797,34 @@ Value is returned as floating point fractional number of
days."
;; Tag system
+(defun vc-got--tag-callback (tag)
+ "`log-edit' callback for `vc-got-create-tag'.
+Creates the TAG using the content of the current buffer."
+ (interactive)
+ (let ((msg (buffer-substring-no-properties (point-min)
+ (point-max))))
+ (with-temp-buffer
+ (unless (zerop (vc-got--call "tag" "-m" msg tag))
+ (error "[vc-got] can't create tag %s: %s" tag (buffer-string))))))
+
(defun vc-got-create-tag (_dir name branchp)
"Attach the tag NAME to the state of the worktree.
-DIR is ignored (tags are global, not per-file).
-If BRANCHP is true, NAME should create a new branch."
+DIR is ignored (tags are global, not per-file). If BRANCHP is
+true, NAME should create a new branch otherwise it will pop-up a
+`log-edit' buffer to provide the tag message."
;; TODO: vc reccomends to ensure that all the file are in a clean
;; state, but is it useful?
(if branchp
(vc-got--branch name)
- (error "[vc-got] create tags is not implemented (yet)")))
+ (let ((buf (get-buffer-create "*vc-got tag*")))
+ (with-current-buffer buf
+ (erase-buffer)
+ (switch-to-buffer buf)
+ (log-edit (lambda ()
+ (interactive)
+ (unwind-protect
+ (vc-got--tag-callback name)
+ (kill-buffer buf))))))))
;; Miscellaneous
- [elpa] externals/vc-got 06d4d37 031/145: add Makefile, (continued)
- [elpa] externals/vc-got 06d4d37 031/145: add Makefile, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ddc59a0 057/145: remove extra parens from vc-got-unregister and fix pcase matchall, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f8a9db5 060/145: fix vc-got-repository-url for checkout of non-bare repos, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 9e01941 078/145: improve vc-dir presentation & document vc-got-stage in README, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a7777ea 079/145: list also staged addition/removals, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 668dc8e 068/145: vc-got--status: handle stage info and filter result, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7a5ead6 061/145: vc-got-repository-url: avoid infinite loops in parsing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 0d57aba 072/145: remove the separator when showing a chunk to stage, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got d346ca6 084/145: ignore ignored files, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 67e0b4d 096/145: add note for the future, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6ab1c7b 102/145: implement the tag creation part of vc-got-create-tag,
ELPA Syncer <=
- [elpa] externals/vc-got 887e069 090/145: make files an optional parameter, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 7726b6c 097/145: silence some checkdoc warnings, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f701269 118/145: require log-edit to avoid a warning, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 241a3b1 111/145: implement unregister, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 0071376 125/145: change the description in the header, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 622993f 117/145: remove vc-got-stage, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 49945a0 105/145: mark ignore and ignore-completion-table as NOT NEEDED, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 807ca5a 120/145: mark completely staged files as 'up-to-date, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 9114bbc 112/145: use wrapper function instead of replicating it, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 01bf4e0 128/145: reword docstring to avoid checkdoc complain, ELPA Syncer, 2021/09/09