On Mon, 04 Apr 2005 04:33:28 -0700
[EMAIL PROTECTED] (Debian Bug Tracking System) wrote:

> (You might want to use 'diff -u' rather than plain diff, too. Most
> maintainers prefer just about anything to plain diff for receiving
> patches.)

Well, I'd like to make reports as convenient for maintainers as possible.  
However, 
I'm really not up on the "-u" format, and hesitate to use it without better
understanding it.  Especially since I'm trying to automate this in a helper
tool kinda script.  

In hopes that you (or some .diff maven) can advise on this, I'll explain what's
confusing me -- probably just a simple thing -- but in explaining it I'd prefer 
to 
perhaps err on the side of profusion and redundancy...

1)  Let's copy 'man bash'...

        % cp /usr/share/man/man1/bash.1.gz /tmp/bash.1.gz

2) And perform a needless edit on it, but pretend its good stuff.

        % cd /tmp
        % mcedit bash.1.gz

3) After the needless edit, it looks this way with regular 'diff':

   %zdiff /usr/share/man/man1/bash.1.gz /tmp/bash.1.gz | nl
     1  5561c5561
     2  < shell option causes the shell to save the command with embedded 
newlines
     3  ---
     4  > swell shell option causes the shell to save the command with embedded 
newlines
     5  5571c5571
     6  < is similar to the history expansion in
     7  ---
     8  > is so similar to the history expansion in

...which format I understand.

4) After 'diff -u' it looks like:

  zdiff -u /usr/share/man/man1/bash.1.gz /tmp/bash.1.gz | nl
     1  --- -   2005-04-05 02:46:14.076698000 -0400
     2  +++ /tmp/bash1.gz.12990 2005-04-05 02:46:14.070147316 -0400
     3  @@ -5558,7 +5558,7 @@
     4   semicolons where necessary to preserve syntactic correctness.
     5   The
     6   .B lithist
     7  -shell option causes the shell to save the command with embedded 
newlines
     8  +swell shell option causes the shell to save the command with embedded 
newlines
     9   instead of semicolons.  See the description of the
    10   .B shopt
    11   builtin below under
    12  @@ -5568,7 +5568,7 @@
    13   .SH "HISTORY EXPANSION"
    14   .PP
    15   The shell supports a history expansion feature that
    16  -is similar to the history expansion in
    17  +is so similar to the history expansion in
    18   .BR csh.
    19   This section describes what syntax features are available.  This
    20   feature is enabled by default for interactive shells, and can be

Longer!  Well pretty much all of that is clear to me except lines #1-2:

     1  --- -   2005-04-05 02:46:14.076698000 -0400
     2  +++ /tmp/bash1.gz.12990 2005-04-05 02:46:14.070147316 -0400

All that 'man diff' says about '-u' is:

        % man diff | grep -m 1 -n -A 1 "\-u"
        47:       -u  -U NUM  --unified[=NUM]
        48-              Output NUM (default 3) lines of unified context.

So vague.  The 'info' about those two lines is only a little better:

        % zgrep -A 7 2.3.2.1   /usr/share/info/diff.info.gz
        2.3.2.1 Detailed Description of Unified Format
        ..............................................

        The unified output format starts with a two-line header, which looks
        like this:

             --- FROM-FILE FROM-FILE-MODIFICATION-TIME
             +++ TO-FILE TO-FILE-MODIFICATION-TIME

So, my question is about the 'FROM-FILE' and 'TO-FILE'.  In my 'bash' example,
'FROM-FILE' was "-", and 'TO-FILE' was "/tmp/bash1.gz".  Transient names.

So I'm worrying if such transient local filenames are useful, or harmful if 
they cause 
patching programs to look for files that don't exist on a maintainer's system.  
 Plain 
vanilla 'diff' seemed safer, and nobody complained until now, though maybe
they should have.

Now IF it's possible to know what values of 'FROM-FILE' and 'TO-FILE' are most
harmless, or better yet, are most useful for maintainers, I'd be glad to code 
that in to my
man page typo bug report helper script ffffoooorrrrr the higher orthographic 
good!

In a nutshell:  What should 'FROM-FILE' and 'TO-FILE' be set to?

Thanks, and good night...


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to