aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-08-01 21:34:51 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-08-01 21:34:51 +0200
commit96192521703420460020ec9a0470a3f9335b6530 (patch)
treea1c261c838ff9d551e91b7fb5adc04cf65bbea32
parent298771166c42c6fda7e8a01b873a975a360bd793 (diff)
magit-tag-create: No longer use magit-read-tag
This allows dropping the REQUIRE-MATCH argument from `magit-read-tag', because now all its callers do require a match (though some failed to specify so). Keep using completing read when creating a new tag and offer the existing tags as "choices". The idea is that makes it easier to see what tags already exist and pick another name for the new one.
-rw-r--r--lisp/magit-bundle.el2
-rw-r--r--lisp/magit-git.el6
-rw-r--r--lisp/magit-tag.el4
3 files changed, 6 insertions, 6 deletions
diff --git a/lisp/magit-bundle.el b/lisp/magit-bundle.el
index 6e0ae81..7f44d24 100644
--- a/lisp/magit-bundle.el
+++ b/lisp/magit-bundle.el
@@ -99,7 +99,7 @@
;;;###autoload
(defun magit-bundle-update-tracked (tag)
"Update a bundle that is being tracked using TAG."
- (interactive (list (magit-read-tag "Update bundle tracked by tag" t)))
+ (interactive (list (magit-read-tag "Update bundle tracked by tag")))
(let (msg)
(let-alist (magit--with-temp-process-buffer
(save-excursion
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 92290c8..aa9999a 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -2841,9 +2841,9 @@ out. Only existing branches can be selected."
(magit-stash-at-point)
(magit-get-current-branch)))
-(defun magit-read-tag (prompt &optional require-match)
- (magit-completing-read prompt (magit-list-tags) nil
- require-match nil 'magit-revision-history
+(defun magit-read-tag (prompt)
+ (magit-completing-read prompt (magit-list-tags) nil t nil
+ 'magit-revision-history
(magit-tag-at-point)))
(defun magit-read-stash (prompt)
diff --git a/lisp/magit-tag.el b/lisp/magit-tag.el
index a696686..d7e1800 100644
--- a/lisp/magit-tag.el
+++ b/lisp/magit-tag.el
@@ -66,7 +66,7 @@
"Create a new tag with the given NAME at COMMIT.
With a prefix argument annotate the tag.
\n(git tag [--annotate] NAME REV)"
- (interactive (list (magit-read-tag "Tag name")
+ (interactive (list (magit-completing-read "Create tag" (magit-list-tags))
(magit-read-branch-or-commit "Place tag on")
(let ((args (magit-tag-arguments)))
(when current-prefix-arg
@@ -84,7 +84,7 @@ defaulting to the tag at point.
(interactive (list (if-let ((tags (magit-region-values 'tag)))
(magit-confirm t nil "Delete %d tags" nil tags)
(let ((helm-comp-read-use-marked t))
- (magit-read-tag "Delete tag" t)))))
+ (magit-read-tag "Delete tag")))))
(magit-run-git "tag" "-d" tags))
;;;###autoload