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

Purpose of isogit-lfs #4

Closed
ronaldtse opened this issue Nov 27, 2021 · 4 comments
Closed

Purpose of isogit-lfs #4

ronaldtse opened this issue Nov 27, 2021 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@ronaldtse
Copy link

ronaldtse commented Nov 27, 2021

This is purely for historic reasons on why we need this library.

Paneron uses a package to access Git, called isomorphic-git. However, this package does not support Git-LFS.

However, we need to provide Paneron with Git-LFS support. There is an existing issue on isomorphic-git's repo about this:

@strogonoff tried out some code from there, modified/updated it and packaged into this current repo.

The initial steps are listed as this repository's issues:

@ronaldtse ronaldtse added the documentation Improvements or additions to documentation label Nov 27, 2021
@ronaldtse
Copy link
Author

This is for @s4birli

@ronaldtse
Copy link
Author

Expectations of @strogonoff :

Or should it provide another object command like readLfsBlob that can be used when walking the tree.

From end user perspective, I believe there are two typical uses as far as reading LFS data goes:

  • Read a blob (possibly at a specified oid). A separate function like readLfsBlob() could work really well actually, matching the readBlob() API and just returning a blob. No need to fetch in parallel or worry about tainting the working directory in this case.
  • Retrieve blobs matching some arbitrary pattern (dependent on UX needs at runtime) into the working directory. A list of object paths would be built for a single batch request, but as @mojavelinux’s pointed out the resulting state of the working directory might confuse other APIs. There’s also the unpleasant race potential, I imagine. Seems both trickier to implement and less essential.

As to adding objects, it’s more difficult to mimc the existing API but a low-level helper function like lfsUpload({ filepath, oid, ... }) could work. One could call it with current oid after adding & committing a file, for example.

Agreed that the behavior of fetching all LFS files matching .gitattributes patterns would rarely be welcome from end application performance standpoint. Actually, personally I’d be fine if IsoGit ignored .gitattributes altogether, and left it to the programmer to decide when use low-level LFS functions.

@strogonoff
Copy link
Collaborator

strogonoff commented Nov 27, 2021 via email

@ronaldtse
Copy link
Author

This module is now functional. Thank you @strogonoff !

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

No branches or pull requests

2 participants