* bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better
@ 2013-10-09 9:06 João Távora
2013-10-10 0:35 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: João Távora @ 2013-10-09 9:06 UTC (permalink / raw)
To: 15569
Hello maintainters,
I noticed that, in a git repository, using C-u M-x vc-ediff on a single
file (a very useful command) could use a slight improvement.
You see, using C-u prompts the users for two revisions. I mostly choose
to use an ancient revision for A and the "current revision" for B. And
thats the default, which is fine.
But there is a catch. If I've not yet touched the file I'm vc-ediff'ing,
then buffer B will not be the actual buffer I'm working on, but a
read-only copy of it, which is not good for copying content over from A
to B using the ediff keys "A" and "B".
The workaround I and my colleagues currently use is to add some random
change to the file to make sure vc-ediff suggests "current source" as
the revision for B. But this is kinda akward.
I've found that the following patch fixes this behaviour, and still
makes sense to me.
João
z:/Vendor/cygwin/bin/diff.exe -c "--label" "z:/Vendor/emacs-24.3.5/share/emacs/24.3.50/lisp/vc/vc.el" "--label" "#<buffer vc.el>" "z:/Vendor/emacs-24.3.5/share/emacs/24.3.50/lisp/vc/vc.el" "c:/temp/buffer-content-5840WVj"
*** z:/Vendor/emacs-24.3.5/share/emacs/24.3.50/lisp/vc/vc.el
--- #<buffer vc.el>
***************
*** 1735,1747 ****
;; if the file is not up-to-date, use working revision as older revision
((not (vc-up-to-date-p first))
(setq rev1-default (vc-working-revision first)))
! ;; if the file is not locked, use last and previous revisions as defaults
(t
(setq rev1-default (ignore-errors ;If `previous-revision' doesn't work.
(vc-call-backend backend 'previous-revision first
(vc-working-revision first))))
! (when (string= rev1-default "") (setq rev1-default nil))
! (setq rev2-default (vc-working-revision first))))
;; construct argument list
(let* ((rev1-prompt (if rev1-default
(concat "Older revision (default "
--- 1735,1746 ----
;; if the file is not up-to-date, use working revision as older revision
((not (vc-up-to-date-p first))
(setq rev1-default (vc-working-revision first)))
! ;; if the file is not locked, use last revision and current source as defaults
(t
(setq rev1-default (ignore-errors ;If `previous-revision' doesn't work.
(vc-call-backend backend 'previous-revision first
(vc-working-revision first))))
! (when (string= rev1-default "") (setq rev1-default nil))))
;; construct argument list
(let* ((rev1-prompt (if rev1-default
(concat "Older revision (default "
Diff finished. Wed Oct 9 10:03:04 2013
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-10 15:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09 9:06 bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better João Távora
2013-10-10 0:35 ` Stefan Monnier
2013-10-10 11:42 ` João Távora
2013-10-10 14:23 ` Stefan Monnier
2013-10-10 15:01 ` Alp Aker
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.