Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LFS Support? #54

Open
bryceschober opened this issue Jun 7, 2024 · 3 comments
Open

LFS Support? #54

bryceschober opened this issue Jun 7, 2024 · 3 comments

Comments

@bryceschober
Copy link

bryceschober commented Jun 7, 2024

I wonder what it would take to support LFS, or if that's too big a lift for the plumbing involved...

Here's my public test case:

testmono.repos.txt:

https://github.com/hraban/tomono.git tomono tools/tomono
https://github.com/Apress/repo-with-large-file-storage.git lfsrepo

I have already install git lfs globally, so that I can just git clone from my own repos using LFS and everything "just works":

$ git clone https://github.com/Apress/repo-with-large-file-storage.git
Cloning into 'repo-with-large-file-storage'...
remote: Enumerating objects: 16, done.
remote: Total 16 (delta 0), reused 0 (delta 0), pack-reused 16
Receiving objects: 100% (16/16), 146.84 KiB | 18.36 MiB/s, done.
Resolving deltas: 100% (5/5), done.
$ cd repo-with-large-file-storage
$ git lfs ls-files
6e1b890daf * LargeFile.zip

But when I run tomono, I get:

$ env MONOREPO_NAME=testmono ./tomono/tomono < testmono.repos.txt
...
From https://github.com/Apress/repo-with-large-file-storage
 * [new branch]      master     -> lfsrepo/master
Downloading lfsrepo/LargeFile.zip (208 MB)
Error downloading object: lfsrepo/LargeFile.zip (6e1b890): Smudge error: Error downloading lfsrepo/LargeFile.zip (6e1b890dafa9956b1bdff43b3fd46aaf273085a1d2041bde7efce6cf5eb0262b): batch request: missing protocol: ""

Errors logged to '/home/bschober/git/testmono/.git/lfs/logs/20240607T153027.89679484.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: lfsrepo/LargeFile.zip: smudge filter lfs failed
@hraban
Copy link
Owner

hraban commented Jun 8, 2024

Have you tried completely uninstalling LFS, doing the merge, and reinstalling afterwards? I just tried it locally with your example and it seems to work here.

As I understand it LFS is "transparent" to bare git (using smudge filters) and you don't actually have to instantiate anything. In fact it will probably be a lot faster :) then do a git lfs update when you're done.

@bryceschober
Copy link
Author

Yep, I think you're right, and for the record for any others setting GIT_LFS_SKIP_SMUDGE=1 is probably the easiest way to disable LFS smudging operations while using this tool.

So, with this testmono.repos.txt:

https://github.com/hraban/tomono.git tomono tools/tomono
https://github.com/Apress/repo-with-large-file-storage.git lfsrepo

...This sequence of commands resulted in the desired behavior:

$ env MONOREPO_NAME=testmono GIT_LFS_SKIP_SMUDGE=1 ./tomono/tomono < testmono.repos.txt
$ git lfs fetch --all lfsrepo

@hraban hraban closed this as completed Jul 15, 2024
@hraban hraban reopened this Jul 23, 2024
@hraban
Copy link
Owner

hraban commented Jul 23, 2024

note to self: should add this to docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants