Giter Club home page Giter Club logo

symplegit-java's People

Contributors

ndepomereu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

symplegit-java's Issues

Some feedback...

Hello, I just wanted to leave some feedback on this library.

Context

I'm developing a tool which needs Git functionalities. In particular, but not limited to, it has to clone a huge amount of repositories from different sources.
I started by using JGit but it's so bad it's almost ridiculous. Very often, clone operations are super slow and would end with a EOF exception. Of course, it does not happen with the native command.

Switching to SympleGit

Let's say that the README is quite catchy:

However, JGit's API comes with a learning curve and lacks direct, one-to-one support for CLI actions. Therefore, SympleGit is likely to be a more straightforward option for simple Git integration in many Java projects, particularly those utilizing basic Git functionalities. Let's delve into the details!

In my honest opinion, it cannot be more false. JGit is super easy to use, at least in my use case, every git command is a class in JGit. In SympleGit the clone command class does not exist.
The great thing about SympleGit is that it uses the native command to perform operations, which is so much faster and performant. The bad thing, again in my opinion, is that the API is not so well thought, and it's lacking.

  1. The idea of creating custom git commands with executeGitCommand(...) surely is good to cover all cases even those that are not implemented yet, but still having them implemented as classes would make everything much easier to use.
  2. It's so confusing to do this:
SympleGit sympleGit = SympleGit.custom()
    .setDirectory(repoDirectoryPath)
    .build();

Why do I have to give the directory here instead of giving it to the command directly? Like this for JGit:

CloneCommand cmd = new CloneCommand()
    .setDirectory(destDir.resolve(path).toFile())
    .setURI(url)
    .setRemote(remote)
    .setBranch(branch);
// In this case, destDir is the base dir in which I want to store all the projects
// path is the where I want to clone the repository, the last part of the path will be the name of the directory

I find it a bit more intuitive
3) I read the README multiple times, but I still don't know how I can track the progress of a command. Probably because, yet again, it's not very intuitive. By nature, working with Process and ProcessBuilder in Java is a cumbersome task, processing the output of a process properly is hard. And for this very reason, a library that uses such APIs should make it as easy as possible for the end user to use it.
The first thing that comes to my mind when I want to track the progress of an external process is something like this:

// I get the why of the check...
if (! gitCommander.isResponseOk()) {
    System.out.println("An Error Occured: " + gitCommander.getProcessError());
    return;
}

// Then...
while (command.output ...) {
// print output
}

JGit here is doing a far better job here, I can modify the above command like this:

CloneCommand cmd = new CloneCommand()
    .setProgressMonitor(new TextProgressMonitor()) // And boom, I automatically have output to the console
    .setDirectory(destDir.resolve(path).toFile())
    .setURI(url)
    .setRemote(remote)
    .setBranch(branch);
// Not only that, I can even make custom monitor implementations

Conclusion

I believe SympleGit could become a very good alternative to JGit, but it definitely needs to grow, improve and expand the API.
In the meantime, I think I'll implement a custom solution that uses the native command just like SympleGit because it's simply much much better than JGit which crashes all the time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.