GNU bug report logs - #20290
25.0.50; Use unified diff format by default, and recommend using it in reports and patches

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Thu, 9 Apr 2015 20:07:01 UTC

Severity: wishlist

Found in version 25.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

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 20290 in the body.
You can then email your comments to 20290 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-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Thu, 09 Apr 2015 20:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Apr 2015 20:07:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50;
 Use unified diff format by default, and recommend using it in reports
 and patches
Date: Thu, 09 Apr 2015 23:05:42 +0300
That should involve changing the default `diff-switches' value and small
changes to doc/emacs/files.texi and doc/emacs/trouble.texi.

Let me know if I missed something.

Barring any objections, I'll do that tomorrow-ish, on master.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 07:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50;
 Use unified diff format by default, and recommend using it in
 reports	and patches
Date: Fri, 10 Apr 2015 10:26:56 +0300
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Thu, 09 Apr 2015 23:05:42 +0300
> 
> That should involve changing the default `diff-switches' value and small
> changes to doc/emacs/files.texi and doc/emacs/trouble.texi.
> 
> Let me know if I missed something.

Please be sure to mention the change in NEWS, and tell there how to
get back the old behavior.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 07:34:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50;
 Use unified diff format by default, and recommend using it in reports
 and patches
Date: Fri, 10 Apr 2015 03:33:23 -0400
What's the reason for changing the long-standing default?

    * Use `diff -c' to make your diffs.  Diffs without context are hard
     to install reliably.  More than that, they are hard to study; we
     must always study a patch to decide whether we want to install it.
     Unidiff format is better than contextless diffs, but not as easy
     to read as `-c' format.

Also, one day is not long enough to allow people time to respond,
for any Emacs issue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 12:26:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50; Use unified diff format by default,
 and recommend using it in reports and patches
Date: Fri, 10 Apr 2015 14:59:44 +0300
On 04/10/2015 10:26 AM, Eli Zaretskii wrote:

> Please be sure to mention the change in NEWS, and tell there how to
> get back the old behavior.

Right, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 12:28:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50; Use unified diff format by default,
 and recommend using it in reports and patches
Date: Fri, 10 Apr 2015 15:26:38 +0300
On 04/10/2015 10:33 AM, Glenn Morris wrote:

> What's the reason for changing the long-standing default?

Unified diffs are considerably more popular. IIRC Stefan prefers them, 
and the vast majority of patches we've received lately (even though 
Emacs's documentation asks for the context format), were unified.

Which signals that users prefer, or at least are more used to, unified 
diffs. I've recently wanted to show off the "refinement" diff-mode 
feature to a colleague, and that stumbled on Emacs producing a context 
diff by default, so I had to go back to my machine, and look up which 
option to change (yes, I know there's a conversion command; haven't 
thought about that at the time).

>      * Use `diff -c' to make your diffs.  Diffs without context are hard
>       to install reliably.  More than that, they are hard to study; we
>       must always study a patch to decide whether we want to install it.

This is about the "normal" diff format, which, uh, nobody ever uses now?

>       Unidiff format is better than contextless diffs, but not as easy
>       to read as `-c' format.

And here I disagree: unified diffs are easier, because they clearly show 
you the changes. You don't need to compare the "before" and "after" in 
your head, to figure out what exactly changed. Maybe it can be a bit 
harder to read, but it's much easier to review.

Note that we already indirectly ask the users to send their patches in 
the unified format in CONTRIBUTE, because that's what 'git format-patch' 
will create.

> Also, one day is not long enough to allow people time to respond,
> for any Emacs issue.

Okay, let's wait until the next week.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 15:57:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Glenn Morris <rgm <at> gnu.org>, 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50;
 Use unified diff format by default, and recommend using it in reports
 and patches
Date: Fri, 10 Apr 2015 17:55:56 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Which signals that users prefer, or at least are more used to, unified
> diffs. I've recently wanted to show off the "refinement" diff-mode feature
> to a colleague, and that stumbled on Emacs producing a context diff by
> default,

The refinement works well with context diffs.

> And here I disagree: unified diffs are easier, because they clearly show
> you the changes. You don't need to compare the "before" and "after" in
> your head, to figure out what exactly changed.

That's where the refinement helps in the same way as with unified diffs.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Fri, 10 Apr 2015 17:14:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50; Use unified diff format by default,
 and recommend using it in reports and patches
Date: Fri, 10 Apr 2015 20:13:43 +0300
On 04/10/2015 06:55 PM, Andreas Schwab wrote:

> The refinement works well with context diffs.

Good point: it helps with their downside.

However, the other person was unfamiliar with the context format, and 
myself, simply uncomfortable with it.

> That's where the refinement helps in the same way as with unified diffs.

And even more so, I'd say.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Sun, 12 Apr 2015 23:31:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 20290 <at> debbugs.gnu.org
Subject: Re: 25.0.50; Use unified diff format by default, and recommend using
 it in reports and patches
Date: Sun, 12 Apr 2015 16:30:01 -0700
As I recall, RMS preferred diff -c to diff -u, and that is partly why 
trouble.texi suggests -c over -u and why diff-switches defaults to -c.  Also, 
traditional Unix 'diff' lacked -u; although GNU diff had -u starting in 1990, 
diff -u wasn't standardized by POSIX until 2008.

These days -u format is far more popular than -c format in practice, and I 
expect that most active Emacs developers prefer -u, so it's appropriate for 
Emacs to default to -u and for trouble.texi to suggest it.

I suppose that in theory there is the issue of Emacs running on an older 
POSIXish platform where 'diff' does not support -u.  I don't have access to any 
such platform, though.  I can confirm that Solaris 10 diff (2005) supports '-u'. 
 So perhaps we don't need to worry about this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20290; Package emacs. (Mon, 13 Apr 2015 03:05:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 20290 <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50;
 Use unified diff format by default, and recommend using it in reports
 and patches
Date: Sun, 12 Apr 2015 23:03:57 -0400
> These days -u format is far more popular than -c format in practice, and
> I expect that most active Emacs developers prefer -u, so it's appropriate
> for Emacs to default to -u and for trouble.texi to suggest it.

That's my impression as well.


        Stefan




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Tue, 14 Apr 2015 02:17:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Tue, 14 Apr 2015 02:17:02 GMT) Full text and rfc822 format available.

Message #34 received at 20290-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 20290-done <at> debbugs.gnu.org
Subject: Re: bug#20290: 25.0.50; Use unified diff format by default,
 and recommend using it in reports and patches
Date: Tue, 14 Apr 2015 05:16:28 +0300
On 04/13/2015 02:30 AM, Paul Eggert wrote:
> As I recall, RMS preferred diff -c to diff -u, and that is partly why
> trouble.texi suggests -c over -u and why diff-switches defaults to -c.

Yup, Stephen reminded of that in a recent emacs-devel thread, so I 
thought this would be a good time to try to change it.

> These days -u format is far more popular than -c format in practice, and
> I expect that most active Emacs developers prefer -u, so it's
> appropriate for Emacs to default to -u and for trouble.texi to suggest it.

This is done now. Thanks everyone.

> I suppose that in theory there is the issue of Emacs running on an older
> POSIXish platform where 'diff' does not support -u.  I don't have access
> to any such platform, though.  I can confirm that Solaris 10 diff (2005)
> supports '-u'.  So perhaps we don't need to worry about this.

I think the usual response is that users on outdated systems don't 
necessarily have to be able to use the latest-and-greatest Emacs.

But in this case the incompatibility would be very minor: if someone 
actually encounters this problem, they'll only need to customize the 
relevant variable.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 12 May 2015 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 191 days ago.

Previous Next


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