Skip to contentSkip to conversation

diff command line?

PATCH Bodo Eggert 3 participants 3 messages Mar 5, 2005 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 9 lines · Russell King
Quoted 2 lines · Gene Heskett

What are the options normally used to generate a diff for public consumption on this list?

diff -urpN orig new

where "orig" and "new" both contain the top level "linux" directory, so the resulting patch can be applied with patch -p1.

This seems to be a common mistake.

--- linux-2.6.11/Documentation/SubmittingPatches.ori 2005-03-05
21:29:26.000000000 +0100
+++ linux-2.6.11/Documentation/SubmittingPatches 2005-03-05
21:38:40.000000000 +0100
@@ -24,6 +24,7 @@ SECTION 1 - CREATING AND SENDING YOUR CH
------------

Use "diff -up" or "diff -uprN" to create patches.
+The resulting patch must apply with -p1 from within the linux directory.

All changes to the Linux kernel occur in the form of patches, as generated by diff(1). When creating your patch, make sure to create it

#3 lore raw
Quoted 6 lines · Bodo Eggert
Quoted 5 lines · Russell King
Quoted 2 lines · Gene Heskett

What are the options normally used to generate a diff for public consumption on this list?

Quoted 6 lines
Quoted 4 lines

diff -urpN orig new

where "orig" and "new" both contain the top level "linux" directory, so the resulting patch can be applied with patch -p1.

This seems to be a common mistake.

I often use a simple trick to make my single file patches compatible with both -p0 and -p1 :

diff -pruN ./dir/file.orig ./dir/file.new

The './' can either get stripped by -p1 or left as is, thus the patch works for different scripts or people. The main disadvantage is that there's no base version indication in the patch with this method.

Regards,
Willy

#4 lore raw
Quoted 18 lines · Willy Tarreau
Quoted 11 lines · Bodo Eggert
Quoted 8 lines · Russell King
Quoted 2 lines · Gene Heskett

What are the options normally used to generate a diff for public consumption on this list?

diff -urpN orig new

where "orig" and "new" both contain the top level "linux" directory, so the resulting patch can be applied with patch -p1.

This seems to be a common mistake.

I often use a simple trick to make my single file patches compatible with both -p0 and -p1 :

diff -pruN ./dir/file.orig ./dir/file.new

Quoted 7 lines

The './' can either get stripped by -p1 or left as is, thus the patch works for different scripts or people. The main disadvantage is that there's no base version indication in the patch with this method.

Regards,
Willy

Neat, Willy. Are such patches generally acceptable here?

Signature · 8 lines
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.34% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.