|
|
|
|
Re: How to do "git log --oneline --decorate" in JGit [message #1715168 is a reply to message #1715141] |
Thu, 19 November 2015 18:14 |
|
I have just managed to get the merge commits using the following method:
/**
* Returns the commits returned by the <code>git log --merges</code> command call.
* Commits with 2 or more parents are considered merges, as says the 'git-log' mannual .
*
* @return
*/
public List<RevCommit> call() {
ArrayList<RevCommit> commits = new ArrayList<RevCommit>();
try {
git = new Git(repository);
Iterable<RevCommit> logs = git.log().all().call();
for (RevCommit aCommit : logs) {
count++;
if (aCommit.getParentCount() >= 2) {
commits.add(aCommit);
}else continue;
}
} catch (GitAPIException e) {
// TODO treat GitAPIException
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return commits;
}
Is there any better way to do it?
|
|
|
|
Re: How to do "git log --oneline --decorate" in JGit [message #1715577 is a reply to message #1715201] |
Tue, 24 November 2015 12:50 |
|
Thanks for the answer. And about your question...
Christian Halstrick wrote on Fri, 20 November 2015 03:00Adding "setNoMerges()" and "setMerges()" to LogCommand would also be easy. You want to contribute?
What should I do? Unfortunately, I never contribute to OSS, maybe now it is a good opportunity to start.
|
|
|
|
Re: How to do "git log --oneline --decorate" in JGit [message #1729017 is a reply to message #1715595] |
Sat, 09 April 2016 14:45 |
|
I finally took a time to implement the additions. I tried to follow the guide but Gerrit ended up by refusing my push.
After adding my ssh pub key to my account in Gerrit and commit my changes to my local 'origin/master' i tried to push with
git push ssh://username@git.eclipse.org:29418/jgit/jgit.git HEAD:origin/master
After added the server to my known hosts, I've got the following error message:
Quote:
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (12/12), 1.35 KiB | 0 bytes/s, done.
Total 12 (delta 8 ), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8)
remote: Processing changes: refs: 1, done
To ssh://username@git.eclipse.org:29418/jgit/jgit.git
! [remote rejected] HEAD -> origin/master (prohibited by Gerrit)
error: failed to push some refs to 'ssh://username@git.eclipse.org:29418/jgit/jgit.git'
What am I missing?
|
|
|
|
Re: How to do "git log --oneline --decorate" in JGit [message #1729276 is a reply to message #1729094] |
Tue, 12 April 2016 14:00 |
|
What exactly "refs/for/master" means? I managed to found the find command and then I ran the following:
and given the following answer:
Quote:
.git/refs
.git/refs/heads
.git/refs/heads/master
.git/refs/remotes
.git/refs/remotes/origin
.git/refs/remotes/origin/HEAD
.git/refs/tags
i used the bold path and tried these 2 different pushes, as follows (one at a time)
$ git push ssh://username@git.eclipse.org:29418/jgit/jgit.git HEAD:refs/heads/master
$ git push ssh://username@git.eclipse.org:29418/jgit/jgit.git HEAD:heads/master
but the answer was the same:
Quote:
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (12/12), 1.35 KiB | 0 bytes/s, done.
Total 12 (delta 8 ), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8)
remote: Branch refs/heads/master:
remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.
remote: User: username
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done
To ssh://username@git.eclipse.org:29418/jgit/jgit.git
! [remote rejected] HEAD -> master (prohibited by Gerrit)
error: failed to push some refs to 'ssh://username@git.eclipse.org:29418/jgit/jgit.git'
Is not the public ssh key enough for authentication?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05959 seconds