Peter Langfelder
2012-Feb-08 23:01 UTC
[R] Version control (git, mercurial) for R packages
Hi all, in particular package developers, I'm exploring using a version control system to keep better track of changes to the packages I maintain. I'm leaning towards git (although mercurial also looks good) but am not sure what is the best way to set up the repository. It seems I can't set the repository directly within the R package main directory, since it will be incompatible with the standard package structure. I can set the repository in the directory that contains my R packages, but then I have a single repository for all of my packages, which is not ideal. Of course, I could add one extra layer of directory structure (for example, if a package foo sit in directory RPackages/foo I could move it to directory RPackages/foo/foo and set the repository in RPackages/foo) but this seems roundabout and inelegant... I'd be grateful for any suggestions/pointers. Thanks, Peter
Peter Langfelder Thu Feb 9 00:01:31 CET 2012> I'm exploring using a version control system+1! welcome to the new millenium :-)> to keep better track of changes to the [R] packages I maintain. I'm > leaning towards gitI like 'git' too, but one thing to consider (though keep in mind that I'm new to R, so I Could Be Wrong): R-forge https://r-forge.r-project.org/ seems to be the "canonical" place to put R packages, and it's svn. That can be finessed, e.g., http://cameron.bracken.bz/git-with-r-forge FWIW, Tom Roche <Tom_Roche at pobox.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/02/12 00:01, Peter Langfelder wrote:> Hi all, in particular package developers, > > I'm exploring using a version control system to keep better track > of changes to the packages I maintain. I'm leaning towards git > (although mercurial also looks good) but am not sure what is the > best way to set up the repository. It seems I can't set the > repository directly within the R package main directory, since it > will be incompatible with the standard package structure. I can set > the repository in the directory that contains my R packages, but > then I have a single repository for all of my packages, which is > not ideal.Git is nice - but if you ar looking for simplicity in usage for R packages, I guess r-forge and rforge are the easiest to use. But I would be interested in the workflow when using github as the main VCS.> > Of course, I could add one extra layer of directory structure (for > example, if a package foo sit in directory RPackages/foo I could > move it to directory RPackages/foo/foo and set the repository in > RPackages/foo) but this seems roundabout and inelegant... > > I'd be grateful for any suggestions/pointers.I might be missing something here, but I am using r-forge (http://r-forge.r-project.org/) for exactly that. There is also rforge (http://www.rforge.net/) and some packages are on github. My folder looks as follow: - -local name for the package (selected folders / fiiles under VC) +--pkg (under VC) +--www (under VC) +--other fiolders (not under VC) If a project gets registered at r-forge, you can check it out and you have all the relevant info in a README file - don't know about rforge. Hope this helps, Cheers, Rainer> > Thanks, > > Peter > > ______________________________________________ R-help at r-project.org > mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do > read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.- -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer at krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8zhzsACgkQoYgNqgF2egrKOQCfb2tpU0lvS2F394gGDv+4c+Lp m4EAnRO76W8Rm2OM6yQ2QoWF0xQcEfBD =3QHA -----END PGP SIGNATURE-----
Peter Langfelder
2012-Feb-09 18:08 UTC
[R] Version control (git, mercurial) for R packages
On Thu, Feb 9, 2012 at 1:46 AM, Gregory Jefferis <jefferis at gmail.com> wrote:> Dear Peter, > > Trying to respond to your original questionThanks for staying on thread :)>> > I have a git repositiory in the root of my packages: > > ie > > package-foo/.git > package-foo/R > package-foo/inst > > Running make check in place warns about the presence of binary files, but > that is the only problem I have found ? have you come across another > problem.Same warning here. Which made me think that R CMD build will probably tar up the git repository along with the package, which is not something I would like to do, and which CRAN people most likely won't tolerate in a package on CRAN. I have also switched to using Hadley Wickham's devtools (+ roxygen> for docs). Both highly recommended. devtools can build a package and check > it in a temporary location ? this is safer than checking in place and avoids > that warning.I'll check that out.> > You can see layouts for Hadley's packages on github e.g. : > > https://github.com/hadley/devtools > > Best wishes, > > Greg.Thanks for the suggestions. It occurred to me that I can write a short script that will copy the package minus the git repository into a temporary location and check or build it there, but I'll look into devtools as well. Peter