GNU bug report logs - #32754
vc-retrieve-tag-hook

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Mon, 17 Sep 2018 19:48:01 UTC

Severity: minor

Tags: fixed

Fixed in version 27.1

Done: charles <at> aurox.ch

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32754 in the body.
You can then email your comments to 32754 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32754; Package emacs. (Mon, 17 Sep 2018 19:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to charles <at> aurox.ch (Charles A. Roelli):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 17 Sep 2018 19:48:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: bug-gnu-emacs <at> gnu.org
Subject: vc-retrieve-tag-hook
Date: Mon, 17 Sep 2018 21:49:44 +0200
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".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32754; Package emacs. (Mon, 01 Oct 2018 18:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 32754 <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: 32754 <at> debbugs.gnu.org
Subject: Re: bug#32754: (vc-retrieve-tag-hook)
Date: Mon, 01 Oct 2018 20:25:24 +0200
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"))))
 
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32754; Package emacs. (Mon, 08 Oct 2018 19:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 32754 <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: 32754 <at> debbugs.gnu.org
Subject: Re: bug#32754: (vc-retrieve-tag-hook)
Date: Mon, 08 Oct 2018 21:55:14 +0200
tags 32754 fixed
close 32754 27.1
quit

> Date: Mon, 01 Oct 2018 20:25:24 +0200
> From: charles <at> 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.




Added tag(s) fixed. Request was from charles <at> aurox.ch (Charles A. Roelli) to control <at> debbugs.gnu.org. (Mon, 08 Oct 2018 19:52:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 32754 <at> debbugs.gnu.org and charles <at> aurox.ch (Charles A. Roelli) Request was from charles <at> aurox.ch (Charles A. Roelli) to control <at> debbugs.gnu.org. (Mon, 08 Oct 2018 19:52:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 06 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.