unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4422: diff-switches is a bad idea
@ 2009-09-13 12:18 Reuben Thomas
  2019-10-01 13:18 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Reuben Thomas @ 2009-09-13 12:18 UTC (permalink / raw)
  To: bug-emacs

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






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

* bug#4422: diff-switches is a bad idea
  2009-09-13 12:18 bug#4422: diff-switches is a bad idea Reuben Thomas
@ 2019-10-01 13:18 ` Lars Ingebrigtsen
  2019-10-01 13:29   ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-10-01 13:42   ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-01 13:18 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 4422

Reuben Thomas <rrt@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





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

* bug#4422: diff-switches is a bad idea
  2019-10-01 13:18 ` Lars Ingebrigtsen
@ 2019-10-01 13:29   ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2019-10-01 13:42   ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2019-10-01 13:29 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 4422

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

On Tue, 1 Oct 2019 at 14:18, Lars Ingebrigtsen <larsi@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

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

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

* bug#4422: diff-switches is a bad idea
  2019-10-01 13:18 ` Lars Ingebrigtsen
  2019-10-01 13:29   ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2019-10-01 13:42   ` Eli Zaretskii
  2019-10-02 11:47     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-10-01 13:42 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 4422, rrt

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 01 Oct 2019 15:18:29 +0200
> Cc: 4422@debbugs.gnu.org
> 
> Reuben Thomas <rrt@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.





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

* bug#4422: diff-switches is a bad idea
  2019-10-01 13:42   ` Eli Zaretskii
@ 2019-10-02 11:47     ` Lars Ingebrigtsen
  2019-10-02 15:16       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-02 11:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 4422, rrt

Eli Zaretskii <eliz@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





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

* bug#4422: diff-switches is a bad idea
  2019-10-02 11:47     ` Lars Ingebrigtsen
@ 2019-10-02 15:16       ` Eli Zaretskii
  2019-10-03 14:33         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-10-02 15:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 4422, rrt

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: rrt@sc3d.org,  4422@debbugs.gnu.org
> Date: Wed, 02 Oct 2019 13:47:12 +0200
> 
> Eli Zaretskii <eliz@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.





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

* bug#4422: diff-switches is a bad idea
  2019-10-02 15:16       ` Eli Zaretskii
@ 2019-10-03 14:33         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-03 14:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 4422, rrt

Eli Zaretskii <eliz@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





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

end of thread, other threads:[~2019-10-03 14:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-13 12:18 bug#4422: diff-switches is a bad idea Reuben Thomas
2019-10-01 13:18 ` Lars Ingebrigtsen
2019-10-01 13:29   ` Reuben Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-10-01 13:42   ` Eli Zaretskii
2019-10-02 11:47     ` Lars Ingebrigtsen
2019-10-02 15:16       ` Eli Zaretskii
2019-10-03 14:33         ` Lars Ingebrigtsen

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).