gpt4 book ai didi

r - git commit 抛出错误 '[<-'

转载 作者:可可西里 更新时间:2023-11-01 10:43:28 26 4
gpt4 key购买 nike

有没有人知道我该如何解决这个问题? git commit -a -m "message here对于其他项目工作正常,并且今天之前的提交都可以。现在,它抛出错误:

Error in [<-(*tmp*, 1, "Date", value = "2016-07-29") :
Indizierung außerhalb der Grenzen
Ausführung angehalten

错误信息是这样的:

index out of bounds

如果您需要任何进一步的信息,请告诉我。

这是一个截图:enter image description here

编辑:@Carsten 猜对了!我有一个钩子(Hook)在运行。但我不明白为什么它会停止工作一分钟到另一分钟......(它仍然不起作用)

#!C:/R/R-3.2.2/bin/x64/Rscript

# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <rflight79@gmail.com>, github.com/rmflight
inc <- TRUE # default
# get the environment variable and modify if necessary
tmpEnv <- as.logical(Sys.getenv("inc"))
if (!is.na(tmpEnv)) {
inc <- tmpEnv
}

# check that there are files that will be committed, don't want to increment version if there won't be a commit
fileDiff <- system("git diff HEAD --name-only", intern = TRUE)

if ((length(fileDiff) > 0) && inc) {

currDir <- getwd() # this should be the top level directory of the git repo
currDCF <- read.dcf("DESCRIPTION")
currVersion <- currDCF[1,"Version"]
splitVersion <- strsplit(currVersion, ".", fixed = TRUE)[[1]]
nVer <- length(splitVersion)
currEndVersion <- as.integer(splitVersion[nVer])
newEndVersion <- as.character(currEndVersion + 1)
splitVersion[nVer] <- newEndVersion
newVersion <- paste(splitVersion, collapse = ".")
currDCF[1,"Version"] <- newVersion
currDCF[1, "Date"] <- strftime(as.POSIXlt(Sys.Date()), "%Y-%m-%d")
write.dcf(currDCF, "DESCRIPTION")
system("git add DESCRIPTION")
cat("Incremented package version and added to commit!\n")
}

最佳答案

感谢@Carsten:使用 print 语句我可以跟踪 Hook 文件中的错误。最后这是一个愚蠢的错误,description 文件中的 Date 被意外删除(=缺失)。

关于r - git commit 抛出错误 '[<-',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38658174/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com