r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
146 stars 31 forks source link

Support git-lfs? #160

Open wlandau opened 2 years ago

wlandau commented 2 years ago

I am trying to use gert with git-lfs, and it looks like it does not work out of the box.

library(gert)

> Linking to libgit2 v1.1.0, ssh support: YES

> Global config: /home/CENSORED/.gitconfig

> System config: /etc/gitconfig

> Default user: wlandau will.landau@lilly.com

writeLines("contents", "file.txt") writeLines("file.txt filter=lfs diff=lfs merge=lfs -text", ".gitattributes") git_init() git_add("file.txt")

> # A tibble: 5 x 3

> file status staged

>

> 1 .gitattributes new FALSE

> 2 file.txt new TRUE

> 3 sand-viper_reprex.R new FALSE

> 4 sand-viper_reprex.spin.R new FALSE

> 5 sand-viper_reprex.spin.Rmd new FALSE

git_commit("First commit")

> [1] "117017fc494d2654bae1fd96dedf5149f8bd74a3"

list.files(".git/lfs")

> character(0)


But it does work in the Linux terminal.

```sh
$ echo "contents" >> file.txt
$ echo "file.txt filter=lfs diff=lfs merge=lfs -text" >> .gitattributes
$ git init
$ git add file.txt
$ git commit -m "First commit"
$ ls .git/lfs
objects  tmp

From https://github.com/git-lfs/git-lfs/issues/375 and https://github.com/libgit2/libgit2sharp/issues/1236, it looks like libgit2 + git-lfs is not automatic. Is this something at all feasible in gert?

meowcat commented 2 years ago

I would also be very interested in git lfs support.