freebsd at edvax.de
Thu Jun 4 19:06:38 UTC 2020
On Thu, 4 Jun 2020 13:43:58 +0200, Per Hedeland wrote:
> On 2020-06-04 08:23, Polytropon wrote:
> > On Wed, 3 Jun 2020 23:56:37 -0600, Brandon helsley wrote:
> >> Could you tell me what this tool "diff" is.
> > A diff (the tool, the process, and its result) means "difference".
> > For example, if you find a manpage where the explanation for a
> > certain option is missing, you take the original file, make a
> > working copy of it, change that working copy, and create a file
> > that contains the difference (i. e., the diff, also often
> > called the patch) between the original and the updated version.
> > This diff can then be sent to the FreeBSD team, and they will
> > apply it; the next issue of FreeBSD will then contain the
> > updated manpage instead of the original one.
> > See "man diff" and "man patch" for details.
> > Persons who have proven to be trusted contributors will get
> > direct access to the source code repository: they can check in
> > their changes by themselves.
> > Here is a simplified outline of the process:
> > # cd /usr/src/bin/ls
> > # cp ls.1 ls.1.orig
> > # vim ls.1
> > ... you make your changes ...
> > :wq
> > # diff ls.1 ls.1.orig > ls.1.diff
> Sorry to pick on this one error in the huge amounts of useful info
> that you provide, but this is *really* not the way to use diff, at
> least not if you expect anyone else to use the result. First, it
> produces a reverse diff, i.e. the changes needed to go from the new
> version of the file to the old one, which is at least
> annoying/confusing - and second, in combination with using the
> (unfortunately default) "normal" format, it becomes pretty much
> useless. These days, the proper way is
> # diff -u ls.1.orig ls.1 > ls.1.diff
This is of course fully correct. My primary intention was to
provide an (over)simplified idea of how the diff + patch process
works. Thank you for providing a better explanantion, in addition
of pointing out _what_ to improve here. :-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions