Git Product home page Git Product logo

bit-man / swissarmyjavagit Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 6.0 1.51 MB

JavaGit fork (http://javagit.sourceforge.net/) JavaGit is a Java API that provides access to git repositories. Our goal is to provide a library with an easy-to-use API that is intuitive for developers new to git and developers who are veteran git users.

License: Other

Shell 0.31% Java 99.69%
git java java-api javagit-jar swiss-army-javagit

swissarmyjavagit's People

Contributors

bit-man avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

swissarmyjavagit's Issues

Windows 7: How to setup GitPath?

Hi there,

I am trying to use this Library on Windows and have problems setting the gitpath for my standard installation of mysysgit. The "git.exe" resides in "C:\Program Files (x86)\Git\bin".

I think the problem is, that

   JavaGitConfiguration.determineGitVersion()

Is evaluating the pure "git" command, without the windows related .exe extension.
Here's the stacktrace:

edu.nyu.cs.javagit.api.JavaGitException: 100002: Invalid path to git specified. { path=[C:\Program Files (x86)\Git\bin] }
    at edu.nyu.cs.javagit.api.JavaGitConfiguration.setGitPath(JavaGitConfiguration.java:220)
    at edu.nyu.cs.javagit.api.JavaGitConfiguration.setGitPath(JavaGitConfiguration.java:247)
    at net.lidl.gitwatcher.git.GitRepositoryHandlerTest.testJavaGitConfigurationSetGitPath(GitRepositoryHandlerTest.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
Caused by: edu.nyu.cs.javagit.api.JavaGitException: 100002: Invalid path to git specified.
    at edu.nyu.cs.javagit.api.JavaGitConfiguration.determineGitVersion(JavaGitConfiguration.java:81)
    at edu.nyu.cs.javagit.api.JavaGitConfiguration.setGitPath(JavaGitConfiguration.java:217)

Now I am wondering what I am doing wrong, as the README says this has been tested on windows?

Extra parameter passing

To keep the change pace with Git command parameters passing extra parameters to Git commands should be added. This will help not only to keep pace (Git 2.0 is here !!) but to implement many commands with just no parameter and letting the user to pass them and use full Git power

Why branch name contains quotes and double quotes ?

See TestGitCheckout.testCreatingNewBranchFromMaster() where GitCheckoutResponse.getNewBranch().getName() returns the branch name but "decorated" with single or double quotes.
I surely will change it to not add the quotes but this will break backwards compatibility.
Ask to JavaGit people and try to locate users of the old JavaGit code and learn from them

GIT v1.8.3 research topics

When "git add -u" and "git add -A", that does not specify what paths to add on the command line, is run from inside a subdirectory, the scope of the operation has always been limited to the subdirectory. Many users found this counter-intuitive, given that "git commit -a" and other commands operate on the entire tree regardless of where you are. In this release, these commands give warning in such a case and encourage the user to say "git add -u/-A ." instead when restricting the scope to the current directory.

Backward compatibility notes (for Git 2.0)

When "git add -u" (and "git add -A") is run inside a subdirectory and
does not specify which paths to add on the command line, it
will operate on the entire tree in Git 2.0 for consistency
with "git commit -a" and other commands. There will be no
mechanism to make plain "git add -u" behave like "git add -u .".
Current users of "git add -u" (without a pathspec) should start
training their fingers to explicitly say "git add -u ."
before Git 2.0 comes. A warning is issued when these commands are
run without a pathspec and when you have local changes outside the
current directory, because the behaviour in Git 2.0 will be different
from today's version in such a situation.

File path containing spaces fails to add

When trying to add a file containing space(s) in its path JavaGit fails with the next error :

Caught: edu.nyu.cs.javagit.api.JavaGitException: 401000: Error calling git-add. - git add error message: { Line 1. fatal: pathspec 'tools.iml' did not match any files }
edu.nyu.cs.javagit.api.JavaGitException: 401000: Error calling git-add. - git add error message: { Line 1. fatal: pathspec 'tools.iml' did not match any files }
at edu.nyu.cs.javagit.client.cli.CliGitAdd$GitAddParser.getResponse(CliGitAdd.java:276)
at edu.nyu.cs.javagit.client.cli.CliGitAdd$GitAddParser.getResponse(CliGitAdd.java:167)
at edu.nyu.cs.javagit.client.cli.ProcessUtilities.runCommand(ProcessUtilities.java:145)
at edu.nyu.cs.javagit.client.cli.CliGitAdd.add(CliGitAdd.java:49)
at edu.nyu.cs.javagit.client.cli.CliGitAdd.add(CliGitAdd.java:74)
at edu.nyu.cs.javagit.api.commands.GitAdd.add(GitAdd.java:218)
at edu.nyu.cs.javagit.api.commands.GitAdd$add.call(Unknown Source)

NPE on Changes not staged for commit

When there's unless one file modified (and shown under "Changes not staged for commit") the outputstate is not set and causes an NPE when adding the modified file

This happens only if this is the first block shown in git status output

Wrong path separator

When determining git version or obtaining the git command prefix the classpath separator was used instead of path separator.

In Linux this means that instead of trying to execute "/usr/bin/git" tries to run "/usr/bin:git"

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.