
Are context diffs still favoured for patches? The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say. Brett can probably guess why I'm asking :) Cheers, Nick. [1] http://www.python.org/patches/ -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.skystorm.net

[Nick Coghlan]
Are context diffs still favoured for patches?
The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say.
Submit whichever is the most informative. For some changes, it is easier to see the changed lines immediately above and below each other. For others, it helps to be able to see the whole algorithm. Raymond

Raymond Hettinger wrote:
[Nick Coghlan]
Are context diffs still favoured for patches?
The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been
generating
context diffs because of what the guidelines say.
Submit whichever is the most informative. For some changes, it is easier to see the changed lines immediately above and below each other. For others, it helps to be able to see the whole algorithm.
And for the 'patch' tool, it doesn't really matter what you use, right? --Irmen

Nick Coghlan <ncoghlan@iinet.net.au> writes:
Are context diffs still favoured for patches?
If you want me to review it, yes, probably, but see below...
The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say.
Emacs 21's diff-mode can convert between the two with a keypress. People who continue to abuse themselves by not using Emacs can probably find other tools to do this job. So *I* don't regard this as a big deal. Plain diffs are of course, right out. Cheers, mwh -- It is never worth a first class man's time to express a majority opinion. By definition, there are plenty of others to do that. -- G. H. Hardy

Nick Coghlan wrote:
Are context diffs still favoured for patches?
The patch submission guidelines [1] still say that, but is it actually true these days? I personally prefer unified diffs, but have been generating context diffs because of what the guidelines say.
I personally like unified diffs a lot more since you can see exactly how a line changed compared to the previous version, but that's me. I just checked the dev FAQ and it consistently says contextual diffs as well.
Brett can probably guess why I'm asking :)
=)
Cheers, Nick.
I didn't even know that page existed! I thought at one point this question came up and the general consensus was that unified diffs were preferred? -Brett

On Wed, Apr 13, 2005 at 12:54:08PM -0700, Brett C. wrote:
I thought at one point this question came up and the general consensus was that unified diffs were preferred?
Guido used to prefer context diffs but says he now doesn't mind unified diffs. I think unified diffs are much more common these days so that's probably what most people are used to. As Raymond says, for certain types of changes, context diffs are more readable. Still, I always use unified diffs. Neil

On Wed, 2005-04-13 at 15:54, Brett C. wrote:
I thought at one point this question came up and the general consensus was that unified diffs were preferred?
Back in the day, we preferred context diffs, and I think of the original Python core group, Guido was the last holdout. But IIRC, a few years ago the issue came up again; Guido had changed his mind so we changed syncmail to produce unified diffs. IMO unifieds are preferred when the diffs are for human consumption, but when they're only for machine consumption, anything that the patch program accepts is fine. -Barry

Barry Warsaw wrote:
On Wed, 2005-04-13 at 15:54, Brett C. wrote:
I thought at one point this question came up and the general consensus was that unified diffs were preferred?
Back in the day, we preferred context diffs, and I think of the original Python core group, Guido was the last holdout. But IIRC, a few years ago the issue came up again; Guido had changed his mind so we changed syncmail to produce unified diffs.
Eh. Guido doesn't deal with patches anymore, so his opinion doesn't count. =)
IMO unifieds are preferred when the diffs are for human consumption, but when they're only for machine consumption, anything that the patch program accepts is fine.
OK, it seems like everyone who cares enough to speak up has said so far that unified diffs are better I will change the docs some time between now and when I keel over dead to have people use unified diffs assuming some rush of people don't suddenly start saying they prefer contextual diffs. -Brett

On Thursday 14 April 2005 07:26, Brett C. wrote:
OK, it seems like everyone who cares enough to speak up has said so far that unified diffs are better I will change the docs some time between now and when I keel over dead to have people use unified diffs assuming some rush of people don't suddenly start saying they prefer contextual diffs.
Should probably say either context or unified diffs - I'm sure there's vendor supplied 'diff' programs out there that don't support -u ed-style patches, of course, are RIGHT OUT. Anthony -- Anthony Baxter <anthony@interlink.com.au> It's never too late to have a happy childhood.

On Apr 13, 2005, at 11:17 PM, Anthony Baxter wrote:
On Thursday 14 April 2005 07:26, Brett C. wrote:
OK, it seems like everyone who cares enough to speak up has said so far that unified diffs are better I will change the docs some time between now and when I keel over dead to have people use unified diffs assuming some rush of people don't suddenly start saying they prefer contextual diffs.
Should probably say either context or unified diffs - I'm sure there's vendor supplied 'diff' programs out there that don't support -u
ed-style patches, of course, are RIGHT OUT.
It might be worth mentioning that if/when subversion is used to replace CVS, unified diffs are going to be the obvious way to do it, because I don't think that subversion supports context diffs without using an external diff command. -bob

Bob Ippolito wrote:
It might be worth mentioning that if/when subversion is used to replace CVS, unified diffs are going to be the obvious way to do it, because I don't think that subversion supports context diffs without using an external diff command.
subversion? you meant bazaar-ng, right? </F>
participants (11)
-
"Martin v. Löwis"
-
Anthony Baxter
-
Barry Warsaw
-
Bob Ippolito
-
Brett C.
-
Fredrik Lundh
-
Irmen de Jong
-
Michael Hudson
-
Neil Schemenauer
-
Nick Coghlan
-
Raymond Hettinger