Lobbying for -p1 diffs

Matthew D. Fuller fullermd at over-yonder.net
Thu Mar 2 00:41:27 GMT 2006


On Thu, Mar 02, 2006 at 11:27:33AM +1100 I heard the voice of
Robert Collins, and lo! it spake thus:
> 
> -p0 is currently needed to interpret all bzr diffs, because patch
> defaults to pathless operation. And bzr patch will DTRT naturally.

% cat foo/bar
hi
there
% \bzr diff -r2..1
=== modified file 'foo/bar'
--- foo/bar     
+++ foo/bar     
@@ -1,2 +1,1 @@
 hi
-there

% \bzr diff -r2..1 | patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|=== modified file 'foo/bar'
|--- foo/bar    
|+++ foo/bar    
--------------------------
Patching file foo/bar using Plan A...
Hunk #1 succeeded at 1.
Hmm...  Ignoring the trailing garbage.
done
% cat foo/bar
hi
% patch -v
Patch version 2.1


Per the manpage:
    [...] and not specifying -p at all just gives you "blurfl.c",
    unless all of the directories in the leading path
    (u/howard/src/blurfl) exist and that path is relative, in which
    case you get the entire pathname unmodified.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.




More information about the bazaar mailing list