Bug 20044

Summary: which order to put files in diff for patch?
Product: Documentation Reporter: Stephen Montgomery-Smith <stephen>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Stephen Montgomery-Smith 2000-07-19 21:30:00 UTC
If you are like me, when you create a patch, you don't know whether
to write
diff old-file new-file
or
diff new-file old-file
The man page for diff is not clear on this.

Fix: Apply this patch to /usr/src/gnu/usr.bin/diff
How-To-Repeat: 
man diff
Comment 1 ecogren 2000-07-19 21:39:47 UTC
Is this really that unclear? 

Barring whether "from-file" and "to-file" doesn't make it clear enough,
the first entry under EXAMPLES has a line 
diff -crN foo.orig foo > foo.diff

which I think makes it pretty clear which order to put files in.

Eric

> -----Original Message-----
> From: Stephen Montgomery-Smith 
> [mailto:stephen@cauchy.math.missouri.edu]
> Sent: Wednesday, July 19, 2000 4:22 PM
> To: FreeBSD-gnats-submit@FreeBSD.ORG
> Subject: docs/20044: which order to put files in diff for patch?
> 
> 
> 
> >Number:         20044
> >Category:       docs
> >Synopsis:       which order to put files in diff for patch?
> >Confidential:   no
> >Severity:       non-critical
> >Priority:       low
> >Responsible:    freebsd-doc
> >State:          open
> >Quarter:        
> >Keywords:       
> >Date-Required:
> >Class:          change-request
> >Submitter-Id:   current-users
> >Arrival-Date:   Wed Jul 19 13:30:00 PDT 2000
> >Closed-Date:
> >Last-Modified:
> >Originator:     Stephen Montgomery-Smith
> >Release:        FreeBSD 4.1-RC i386
> >Organization:
> University of Missouri
> >Environment:
> 
> >Description:
> 
> If you are like me, when you create a patch, you don't know whether
> to write
> diff old-file new-file
> or
> diff new-file old-file
> The man page for diff is not clear on this.
> >How-To-Repeat:
> 
> man diff
> 
> >Fix:
> 
> Apply this patch to /usr/src/gnu/usr.bin/diff
> 
> --- diff-old.1	Wed Jul 19 12:08:31 2000
> +++ diff.1	Wed Jul 19 12:25:07 2000
> @@ -489,6 +489,19 @@
>  and
>  .I foo
>  might be directory hierarchies or single files.
> +
> +If you are creating a patch file for
> +.B patch
> +to use, you should put the old file/directory first, and the 
> +new file/directory second: for example
> +
> +.B diff
> +-u old-file new-file
> +
> +or
> +
> +.B diff
> +-ur old-directory new-directory
>  .SH SEE ALSO
>  cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).
>  .SH DIAGNOSTICS
> 
> 
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
>  Stephen Montgomery-Smith
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-doc" in the body of the message
>
Comment 2 nik freebsd_committer freebsd_triage 2000-07-21 23:57:43 UTC
On Wed, Jul 19, 2000 at 03:22:15PM -0500, Stephen Montgomery-Smith wrote:
> If you are like me, when you create a patch, you don't know whether
> to write
> diff old-file new-file
> or
> diff new-file old-file

    cp old-file new-file
    
    mv old-file new-file

    ln old-file new-file

    diff old-file new-file

Unix is pretty consistent about this stuff.

N
-- 
Internet connection, $19.95 a month.  Computer, $799.95.  Modem, $149.95.
Telephone line, $24.95 a month.  Software, free.  USENET transmission,
hundreds if not thousands of dollars.  Thinking before posting, priceless.
Somethings in life you can't buy.  For everything else, there's MasterCard.
  -- Graham Reed, in the Scary Devil Monastery
Comment 3 Jim Mock freebsd_committer freebsd_triage 2000-07-24 07:13:04 UTC
State Changed
From-To: open->closed

Not only has this been explained in the audit trail, it is also explained 
at http://www.FreeBSD.org/docproj/submitting.html.