isomorphic-git icon indicating copy to clipboard operation
isomorphic-git copied to clipboard

Large repository usage problems (too many pack files, timeout issues)

Open GTVolk opened this issue 1 year ago • 3 comments

Node v20.11.1

I use your amazing library to make a universal code editor via Electron app. But, i have large repositories (several gigabytes) with several branches to work with, and there are several problems that blocks me from using this library with it:

  1. There is no way to specify a timeout in the node http module. I had to take the source code and add a line with a timeout override. image Without it cloning a large repositories failed by timeout... Is there a any way to make it prettier and from library API?

  2. When i clone repository as singleBranch: true, i use only fetch, fast-forward and push. But my local copy accumulates a large number of large pack files, although with the same work through the console git client there are 1-2 files of several kilobytes. image So, when i'am adding small json file by several kilobytes in repository then repository grows in size by 300-500 Mb each time... Is this correct behavior?

Please, help

GTVolk avatar Jan 13 '25 14:01 GTVolk

For the first issue, you can contribute and add a feature like this. But I think it would be better to allow using AbortSignal instead of timeout number.

As for 2 I have no idea, you will need to read the code and debug yourself, if you will find a way to fix this then I'm happy to merge your PR. Maybe this is something about Garbage Collection (gc) that is part of canonical git.

jcubic avatar Jan 13 '25 15:01 jcubic

@GTVolk the growing is as of time of writing total expected the lib is missing all the optimizations a full git client would have:

  • GC Clean up none needed pack files and repack

So yes all the stuff that you see is expected at present and should get better over time when the missing stuff got added to the lib.

lemanschik avatar Oct 14 '25 09:10 lemanschik

Same issue here. It would be great if this timeout could be configurable via an environment variable. In my use case, isomorphic‑git is used indirectly through another library, so I don’t have a direct way to control this setting.

mikeungers avatar Apr 17 '26 13:04 mikeungers