Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I report a typo (by sending a diff file)?

Tags:

r

I would like to make correcting typos as easy as possible for the R developers. How can I send a diff file making such a "patch"?

Also, where should I send the typo? Through email? Post a bug? Send it to r-devel?

I am mostly concerned with small typos, such as misspellings or grammatical corrections.

I can't recall where the last typo I saw was, but only as an example, let's just suppose I would like to change "back" to "backward" in "back compatibility in the help file for ls. How can I make a diff patch?

Thank you

like image 816
Xu Wang Avatar asked Nov 06 '11 03:11

Xu Wang


2 Answers

Patches are often made using the unified context diff. You can create such a diff using diff -u.

For example, let's say you start with file foo with the following contents.

Blah
Blah
Blah

Then you modify it, saving the modifications in a new file called foo.modified. Here are the contents of foo.modified:

Blah
Blah
New information!
Blah -- changing this line

Now doing diff -u foo foo.modified produces the following.

--- foo 2011-11-05 20:59:13.000000000 -0700
+++ foo.modified    2011-11-05 20:59:44.000000000 -0700
@@ -1,3 +1,4 @@
 Blah
 Blah
-Blah
+New information!
+Blah -- changing this line

Note that many revision control systems' diffs display the unified context diff.

As for where to send bugs in R: it looks like there is a built-in function for that: bug.report. Alternatively, there is the web interface to the R bug tracking system.

like image 101
David Alber Avatar answered Nov 01 '22 02:11

David Alber


@David Alber's advice about diff formats is good (although I often use diff -c instead), but I beg to differ about the best target (he suggests bug.report and the R bug tracking system).

  • For simple typographical errors, a quick e-mail with sufficient, informal context to the [email protected] mailing list is usually best (make sure you are using the latest version! -- see next point). This is how I do it, and it seems to be preferred by the R developers because it means they don't have to deal with the full bug-reporting machinery. (The only documentation of that protocol I can easily find is this note from Brian Ripley in 2007.)
  • If you're going to report errors more systematically, the best thing if you can stand to make the investment would be to get the latest Subversion release from https://svn.R-project.org/R/trunk (there is a brief although slightly outdated description here), make the changes to the Rd file, and then run an svn diff to get diffs against the latest version. As above, send it to r-devel (I believe text-file attachments are preserved in e-mail to r-devel).
  • Don't forget the usual cautions about sending bug reports: (1) make sure you are reporting against the most recent version (as above, SVN is best if you can stand it); (2) make sure whatever you report is definitely a bug/typo; (3) make sure to report to the appropriate authorities, i.e. report bugs/typos in contributed packages to the maintainer (the relevant package should be listed at the head of the help file, and maintainer("pkg") finds the e-mail address of the maintainer).
like image 26
Ben Bolker Avatar answered Nov 01 '22 02:11

Ben Bolker