Permalink
Browse files

- Removed superfluous comma at the end of `zzz.r` (Thanks @wch)

- Changes:
  - Clone with --depth 1 and --no-hardlinks. Makes it a whole lot faster.
  - Sys.chmod(755) instead of 777
  - Removed the .git from the name we display when checking out the code
    if a `.git` is present in the base name.
  - Removed the `git_version` function as there's no need for it just
    yet.
  • Loading branch information...
1 parent 6bb4860 commit 2435934058d8c19d01ecd402cbe8e539b2aa7b9a David Coallier committed Dec 14, 2012
Showing with 11 additions and 8 deletions.
  1. +10 −7 R/install-git.r
  2. +1 −1 R/zzz.r
View
@@ -42,6 +42,14 @@ install_git_single <- function(git_url, name = NULL, subdir = NULL,
git_binary = NULL, config = list(), ...) {
if (is.null(name)) {
name <- basename(git_url)
+
+ # Following the feedback from @wch, we remove
+ # the "git" suffix from the name of the clone folder.
+ parts = unlist(strsplit(name, ".", fixed=TRUE))
+
+ if (tail(parts, n=1) == 'git') {
+ name = paste(head(parts, n=-1), collapse=".")
+ }
}
message("Preparing installation of ", name, " using the Git-URL: ", git_url)
@@ -57,7 +65,7 @@ install_git_single <- function(git_url, name = NULL, subdir = NULL,
# and repositories with the public SSH key set.
request <- system2(
git_binary_path,
- args = c('clone', git_url, bundle),
+ args = c('clone', '--depth', '1', '--no-hardlinks', git_url, bundle),
stdout = FALSE, stderr = FALSE
)
@@ -76,18 +84,13 @@ install_git_single <- function(git_url, name = NULL, subdir = NULL,
config_path <- file.path(pkg_path, "configure")
if (file.exists(config_path)) {
- Sys.chmod(config_path, "777")
+ Sys.chmod(config_path, "755")
}
# Install
install(pkg_path, ...)
}
-#' Retrieve the currently installed git-cli version.
-git_version <- function() {
- system2(git_path(), args=c('--version'))
-}
-
#' Retrieve the current running path of the git binary.
#' @param git_binary_name The name of the binary depending on the OS.
View
@@ -68,7 +68,7 @@ current_ver <- function() {
op <- options()
op.devtools <- list(
devtools.path="~/R-dev",
- github.user="hadley",
+ github.user="hadley"
)
toset <- !(names(op.devtools) %in% names(op))
if(any(toset)) options(op.devtools[toset])

0 comments on commit 2435934

Please sign in to comment.