Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.Repository.resolve()


            count++;
        }
        System.out.println("Had " + count + " commits overall on current branch");

        logs = new Git(repository).log()
                .add(repository.resolve("remotes/origin/testbranch"))
                .call();
        count = 0;
        for (RevCommit rev : logs) {
            System.out.println("Commit: " + rev /* + ", name: " + rev.getName() + ", id: " + rev.getId().getName() */);
            count++;
View Full Code Here


    public static void main(String[] args) throws IOException, GitAPIException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        // The {tree} will return the underlying tree-id instead of the commit-id itself!
        ObjectId oldHead = repository.resolve("HEAD^^^^{tree}");
        ObjectId head = repository.resolve("HEAD^{tree}");

        System.out.println("Printing diff between tree: " + oldHead + " and " + head);

        // prepare the two iterators to compute the diff between
View Full Code Here

    public static void main(String[] args) throws IOException, GitAPIException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        // The {tree} will return the underlying tree-id instead of the commit-id itself!
        ObjectId oldHead = repository.resolve("HEAD^^^^{tree}");
        ObjectId head = repository.resolve("HEAD^{tree}");

        System.out.println("Printing diff between tree: " + oldHead + " and " + head);

        // prepare the two iterators to compute the diff between
    ObjectReader reader = repository.newObjectReader();
View Full Code Here

    public static void main(String[] args) throws IOException, GitAPIException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        // find the HEAD
        ObjectId lastCommitId = repository.resolve(Constants.HEAD);

        // a RevWalk allows to walk over commits based on some filtering that is defined
        RevWalk revWalk = new RevWalk(repository);
        RevCommit commit = revWalk.parseCommit(lastCommitId);
        // and using commit's tree find the path
View Full Code Here

    public static void main(String[] args) throws IOException, GitAPIException {
        // prepare a new test-repository
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        BlameCommand blamer = new BlameCommand(repository);
        ObjectId commitID = repository.resolve("HEAD");
        blamer.setStartCommit(commitID);
        blamer.setFilePath("README.md");
        BlameResult blame = blamer.call();

        // read the number of lines from the commit to not look at changes in the working copy
View Full Code Here

    public static void main(String[] args) throws IOException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        // basic syntax is similar to getRef()
        ObjectId id = repository.resolve("HEAD");
        System.out.println("ObjectId of HEAD: " + id);

        // however resolve() supports almost all of the git-syntax, where getRef() only works on names
        id = repository.resolve("HEAD^1");
        System.out.println("ObjectId of HEAD: " + id);
View Full Code Here

        // basic syntax is similar to getRef()
        ObjectId id = repository.resolve("HEAD");
        System.out.println("ObjectId of HEAD: " + id);

        // however resolve() supports almost all of the git-syntax, where getRef() only works on names
        id = repository.resolve("HEAD^1");
        System.out.println("ObjectId of HEAD: " + id);

        id = repository.resolve("b419522521af553ae2752fd1b609f2aa11062243");
        System.out.println("ObjectId of specific commit: " + id);
       
View Full Code Here

        // however resolve() supports almost all of the git-syntax, where getRef() only works on names
        id = repository.resolve("HEAD^1");
        System.out.println("ObjectId of HEAD: " + id);

        id = repository.resolve("b419522521af553ae2752fd1b609f2aa11062243");
        System.out.println("ObjectId of specific commit: " + id);
       
        id = repository.resolve("05d18a76875716fbdbd2c200091b40caa06c713d");
        System.out.println("ObjectId of merged commit: " + id);
View Full Code Here

        System.out.println("ObjectId of HEAD: " + id);

        id = repository.resolve("b419522521af553ae2752fd1b609f2aa11062243");
        System.out.println("ObjectId of specific commit: " + id);
       
        id = repository.resolve("05d18a76875716fbdbd2c200091b40caa06c713d");
        System.out.println("ObjectId of merged commit: " + id);

        repository.close();
    }
}
View Full Code Here

    public static void main(String[] args) throws IOException {
        Repository repository = CookbookHelper.openJGitCookbookRepository();

        RevWalk revWalk = new RevWalk( repository );
        RevCommit masterHead = revWalk.parseCommit( repository.resolve( "refs/heads/master" ));
       
        // first a commit that was merged
        ObjectId id = repository.resolve("05d18a76875716fbdbd2c200091b40caa06c713d");
        System.out.println("Had id: " + id);
        RevCommit otherHead = revWalk.parseCommit( id );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.