GNU bug report logs -
#25859
25.1.91; add some branch operations to vc-dir
Previous Next
Reported by: Tom Tromey <tom <at> tromey.com>
Date: Fri, 24 Feb 2017 07:59:02 UTC
Severity: wishlist
Tags: patch
Found in version 25.1.91
Done: Tom Tromey <tom <at> tromey.com>
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 25859 in the body.
You can then email your comments to 25859 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Fri, 24 Feb 2017 07:59:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tom Tromey <tom <at> tromey.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 24 Feb 2017 07:59:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
This adds a few branching operations to vc-dir:
* create a branch
* switch branches
* show the commit log of a branch
* remember the branch history in a -history variable
For the commit log it might nice to show it in a buffer whose name
contains the branch name. There's a similar bug I opened about making
the *vc-change-log* buffer per-vc-dir-directory.
[P (text/x-patch, inline)]
commit 6f9a168c624f20668aa5f32c2926d3690addd543
Author: Tom Tromey <tom <at> tromey.com>
Date: Wed Feb 15 05:19:50 2017 -0700
Add more branch support to vc-dir
* lisp/vc/vc-dir.el (vc-dir-mode-map) Add "B" bindings.
* lisp/vc/vc.el (vc-revision-history): New defvar.
(vc-read-revision): Use vc-revision-history.
(vc-print-branch-log): New function.
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 21bd21e..0363aab 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -297,6 +297,12 @@ vc-dir-mode-map
(define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp)
(define-key map "G" 'vc-dir-ignore)
+ (let ((branch-map (make-sparse-keymap)))
+ (define-key map "B" branch-map)
+ (define-key branch-map "c" 'vc-create-tag)
+ (define-key branch-map "l" 'vc-print-branch-log)
+ (define-key branch-map "s" 'vc-retrieve-tag))
+
;; Hook up the menu.
(define-key map [menu-bar vc-dir-mode]
`(menu-item
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 0c8492d..c5fe8aa 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1757,6 +1757,9 @@ vc-diff-internal
;; because we don't know that yet.
t)))
+(defvar vc-revision-history nil
+ "History for `vc-read-revision'.")
+
(defun vc-read-revision (prompt &optional files backend default initial-input)
(cond
((null files)
@@ -1768,7 +1771,7 @@ vc-read-revision
(vc-call-backend backend 'revision-completion-table files)))
(if completion-table
(completing-read prompt completion-table
- nil nil initial-input nil default)
+ nil nil initial-input 'vc-revision-history default)
(read-string prompt initial-input nil default))))
(defun vc-diff-build-argument-list-internal ()
@@ -2373,6 +2376,17 @@ vc-print-root-log
(vc-print-log-internal backend (list rootdir) nil nil limit)))
;;;###autoload
+(defun vc-print-branch-log (branch)
+ (interactive
+ (list
+ (vc-read-revision "Branch to log: ")))
+ (when (equal branch "")
+ (error "No branch specified"))
+ (vc-print-log-internal (vc-responsible-backend default-directory)
+ (list default-directory) branch t
+ (when (> vc-log-show-limit 0) vc-log-show-limit)))
+
+;;;###autoload
(defun vc-log-incoming (&optional remote-location)
"Show a log of changes that will be received with a pull operation from REMOTE-LOCATION.
When called interactively with a prefix argument, prompt for REMOTE-LOCATION."
[Message part 3 (text/plain, inline)]
Tom
In GNU Emacs 25.1.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.7)
of 2017-02-02 built on bapiya
Repository revision: 7e02a477bbcabb4e65aeecade79b67357c0b9dae
Windowing system distributor 'Fedora Project', version 11.0.11901000
System Description: Fedora release 25 (Twenty Five)
Configured using:
'configure --prefix=/home/tromey/Emacs/install/ --with-modules'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES
Important settings:
value of $LANG: en_US.utf8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Emacs-Lisp
Minor modes in effect:
shell-dirtrack-mode: t
diff-auto-refine-mode: t
flyspell-mode: t
which-function-mode: t
erc-services-mode: t
erc-list-mode: t
erc-menu-mode: t
erc-autojoin-mode: t
erc-ring-mode: t
erc-networks-mode: t
erc-pcomplete-mode: t
erc-track-mode: t
erc-match-mode: t
erc-netsplit-mode: t
erc-hl-nicks-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-stamp-mode: t
erc-irccontrols-mode: t
erc-noncommands-mode: t
erc-move-to-prompt-mode: t
erc-readonly-mode: t
savehist-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
auto-fill-function: do-auto-fill
transient-mark-mode: t
Recent messages:
vc-read-revision
B TAB is undefined
Type C-x 1 to delete the help window.
Making completion list...
Quit
Making completion list...
user-error: Beginning of history; no preceding item
Quit
Mark set
When done with a buffer, type C-x #
Load-path shadows:
/home/tromey/.emacs.d/elpa/debbugs-0.12/debbugs-gnu hides /home/tromey/.emacs.d/elpa/debbugs-0.6/debbugs-gnu
/home/tromey/.emacs.d/elpa/debbugs-0.12/debbugs hides /home/tromey/.emacs.d/elpa/debbugs-0.6/debbugs
/home/tromey/.emacs.d/elpa/debbugs-0.12/debbugs-pkg hides /home/tromey/.emacs.d/elpa/debbugs-0.6/debbugs-pkg
/home/tromey/.emacs.d/elpa/debbugs-0.12/debbugs-autoloads hides /home/tromey/.emacs.d/elpa/debbugs-0.6/debbugs-autoloads
/home/tromey/.emacs.d/elpa/debbugs-0.12/debbugs-org hides /home/tromey/.emacs.d/elpa/debbugs-0.6/debbugs-org
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/25.1.91/lisp/play/bubbles
/home/tromey/.emacs.d/elpa/soap-client-3.1.1/soap-inspect hides /home/tromey/Emacs/install/share/emacs/25.1.91/lisp/net/soap-inspect
/home/tromey/.emacs.d/elpa/soap-client-3.1.1/soap-client hides /home/tromey/Emacs/install/share/emacs/25.1.91/lisp/net/soap-client
Features:
(cmake-mode pcmpl-unix pcmpl-gnu autoconf autoconf-mode tramp-cache
markdown-mode ffap dired-aux nndoc gnus-dup debbugs-gnu debbugs
soap-client rng-xsd rng-dt rng-util xsd-regexp autoload tar-mode
cus-edit highlight-refontification tabify man shadow emacsbug conf-mode
two-column iso-transl perl-mode sh-script executable cal-move nnregistry
python tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize
make-mode etags cursor-sensor mhtml-mode org-bullets org-element
org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view
image-mode org-bibtex bibtex org-bbdb org-w3m org org-macro org-footnote
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint
ob-core ob-eval org-compat org-macs org-loaddefs gnus-fun gnus-draft
noutline outline ido skeleton css-mode smie eww url-queue trace
find-dired descr-text gdb-shell lisp-mnt url-handlers url-http url-gw
url-auth lex edebug debug m4-mode bbdb-sc supercite regi xref project
log-edit js json map sgml-mode flow-fill gnus-html xml url-cache mm-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf eieio-opt speedbar sb-image ezimage dframe find-func
whitespace tcl log-view pcvs-util vc-annotate term/xterm xterm
smerge-mode goto-addr shell find-file idutils derived bug-reference
cc-mode cc-fonts cc-guess cc-menus cc-cmds jka-compr mailalias mail-hist
nnir sort gnus-cite smiley shr-color url-util url-parse url-vars shr dom
subr-x browse-url mm-archive gnus-async gnus-bcklg qp gnus-ml disp-table
gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-mua bbdb-com crm
network-stream nsm starttls gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg nntp gnus-cache gnus-registry registry eieio-compat
eieio-base gnus-art mm-uu mml2015 mm-view mml-smime smime dig mailcap
gnus-sum gnus-group gnus-undo smtpmail gnus-start gnus-cloud nnimap
nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec
gnus-int gnus-range gnus-win gnus gnus-ems nnheader bbdb-message
sendmail mail-extr message idna dired rfc822 mml mml-sec epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev mail-utils gmm-utils mailheader gud dwarf-mode copyright
dabbrev misearch multi-isearch vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs add-log rx vc-git diff-mode easy-mmode rust-mode flyspell
ispell diminish edmacro kmacro projectile grep compile ibuf-ext ibuffer
dash appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
which-func imenu minimap autorevert filenotify cus-start cus-load status
erc-services erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete pcomplete erc-track erc-match erc-netsplit erc-hl-nicks
color erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend
erc-compat format-spec auth-source eieio gnus-util mm-util help-fns
mail-prsvr password-cache thingatpt pp warnings advice vc-dir ewoc vc
vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs bbdb
bbdb-site timezone ange-ftp comint ansi-color ring server savehist
finder-inf dwarf-mode-autoloads gdb-shell-autoloads eieio-core
lisppaste-autoloads pydoc-info-autoloads info-look cl-seq cl-macs cl
weblogger-autoloads info package epg-config seq byte-opt gv bytecomp
byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib
bbdb-loaddefs time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 3515165 445853)
(symbols 48 149617 327)
(miscs 40 38311 18891)
(strings 32 618007 196921)
(string-bytes 1 19106128)
(vectors 16 140689)
(vector-slots 8 3001936 113453)
(floats 8 3870 1815)
(intervals 56 474274 9464)
(buffers 976 535))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Fri, 24 Feb 2017 08:41:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 25859 <at> debbugs.gnu.org (full text, mbox):
> From: Tom Tromey <tom <at> tromey.com>
> Date: Fri, 24 Feb 2017 00:57:34 -0700
>
> This adds a few branching operations to vc-dir:
>
> * create a branch
> * switch branches
> * show the commit log of a branch
> * remember the branch history in a -history variable
Thanks.
This should be mentioned in the manual and in NEWS, I think.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Fri, 24 Feb 2017 14:23:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 25859 <at> debbugs.gnu.org (full text, mbox):
On 24.02.2017 09:57, Tom Tromey wrote:
>
> This adds a few branching operations to vc-dir:
>
> * create a branch
> * switch branches
> * show the commit log of a branch
> * remember the branch history in a -history variable
>
> For the commit log it might nice to show it in a buffer whose name
> contains the branch name. There's a similar bug I opened about making
> the *vc-change-log* buffer per-vc-dir-directory.
Looks great to me, code-wise. Thanks!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Sat, 25 Feb 2017 04:02:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 25859 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli> This should be mentioned in the manual and in NEWS, I think.
How about this?
Tom
[P (text/x-patch, inline)]
commit dcc8e941391fe5abed73e81236ad633d15a39352
Author: Tom Tromey <tom <at> tromey.com>
Date: Wed Feb 15 05:19:50 2017 -0700
Add more branch support to vc-dir
Bug#25858:
* lisp/vc/vc-dir.el (vc-dir-mode-map) Add "B" bindings.
* lisp/vc/vc.el (vc-revision-history): New defvar.
(vc-read-revision): Use vc-revision-history.
(vc-print-branch-log): New function.
* doc/emacs/maintaining.texi (VC Directory Commands): Document new
bindings.
* etc/NEWS: Mention new vc-dir bindings.
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index faaa960..80a4467 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1301,7 +1301,7 @@ VC Directory Commands
The VC Directory buffer also defines some single-key shortcuts for
VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l},
-@kbd{i}, @kbd{D}, @kbd{L}, @kbd{G}, @kbd{I} and @kbd{v}.
+@kbd{i}, @kbd{D}, @kbd{L}, @kbd{G}, @kbd{I}, @kbd{O}, and @kbd{v}.
For example, you can commit a set of edited files by opening a VC
Directory buffer, where the files are listed with the @samp{edited}
@@ -1332,6 +1332,21 @@ VC Directory Commands
Apart from acting on multiple files, these commands behave much like
their single-buffer counterparts (@pxref{Search}).
+ The VC Directory buffer additionally defines some branch-related
+commands starting with the prefix @kbd{B}:
+
+@table @kbd
+@item B c
+Create a new branch (@code{vc-create-tag}).
+
+@item B l
+Prompt for the name of a branch and display the change history of that
+branch (@code{vc-print-branch-log}).
+
+@item B s
+Switch to a branch (@code{vc-retrieve-tag}). @xref{Switching Branches}.
+@end table
+
@cindex stashes in version control
@cindex shelves in version control
The above commands are also available via the menu bar, and via a
diff --git a/etc/NEWS b/etc/NEWS
index 9355dff..c46d7f3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -704,6 +704,10 @@ string is computed dynamically based on 'url-privacy-level'.
colorful faces to make it more obvious to the user what the state is.
See the 'vc-faces' customization group.
+---
+*** 'vc-dir-mode' now has binds 'vc-log-outgoing' to 'O'; and various
+branch-related commands on a keymap bound to 'B'.
+
** CC mode
*** Opening a .h file will turn C or C++ mode depending on language used.
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 21bd21e..0363aab 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -297,6 +297,12 @@ vc-dir-mode-map
(define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp)
(define-key map "G" 'vc-dir-ignore)
+ (let ((branch-map (make-sparse-keymap)))
+ (define-key map "B" branch-map)
+ (define-key branch-map "c" 'vc-create-tag)
+ (define-key branch-map "l" 'vc-print-branch-log)
+ (define-key branch-map "s" 'vc-retrieve-tag))
+
;; Hook up the menu.
(define-key map [menu-bar vc-dir-mode]
`(menu-item
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 0c8492d..c5fe8aa 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1757,6 +1757,9 @@ vc-diff-internal
;; because we don't know that yet.
t)))
+(defvar vc-revision-history nil
+ "History for `vc-read-revision'.")
+
(defun vc-read-revision (prompt &optional files backend default initial-input)
(cond
((null files)
@@ -1768,7 +1771,7 @@ vc-read-revision
(vc-call-backend backend 'revision-completion-table files)))
(if completion-table
(completing-read prompt completion-table
- nil nil initial-input nil default)
+ nil nil initial-input 'vc-revision-history default)
(read-string prompt initial-input nil default))))
(defun vc-diff-build-argument-list-internal ()
@@ -2373,6 +2376,17 @@ vc-print-root-log
(vc-print-log-internal backend (list rootdir) nil nil limit)))
;;;###autoload
+(defun vc-print-branch-log (branch)
+ (interactive
+ (list
+ (vc-read-revision "Branch to log: ")))
+ (when (equal branch "")
+ (error "No branch specified"))
+ (vc-print-log-internal (vc-responsible-backend default-directory)
+ (list default-directory) branch t
+ (when (> vc-log-show-limit 0) vc-log-show-limit)))
+
+;;;###autoload
(defun vc-log-incoming (&optional remote-location)
"Show a log of changes that will be received with a pull operation from REMOTE-LOCATION.
When called interactively with a prefix argument, prompt for REMOTE-LOCATION."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Sat, 25 Feb 2017 04:02:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 25859 <at> debbugs.gnu.org (full text, mbox):
Tom> How about this?
[...]
Tom> Bug#25858:
I had the wrong number in the commit message -- I've updated it already.
Tom
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#25859
; Package
emacs
.
(Sat, 25 Feb 2017 07:41:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 25859 <at> debbugs.gnu.org (full text, mbox):
> From: Tom Tromey <tom <at> tromey.com>
> Cc: Tom Tromey <tom <at> tromey.com>, 25859 <at> debbugs.gnu.org
> Date: Fri, 24 Feb 2017 21:01:03 -0700
>
> Eli> This should be mentioned in the manual and in NEWS, I think.
>
> How about this?
LGTM, thanks.
> diff --git a/etc/NEWS b/etc/NEWS
> index 9355dff..c46d7f3 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -704,6 +704,10 @@ string is computed dynamically based on 'url-privacy-level'.
> colorful faces to make it more obvious to the user what the state is.
> See the 'vc-faces' customization group.
>
> +---
This should be all pluses, since the manual already has this documented.
> +*** 'vc-dir-mode' now has binds 'vc-log-outgoing' to 'O'; and various
^^^ ^
That "has" should be moved to the indicated place.
Reply sent
to
Tom Tromey <tom <at> tromey.com>
:
You have taken responsibility.
(Sat, 25 Feb 2017 17:50:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tom Tromey <tom <at> tromey.com>
:
bug acknowledged by developer.
(Sat, 25 Feb 2017 17:50:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 25859-done <at> debbugs.gnu.org (full text, mbox):
Patch checked in.
Tom
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 26 Mar 2017 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 89 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.