diff --git a/README.md b/README.md index ce2a54e69e92739a6466d9014a4fafd0a0cadd55..c197744cf535f499036146e889c37d250f009391 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GitWrapper # -A set of classes for working with git repositories. The repository is examined using a wrapper around native git calls. +A set of classes for working with git repositories. +The repository is examined using a wrapper around native git calls. The current feature set is limited to extraction of merge commits and associated operations. ### Setup ### @@ -10,17 +11,17 @@ GitWrapper uses the Gradle build system. Using `./gradlew build` will assemble a .jar file containing the library in the `build/libs` directory. The dependencies of the library may be displayed using `./gradlew dependencies --configuration runtime`. -If the project using the library is also a gradle project, it is far more convenient to add the library as a sub-project. The code below assumes that the directory of your clone of GitWrapper is a sibling of the project directory using it. Extend your `settings.gradle` and `build.gradle` as follows: +If the project using the library is also a gradle project, it is far more convenient to add the library as a sub-project. +The code below assumes that the directory of your clone of GitWrapper is a sibling of the project directory using it. +Extend your `settings.gradle` and `build.gradle` as follows: **settings.gradle** -``` -#!groovy +```groovy includeFlat 'GitWrapper' // The name of the directory containing your clone of GitWrapper. ``` **build.gradle** -``` -#!groovy +```groovy dependencies { compile project(':GitWrapper') } @@ -28,9 +29,14 @@ dependencies { ### Logging ### -GitWrapper classes uses the Java standard logging framework for recording exceptions and status messages. The file `Logging.properties` contains an example configuration in which console output for logging messages of the WARNING level is configured for all loggers. All loggers have the canonical name of the class they are used in and are therefore sub-loggers of `de.uni_passau.fim.seibt.gitwrapper`. +GitWrapper classes uses the Java standard logging framework for recording exceptions and status messages. +The file `GitWrapperLogging.properties` contains an example configuration in which console output for logging messages of the WARNING level is configured for all loggers. +All loggers have the canonical name of the class they are used in and are therefore sub-loggers of `de.uni_passau.fim.seibt.gitwrapper`. -One way of configuring logging is to pass `-Djava.util.logging.config.file=<PATH TO Logging.properties>` to the JVM that is using GitWrapper. For other options see [the documentation](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) specifically that of [LogManager](https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html). For a more general overview see [this link](https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html). +One way of configuring logging is to pass `-Djava.util.logging.config.file=<PATH TO Logging.properties>` to the JVM that is using GitWrapper. +For other options see [the documentation](https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/package-summary.html), +specifically that of [LogManager](https://docs.oracle.com/en/java/javase/11/docs/api/java.logging/java/util/logging/LogManager.html). +For a more general overview see [this link](https://docs.oracle.com/en/java/javase/11/core/java-logging-overview.html). In general, WARNING will contain all messages indicating that something went wrong, FINE and FINER will contain (more verbose) status messages and FINEST will print all output of any external commands being called by the library. @@ -38,8 +44,7 @@ In general, WARNING will contain all messages indicating that something went wro The following example code will clone a given repository to the current working directory and display the SHA1 hashes of all merge commits. -``` -#!Java +```java GitWrapper git; try { @@ -49,7 +54,7 @@ try { return; } -Optional<Repository> optRepo = git.clone(new File("."), "git@github.com:se-passau/jdime.git", false); +Optional<Repository> optRepo = git.clone(new File("."), "git@github.com:se-sic/jdime.git", false); optRepo.ifPresent(repo -> repo.getMergeCommits().forEach(mergeCommit -> { System.out.println("Merge Commit: " + mergeCommit.getId()); @@ -57,4 +62,4 @@ optRepo.ifPresent(repo -> repo.getMergeCommits().forEach(mergeCommit -> { ``` ### Contact ### -* Georg Seibt (seibt[at]fim.uni-passau.de) \ No newline at end of file +* Georg Seibt (seibt[at]fim.uni-passau.de)