all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32754: vc-retrieve-tag-hook
@ 2018-09-17 19:49 Charles A. Roelli
       [not found] ` <handler.32754.B.153721366722844.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Charles A. Roelli @ 2018-09-17 19:49 UTC (permalink / raw)
  To: 32754

We have this hook in vc.el:

;;;###autoload
(defcustom vc-checkout-hook nil
  "Normal hook (list of functions) run after checking out a file.
See `run-hooks'."
  :type 'hook
  :group 'vc
  :version "21.1")

It does not seem to run when you retrieve a tag or branch with C-x v r
with the vc-git backend, and correctly so (I think), as the docstring
mentions that it should only run after checking out a file, not a tag
or branch.  I suggest adding a hook to run at the end of
vc-retrieve-tag, named "vc-retrieve-tag-hook".





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#32754: (vc-retrieve-tag-hook)
       [not found] ` <handler.32754.B.153721366722844.ack@debbugs.gnu.org>
@ 2018-10-01 18:25   ` Charles A. Roelli
  2018-10-08 19:55     ` Charles A. Roelli
  0 siblings, 1 reply; 3+ messages in thread
From: Charles A. Roelli @ 2018-10-01 18:25 UTC (permalink / raw)
  To: 32754

Here's the patch for review.  Hooks in VC are documented only in
vc.el, so I have not added further documentation elsewhere.



diff --git a/etc/NEWS b/etc/NEWS
index daacf49..1d5820c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -329,6 +329,8 @@ git-grep when 'vc-git-grep' is used.
 When some files are marked, only those are stashed.
 When no files are marked, all modified files are stashed, as before.
 
+*** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag.
+
 ** diff-mode
 *** Hunks are now automatically refined by default.
 To disable it, set the new defcustom 'diff-font-lock-refine' to nil.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index d3d66d6..243a796 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -834,6 +834,13 @@ vc-before-checkin-hook
   :type 'hook
   :group 'vc)
 
+;;;###autoload
+(defcustom vc-retrieve-tag-hook nil
+  "Normal hook (list of functions) run after retrieving a tag."
+  :type 'hook
+  :group 'vc
+  :version "27.1")
+
 (defcustom vc-revert-show-diff t
   "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying."
   :type 'boolean
@@ -2154,7 +2161,8 @@ vc-retrieve-tag
 If NAME is empty, it refers to the latest revisions of the current branch.
 If locking is used for the files in DIR, then there must not be any
 locked files at or below DIR (but if NAME is empty, locked files are
-allowed and simply skipped)."
+allowed and simply skipped).
+This function runs the hook `vc-retrieve-tag-hook' when finished."
   (interactive
    (let* ((granularity
            (vc-call-backend (vc-responsible-backend default-directory)
@@ -2181,6 +2189,7 @@ vc-retrieve-tag
     (vc-call-backend (vc-responsible-backend dir)
 		     'retrieve-tag dir name update)
     (vc-resynch-buffer dir t t t)
+    (run-hooks 'vc-retrieve-tag-hook)
     (message "%s" (concat msg "done"))))
 
 





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#32754: (vc-retrieve-tag-hook)
  2018-10-01 18:25   ` bug#32754: (vc-retrieve-tag-hook) Charles A. Roelli
@ 2018-10-08 19:55     ` Charles A. Roelli
  0 siblings, 0 replies; 3+ messages in thread
From: Charles A. Roelli @ 2018-10-08 19:55 UTC (permalink / raw)
  To: 32754

tags 32754 fixed
close 32754 27.1
quit

> Date: Mon, 01 Oct 2018 20:25:24 +0200
> From: charles@aurox.ch (Charles A. Roelli)
> 
> Here's the patch for review.  Hooks in VC are documented only in
> vc.el, so I have not added further documentation elsewhere.
>
> [...]

I've pushed this as commit 76372161.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-08 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-17 19:49 bug#32754: vc-retrieve-tag-hook Charles A. Roelli
     [not found] ` <handler.32754.B.153721366722844.ack@debbugs.gnu.org>
2018-10-01 18:25   ` bug#32754: (vc-retrieve-tag-hook) Charles A. Roelli
2018-10-08 19:55     ` Charles A. Roelli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.