unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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

* bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-10-10  0:35 UTC (permalink / raw)
  To: João Távora; +Cc: 15569

> I've found that the following patch fixes this behaviour, and still
> makes sense to me.

It looks reasonable.  Can you install it?


        Stefan





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

* bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better
  2013-10-10  0:35 ` Stefan Monnier
@ 2013-10-10 11:42   ` João Távora
  2013-10-10 14:23     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: João Távora @ 2013-10-10 11:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15569

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I've found that the following patch fixes this behaviour, and still
>> makes sense to me.
>
> It looks reasonable.  Can you install it?

Do you mean me, or another mantainter? Can I install patches to emacs?

João





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

* bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better
  2013-10-10 11:42   ` João Távora
@ 2013-10-10 14:23     ` Stefan Monnier
  2013-10-10 15:01       ` Alp Aker
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2013-10-10 14:23 UTC (permalink / raw)
  To: João Távora; +Cc: 15569

>> It looks reasonable.  Can you install it?
> Do you mean me, or another mantainter? Can I install patches to emacs?

I meant you, but since you don't have write access, I should have meant
"anyone else".


        Stefan





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

* bug#15569: 24.3.50; vc-ediff with prefix argument could be slightly better
  2013-10-10 14:23     ` Stefan Monnier
@ 2013-10-10 15:01       ` Alp Aker
  0 siblings, 0 replies; 5+ messages in thread
From: Alp Aker @ 2013-10-10 15:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15569-done, João Távora

[-- Attachment #1: Type: text/plain, Size: 22 bytes --]

Installed as r114612.

[-- Attachment #2: Type: text/html, Size: 78 bytes --]

^ 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).