unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
@ 2015-04-09 20:05 Dmitry Gutov
  2015-04-10  7:26 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-04-09 20:05 UTC (permalink / raw)
  To: 20290

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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-09 20:05 bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches Dmitry Gutov
@ 2015-04-10  7:26 ` Eli Zaretskii
  2015-04-10 11:59   ` Dmitry Gutov
  2015-04-10  7:33 ` Glenn Morris
  2015-04-12 23:30 ` Paul Eggert
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2015-04-10  7:26 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 20290

> From: Dmitry Gutov <dgutov@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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-09 20:05 bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches Dmitry Gutov
  2015-04-10  7:26 ` Eli Zaretskii
@ 2015-04-10  7:33 ` Glenn Morris
  2015-04-10 12:26   ` Dmitry Gutov
  2015-04-12 23:30 ` Paul Eggert
  2 siblings, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2015-04-10  7:33 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 20290


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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-10  7:26 ` Eli Zaretskii
@ 2015-04-10 11:59   ` Dmitry Gutov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-04-10 11:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20290

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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-10  7:33 ` Glenn Morris
@ 2015-04-10 12:26   ` Dmitry Gutov
  2015-04-10 15:55     ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2015-04-10 12:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 20290

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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-10 12:26   ` Dmitry Gutov
@ 2015-04-10 15:55     ` Andreas Schwab
  2015-04-10 17:13       ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2015-04-10 15:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 20290

Dmitry Gutov <dgutov@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@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-10 15:55     ` Andreas Schwab
@ 2015-04-10 17:13       ` Dmitry Gutov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-04-10 17:13 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 20290

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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-09 20:05 bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches Dmitry Gutov
  2015-04-10  7:26 ` Eli Zaretskii
  2015-04-10  7:33 ` Glenn Morris
@ 2015-04-12 23:30 ` Paul Eggert
  2015-04-13  3:03   ` Stefan Monnier
  2015-04-14  2:16   ` Dmitry Gutov
  2 siblings, 2 replies; 10+ messages in thread
From: Paul Eggert @ 2015-04-12 23:30 UTC (permalink / raw)
  To: 20290

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.





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-12 23:30 ` Paul Eggert
@ 2015-04-13  3:03   ` Stefan Monnier
  2015-04-14  2:16   ` Dmitry Gutov
  1 sibling, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2015-04-13  3:03 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 20290

> 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





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

* bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches
  2015-04-12 23:30 ` Paul Eggert
  2015-04-13  3:03   ` Stefan Monnier
@ 2015-04-14  2:16   ` Dmitry Gutov
  1 sibling, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2015-04-14  2:16 UTC (permalink / raw)
  To: Paul Eggert, 20290-done

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.





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

end of thread, other threads:[~2015-04-14  2:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 20:05 bug#20290: 25.0.50; Use unified diff format by default, and recommend using it in reports and patches Dmitry Gutov
2015-04-10  7:26 ` Eli Zaretskii
2015-04-10 11:59   ` Dmitry Gutov
2015-04-10  7:33 ` Glenn Morris
2015-04-10 12:26   ` Dmitry Gutov
2015-04-10 15:55     ` Andreas Schwab
2015-04-10 17:13       ` Dmitry Gutov
2015-04-12 23:30 ` Paul Eggert
2015-04-13  3:03   ` Stefan Monnier
2015-04-14  2:16   ` Dmitry Gutov

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