GNU bug report logs - #4422
diff-switches is a bad idea

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Sun, 13 Sep 2009 12:25:05 UTC

Severity: wishlist

Tags: fixed, moreinfo

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 4422 in the body.
You can then email your comments to 4422 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4422; Package emacs. (Sun, 13 Sep 2009 12:25:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reuben Thomas <rrt <at> sc3d.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 13 Sep 2009 12:25:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Reuben Thomas <rrt <at> sc3d.org>
To: bug-emacs <bug-emacs <at> gnu.org>
Subject: diff-switches is a bad idea
Date: Sun, 13 Sep 2009 13:18:03 +0100
I'm using Emacs 23, and I have just been puzzling over why vc-diff
stopped working in CVS checkouts. I eventually traced it to
diff-switches: I have mine set to "-Nur", quite reasonably, I think,
but of course "-r" means something quite different to CVS, and I ended
up with a hard-to-understand error message about tags.

I suggest not using diff-switches (this would also remove some
special-case code, as no other vc command respects a non-vc option
like this.) Yes, some users will have to configure the same thing in
two places, but others will be saved the confusion I had. For the
switches to be commoned up sensibly, a more structured approach to
setting them is needed that takes semantics into account, and that way
lies madness.

-- 
http://rrt.sc3d.org
Imagine someone who has only ever heard music once




Severity set to 'wishlist' from 'normal' Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Thu, 22 Oct 2009 09:40:18 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Tue, 01 Oct 2019 13:19:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 4422 <at> debbugs.gnu.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Tue, 01 Oct 2019 15:18:29 +0200
Reuben Thomas <rrt <at> sc3d.org> writes:

> I'm using Emacs 23, and I have just been puzzling over why vc-diff
> stopped working in CVS checkouts. I eventually traced it to
> diff-switches: I have mine set to "-Nur", quite reasonably, I think,
> but of course "-r" means something quite different to CVS, and I ended
> up with a hard-to-understand error message about tags.
>
> I suggest not using diff-switches (this would also remove some
> special-case code, as no other vc command respects a non-vc option
> like this.) Yes, some users will have to configure the same thing in
> two places, but others will be saved the confusion I had. For the
> switches to be commoned up sensibly, a more structured approach to
> setting them is needed that takes semantics into account, and that way
> lies madness.

(I'm going through old bug reports that unfortunately didn't get any
response at the time.)

I'm not extremely familiar with the vc code, but looking at it in Emacs
27, at least, the switches for diff in CVS comes from
vc-cvs-diff-switches, if I read the `vc-switches' function correctly.

So has this problem gone away in the years since this was reported?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Oct 2019 13:19:05 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Tue, 01 Oct 2019 13:30:02 GMT) Full text and rfc822 format available.

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

From: Reuben Thomas <rrt <at> sc3d.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 4422 <at> debbugs.gnu.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Tue, 1 Oct 2019 14:29:28 +0100
[Message part 1 (text/plain, inline)]
On Tue, 1 Oct 2019 at 14:18, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

>
> I'm not extremely familiar with the vc code, but looking at it in Emacs
> 27, at least, the switches for diff in CVS comes from
> vc-cvs-diff-switches, if I read the `vc-switches' function correctly.
>
> So has this problem gone away in the years since this was reported?
>

Not as far as I can tell. It is still necessary for me to set
`vc-diff-switches` explicitly, e.g. to `t`, meaning "no switches". From the
docstring for vc-switches:

In decreasing order of preference, return the value of:
vc-BACKEND-OP-switches (e.g. `vc-cvs-diff-switches');
vc-OP-switches (e.g. `vc-diff-switches'); or, in the case of
diff only, `diff-switches'.

In other words, `diff-switches` is still used by vc.el, and I still think
that's a bad idea.

-- 
https://rrt.sc3d.org
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Tue, 01 Oct 2019 13:43:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 4422 <at> debbugs.gnu.org, rrt <at> sc3d.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Tue, 01 Oct 2019 16:42:14 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 01 Oct 2019 15:18:29 +0200
> Cc: 4422 <at> debbugs.gnu.org
> 
> Reuben Thomas <rrt <at> sc3d.org> writes:
> 
> > I'm using Emacs 23, and I have just been puzzling over why vc-diff
> > stopped working in CVS checkouts. I eventually traced it to
> > diff-switches: I have mine set to "-Nur", quite reasonably, I think,
> > but of course "-r" means something quite different to CVS, and I ended
> > up with a hard-to-understand error message about tags.
> >
> > I suggest not using diff-switches (this would also remove some
> > special-case code, as no other vc command respects a non-vc option
> > like this.) Yes, some users will have to configure the same thing in
> > two places, but others will be saved the confusion I had. For the
> > switches to be commoned up sensibly, a more structured approach to
> > setting them is needed that takes semantics into account, and that way
> > lies madness.
> 
> (I'm going through old bug reports that unfortunately didn't get any
> response at the time.)
> 
> I'm not extremely familiar with the vc code, but looking at it in Emacs
> 27, at least, the switches for diff in CVS comes from
> vc-cvs-diff-switches, if I read the `vc-switches' function correctly.

It uses vc-cvs-diff-switches, but if that's nil (the default), it will
try to use vc-diff-switches (which is also nil by default) and
diff-switches, using the first non-nil of these.

I think the current situation is reasonable, since to resolve it the
user could customize vc-diff-switches or vc-cvs-diff-switches to t to
avoid this problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Wed, 02 Oct 2019 11:48:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4422 <at> debbugs.gnu.org, rrt <at> sc3d.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Wed, 02 Oct 2019 13:47:12 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I think the current situation is reasonable, since to resolve it the
> user could customize vc-diff-switches or vc-cvs-diff-switches to t to
> avoid this problem.

Perhaps we should mention this in the diff-switches doc string?  That'd
make it more obvious for the user how to resolve the problem.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Wed, 02 Oct 2019 15:17:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 4422 <at> debbugs.gnu.org, rrt <at> sc3d.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Wed, 02 Oct 2019 18:16:35 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: rrt <at> sc3d.org,  4422 <at> debbugs.gnu.org
> Date: Wed, 02 Oct 2019 13:47:12 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > I think the current situation is reasonable, since to resolve it the
> > user could customize vc-diff-switches or vc-cvs-diff-switches to t to
> > avoid this problem.
> 
> Perhaps we should mention this in the diff-switches doc string?  That'd
> make it more obvious for the user how to resolve the problem.

Fine with me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#4422; Package emacs. (Thu, 03 Oct 2019 14:34:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 4422 <at> debbugs.gnu.org, rrt <at> sc3d.org
Subject: Re: bug#4422: diff-switches is a bad idea
Date: Thu, 03 Oct 2019 16:33:21 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Perhaps we should mention this in the diff-switches doc string?  That'd
>> make it more obvious for the user how to resolve the problem.
>
> Fine with me, thanks.

OK; done.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Oct 2019 14:34:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 4422 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 03 Oct 2019 14:34: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. (Fri, 01 Nov 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 148 days ago.

Previous Next


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