Code Monkey home page Code Monkey logo

vcs-reader's Introduction

Vcs Reader

This is a library for Java (and JVM languages) with minimal API to read information about commits from version control systems (VCS). It uses native commands to clone/update/log commits and supports Git, Mercurial, Subversion.

Why?

Libraries which can read commits from VCS usually support only one VCS and have lots of additional features which make them complicated. Vcs Reader was designed to support read-only access to multiple VCS with single API.

How to install

Download (wget, curl, etc.) from here https://repo1.maven.org/maven2/org/vcsreader/vcsreader

Maven:

<dependency>
    <groupId>org.vcsreader</groupId>
    <artifactId>vcsreader</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle:

repositories {
	mavenCentral()
}
dependencies {
	compile 'org.vcsreader:vcsreader:1.0.0'
} 

API Example (Java)

public class ReadCommits {
	public static void main(String[] args) {
		VcsProject vcsProject = new VcsProject(new GitVcsRoot(".hamcrest-clone", "https://github.com/hamcrest/JavaHamcrest"));

		if (!new File(".hamcrest-clone").exists()) {
			System.out.println("Cloning...");
			vcsProject.cloneIt();
		}

		LogResult logResult = vcsProject.log(TimeRange.beforeNow());

		for (VcsCommit commit : logResult.commits()) {
			System.out.println(commit.getDateTime() + " " + commit.getAuthor());
		}
	}
}

You can find more examples here.

Features

  • Log commits and changed files (including their content) within date range.
  • Automatic detection of file content charset and its conversion to Java string.
  • Clone and update repository (for git and hg).
  • Access to private repos which require authentication by VCS command line. This has to be setup to automatically authenticate (e.g. using VCS config or SSH keys).
  • Ignored merge commits with only changes by original author reported.
  • Filtering for Svn to include changes only under source root (and exclude changes under other locations).

vcs-reader's People

Contributors

dkandalov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.