Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Milan
    @milanlakhani
    oh the example, here it is https://pastebin.com/9Jyeq5pN
    Milan
    @milanlakhani
    @joshfarrant that ^ was copied from the tutorial but it just uses a different CORS proxy, and it doesn't use any async commands since I can't get these to work in React. If you scroll up a bit Christian Studer has an iso-git - React example
    Milan
    @milanlakhani
    Does anybody know why I could be getting Uncaught (in promise) TypeError: Cannot read property 'split' of null when I try and use push?
    I may be creating my filesystem too simplistically, window.dir = "/dirk"; pfs.mkdir(dir); pfs.readdir(dir);, but when I try and use window.dir = fs.mkdtemp(path.join(os.tmpdir(), "myTmpDir")); instead, I get Uncaught TypeError: fs.mkdtemp is not a function so if this is the issue I'm not sure how the window.dirshould be set
    Milan
    @milanlakhani
    can lightning fs be used to push?
    Jakub T. Jankiewicz
    @jcubic
    @milanlakhani can you show your exact code? your fs error have nothing to do with push. You don't use the right API, did you check documation for lighting fs how ot use it? Maybe it don't have every function node.js fs module have.
    Milan
    @milanlakhani
    Jakub T. Jankiewicz
    @jcubic
    I'm not sure if it still work like this, I'm using new API with options corsProxy maybe there is a plugin for this as well, I'm not keep up with API changes before 1.0
    I'm also using new API, fs plugin. You can try that, you will not need to add fs to every command.
    Milan
    @milanlakhani
    Sorry I was going to put more and then I started doing research and had a meeting

    From the lightning fs page: "This library does not even come close to implementing the full fs API. Instead, it only implements the subset used by isomorphic-git 'fs' plugin interface plus the fs.promises versions of those functions.

    Unlike BrowserFS, which has a dozen backends and is highly configurable, lightning-fs has a single configuration that should Just Work for most users."

    it sounds like Lightning FS should work like that but I read the docs and couldn't figure it out
    Milan
    @milanlakhani
    I mentioned push because the "Cannot read property 'split' of null" error is rooted in push, the other commands seem to work https://pastebin.com/Q08FW9Lt
    @Jakub thanks for your help, please can I see your code? I just want to know how you can set dir and fs variables properly
    Jakub T. Jankiewicz
    @jcubic
    I have web worker that run git clone in different thread check git-worker.js and main.js file that use the worker when clone it's exactly the same as normal git.clone but it don't freeze the browser.
    BrianHung
    @BrianHung
    @milanlakhani check your arguments for push; I've ran into that error before with my dir argument not being correct
    I'm using lightning fs as well
    Milan
    @milanlakhani
    @BrianHung thanks I'll do this. I did have a go at changing the dir but didn't get it to behave - do you remember what you set your dir to or have a link to your code? my dir is set as /dirk
    it's a Dutch name
    Milan
    @milanlakhani
    Many thanks @jcubic and @BrianHung that's resolved! I accidently used a different dir in my push command lol smh. @jcubic you were correct it had nothing to do with the actual push function.
    BrianHung
    @BrianHung
    glad to have helped :)
    Julien Bouquillon
    @revolunet
    hi
    Julien Bouquillon
    @revolunet

    Hi, i'm new to isomorphic-git :)

    Say i'd like to have an HTTP API to analyse git diffs on some of my repos. Ex: /api/compare/owner/repo/sha1/sha2/path/to/file.txt

    This API should be able to compare versions (using readBlob i guess) and execute a custom report script

    If this API is multi-repo, i guess should i clone each repo in a different dir ? dir:'repos/repo1' or dir:'repos/repo2' ?

    How would one ensure the repos on the API are always up-to-date with the origins ?
    Should i just clone/pull regulary or are there other ways ?

    Dan Allen
    @mojavelinux
    @wmhilton Just stopping by to say congratulations on the 1.0.0 release! I can't wait to start using it.
    William Hilton
    @wmhilton

    How would one ensure the repos on the API are always up-to-date with the origins ?

    Hi @revolunet ! That is a good question. What I would do, if you only need to support a couple of popular hosting providers like GitHub or GitLab, is use their WebHooks to be notified when the repo is changed, and then run git.pull when the webhook endpoint is triggered.

    If this API is multi-repo, i guess should i clone each repo in a different dir ? dir:'repos/repo1' or dir:'repos/repo2' ?

    That should work, as long as you won't run out of disk space. Another possibility is to clone the repo each time and then delete the dir folder afterwards. Its a tradeoff between bandwidth/download time vs disk space. Re-cloning each time would also be easier to scale horizontally I think, since you wouldn't need permanent shared storage.

    William Hilton
    @wmhilton
    @mojavelinux Thanks Dan! From what I've seen of the Antora code, I don't think it'll be too hard to upgrade. Tweet at me (wmhilton) if you have any questions!
    Julien Bouquillon
    @revolunet
    Thanks William and congrats for the release 🎉
    t1rry
    @t1rry
    Hi, I have a question which bothering me for a long time. if the isomorphic-git have commands like git mv? I create a folder tree in my app, when some folder is renamed. I using git.remove to remove the oldpath and git.add newpath then commit. I'm not sure if this is the right process.
    Jakub T. Jankiewicz
    @jcubic
    I'm also wondering how to use git mv It seems that I have not even added mv to my git terminal.
    Jakub T. Jankiewicz
    @jcubic
    Dan Lynch
    @pyramation
    @wmhilton i know lightningfs is for testing, but would you suggest now it's ready for production?
    Dan Lynch
    @pyramation
    I love BFS, but honestly, the backends are pretty hard to read, and I feel like lightningfs or even another lib that would use it as a base, could be built out to make a more extensible bfs
    Jakub T. Jankiewicz
    @jcubic
    @wmhilton Checkout this project https://github.com/petersalomonsen/wasm-git
    Git compiled with WASM
    Dan Allen
    @mojavelinux
    What's going to plague wasm-git is the same thing that plagues any libgit2-based impl. Shoddy documentation. I much prefer the clean slate that isomorphic-git provides with very carefully thought out functions and documentation. I used nodegit for a few years and I just did not have a good experience. isomorphic-git has been such a pleasure in comparison.
    but I could see wasm-git being useful as a reference and certainly for comparing performance
    to put it simply, I trust isomorphic-git.
    BrianHung
    @BrianHung
    wasnt this brought up here: isomorphic-git/isomorphic-git#268
    BrianHung
    @BrianHung
    Has anyone implemented a custom merge strategy using git walk?
    William Hilton
    @wmhilton
    @pyramation We've been using LightningFS in production at Stoplight. I think it's production ready, but everyone's situation is different.
    And yeah, I've been thinking for a while about how I could make LightningFS extendable with custom backends. Not sure when, but it'll happen eventually.
    BrianHung
    @BrianHung
    @wmhilton Thanks for the pointer :) What's the best way to approach a custom merge function if you only need it for a specific datatype? Looking at mergeTree, I would want to modify the code beginning at line 87, and add an additional mergeCustomTypes before mergeBlobs. Is there a cleaner way than copying everything from merge => mergeTree => walk map into a separate merge file that I call in place of git.merge?
    Dan Allen
    @mojavelinux
    @wmhilton I just switched to the typed read functions. I love it!
    @wmhilton I'm looking forward to upgrading to 1.x, but I haven't had time for that change yet.
    BrianHung
    @BrianHung
    Capture.PNG
    Capture1.PNG
    Has anyone ran into an issue with statusMatrix working correctly to correctly read a directory, but adding files in that directory fails? I tried stepping through git.add in the chrome debugger, and it seems that fs.lstat succeeds but the fs.read promise returns a null value while still pending, causing a NotFoundError to be thrown.