From edd @ending from debi@n@org  Thu Dec  6 15:37:33 2018
From: edd @ending from debi@n@org (Dirk Eddelbuettel)
Date: Thu, 6 Dec 2018 08:37:33 -0600
Subject: [Rd] Dealing with .git folder when using R CMD INSTALL
In-Reply-To: <CAO1zAVam+3Urckfga-OTSp7Fci9nCgfbD5CdNqyyJn_aoSfdVQ@mail.gmail.com>
References: <CAO1zAVam+3Urckfga-OTSp7Fci9nCgfbD5CdNqyyJn_aoSfdVQ@mail.gmail.com>
Message-ID: <23561.13357.439690.683278@rob.eddelbuettel.com>


On 6 December 2018 at 15:19, Joris Meys wrote:
| Dear all,
| 
| quite a few package tools depend on R CMD INSTALL today for rapid testing
| of a package, eg:
| 
| - devtools::install()
| - BiocCheck::BiocCheck()
| 
| I've noticed that at least BiocCheck() doesn't ignore version control
| folders like .git. Trying to find out why this was, lead me to R CMD
| INSTALL.
| 
| I know this R CMD build ignores these files and folders by default, but R
| CMD INSTALL doesn't apparently. Is there a way to tell R CMD INSTALL to
| ignore at least the .git folder, or are there plans to add this the R CMD
| INSTALL? And if so, where do I file the request best?

Are you sure?  Eg from src/library/tools/R/utils.R:

## Version control directory names: CVS, .svn (Subversion), .arch-ids
## (arch), .bzr, .git, .hg (mercurial) and _darcs (Darcs)
## And it seems .metadata (eclipse) is in the same category.

.vc_dir_names <-
    c("CVS", ".svn", ".arch-ids", ".bzr", ".git", ".hg", "_darcs", ".metadata")

## and RE version (beware of the need for escapes if amending)

.vc_dir_names_re <-
    "/(CVS|\\.svn|\\.arch-ids|\\.bzr|\\.git|\\.hg|_darcs|\\.metadata)(/|$)"


(and many more similar places in the sources)

These have been auto-ignored by R CMD build for a loooooong time. Are you
maybe making the mistake of installing from a _directory_ as opposed to first
creating a tarball?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] Dealing with .git folder when using R CMD INSTALL
Dirk Eddelbuettel