Skip to content

Version control (git, mercurial) for R packages

5 messages · Peter Langfelder, Rainer M Krug, Hadley Wickham +1 more

#
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
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/02/12 00:01, Peter Langfelder wrote:
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.
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
- -- 
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-----
#
I think git + github is substantially easier to use, especially if you
want to incorporate patches from the community.
The thing that has made this really successful for me is the
install_github function in devtools.  Then it's easy for people to try
out development versions:

install.packages("devtools")
library(devtools)
install_github("myrepo", "myusername")

This requires a working R development environment but thanks to the
hard work of Simon Urbanek, Duncan Murdoch, Brian Ripley and others,
this is a one-install process on all major platforms.

Hadley
#
Could I gently remind you guys about the R-help litmus test: If an ordinary R _user_ has no clue what you are on about, you are on the wrong list. R-devel would be right.

-pd
On Feb 9, 2012, at 19:28 , Hadley Wickham wrote:

            
....
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

CCd to r-devel as suggested by Peter.
On 09/02/12 19:28, Hadley Wickham wrote:
Thanks Hadley - I should definitely look closer into the devtools
package - there really seem to be some gems in there.
One example is this function - sounds perfect for small scale usages
and for developers.

But what I was thinking about (in my other post as well) is to include
github (or any other git repo provider) into r-forge for the automatic
creation of packages.

So is there an easy way to kind of push a certain revision up to
r-forge to have the automatic builds?
One could do it manualy, but automatic would be so much nicer.
True - no problem for developers.

Cheers,

Rainer
- -- 
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/

iEYEARECAAYFAk800TcACgkQoYgNqgF2ego0QgCfcDIpUlxmVHfYMHi/IlCNKSJ3
1sIAnjQEmBYoTXIE5SlvRUqs/eAioibC
=38uA
-----END PGP SIGNATURE-----