-
Notifications
You must be signed in to change notification settings - Fork 271
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
git-lfs support? #152
Comments
Have you done any testing? |
@perrette, I'm guessing that not many people here (myself included) have |
I've been using subrepo with lfs and there is a potential issue. E.g. my parent repo is set via .gitattributes to put all .png files in lfs. I have a subrepo that has .png files checked into git (not via lfs). When I do a git status it shows the .png files from the subrepo as "modified" presumably b/c it wants to check them in under git lfs. I had to exclude the subrepo directory so it won't try to do this. Presumably this could be a feature? I.e. if I wanted to track subrepo binary files via lfs even if the subrepo doesn't. But this seems problematic for a |
Hi, It would be great to have subtree working with git-lfs. Any hope to see that implemented? Thank you for this wonderful project. |
This seems like something that can be addressed. Like @ingydotnet I don't have any experience using git-lfs, but If @lp35, @animetrics, and @perrette can help me work through the use cases I am pretty sure we can work something out. The situation as I understand it is that when using git-lfs certain file types are fetched and pushed to another storage solution and a marker inserted into git that describes that transaction. Thought flow of different scenarios:
I obviously missed a bunch of stuff, and I don't have any answers to any of it. This is just to get a conversation going so I can understand the problem better. |
Not sure how git-subrepo works (I am not currently using it), but as a potential user I would expect the git-lfs commands should be executed separately for each sub-repos, following rules from each .gitattributes file (and considering it a normal git file if no .gitattribute is present). Not sure how that can be implemented (i lack detailled knowledge to comment on 1), but for the rest that means |
2.a So a proposal that subrepo creates a .gitattributes to prevent the parent's .gitattribute from executing lfs in the subrepo directory. |
I just had a go at git-subrepo (and also tried to git subrepo pull a repo that contains git-lfs tracked files, which failed because lfs-tracked files are not present on the main remote -- not sure how @animetrics did it). Admittedly this is not the most common case (one would rather expect the main repo to have git-lfs files and the subrepos not, as libraries are generally as light as possible), but this illustrate one first question: should the git-lfs file be duplicated on both servers, as other files are, or should they be fetched where they belong in the first place? I would argue for the second option: only duplicate the reference, and fetch from the lfs-file from original location. If the file is moved from parent to subrepo or the other way around, apply .gitattributes rules to add as git or git-lfs. You might have been there already, I am catching up. 2.a. Now for the issue of isolating the subrepo's and parent's .gitattributes I am not sure how that works, but a first attempt tells me that a sub-folder .gitattributes does NOT overwrite, the parent, though it might add rules to it (test case: the main .gitattributes track *.bin files, a local folder with empty .gitattributes and a test.bin file >> the local test.bin is added via git lfs regardless). 3.a. For me git-lfs in subrepo fails, so I cannot comment on combined subrepo/lfs use. I'd say a challenge to make things work would be to fetch the lfs files on the respective servers... Though thinking about it I wonder whether having full compatibility is worth the effort. |
Depending on the implementation of server-side lfs. On gitlab for example, files are pushed only once. When LFS server receive a new file, it checks if it already has the file stored by checking the hash. Concerning the use case, not very common in open source but common in companies, where compiled libraries can be passed from a team to another team to simplify compilation pipeline and dependencies hell. The use case is really present, and most people are using submodule to handle this case for now. |
I meant, after Well, in fact what I thought was an issue (push/pull to various repos) seems very straightfoward, as it seems that
As far as 3.a. I tested the situation where both main and library have a .gitattributes to track '*.bin' under git-lfs. To my suprise, commiting a file in the parent, then moving it to lib, then executing In conclusion, the basic pipeline works fine as it is, and only minor modifications might be needed. |
Hi, Any update on a potential patch? Thanks! |
Hi, I am also veeery interested by a patch. subrepo is really an excellent tool, thanks a lot for it to all contributors. As of now its lack of LFS support prevent me to use it to its full potential, unfortunately. Thanks in advance! |
Hi,
So it seems that basically it would be enough to add line #3 at the end of the command git subrepo pull, or something similar... |
Just in case: #505 |
@perrette's hint of skipping smudge and later pulling is the only way that I'm able to use git-subrepo successfully. Is there any chance this can be incorporated into git-subrepo? |
This works fine... it would be great if this workaround could be incorporated into subrepo. This stems from an upstream LFS bug that there seems to be no desire to fix from the LFS team git-lfs/git-lfs#1948 |
I will be honest, this hasn't received as much attention as it should because I know little about git lfs and I keep putting off how to figure out to add tests for these features. I will spend some time on the week of May 20th 2024 to rectify this lack of knowledge and add it to the test suite. After I have something that can be tested then we can make sure it works. |
Just wanted to let you know I am still working on the test infrastructure. Specifically git-subrepo is broken with any git version over 2.30. Fortunately it is only very edge cases and probably isn't effecting anyone actively, but the existing tests don't work when I pull up git, and I want to pull up git to work with the newest lfs. This likely won't be done until the middle of June due to scheduling conflicts though. |
I'm glad it's back on the agenda! Because that's the only reason my company can't use it extensively. We need Git LFS for most of our repositories because it allows us to keep all the test data with the source code. |
I am having to deal with git LFS more often now also. So this is high priority right after #602 |
I was wondering, does
git-subrepo
supports dependencies tracked withgit-lfs
?If not, any suggestion for workarounds?
Here some hints: git-lfs/git-lfs#854
I mean,
git-lfs
is a pretty handy tool, so any support would be much appreciated!The solution I have in mind right now, is to create a specific branch in my library (which I am also developing, by chance), where any git-lfs dependency is simply removed.
And then add these files manually in my main project...
Any other idea? Thanks for the great tool !
The text was updated successfully, but these errors were encountered: