diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c6cfa3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/RepositoryMinerForGit/target/ +/.idea diff --git a/RepositoryMinerForGit/.gitignore b/RepositoryMinerForGit/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/RepositoryMinerForGit/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/RepositoryMinerForGit/src/main/java/Test.java b/RepositoryMinerForGit/src/main/java/Test.java index 0b7556b..5a9ac40 100644 --- a/RepositoryMinerForGit/src/main/java/Test.java +++ b/RepositoryMinerForGit/src/main/java/Test.java @@ -36,7 +36,7 @@ if( git != null ){ //. git clone File project = new File( "./project" ); - git.cloneRepository().setURI( "http://nitta-lab-www.is.konan-u.ac.jp/gitbucket/git/nitta-lab-2020/org.ntlab.amaryllis.server.git" ).setDirectory( project ).call(); + git.cloneRepository().setURI( "http://nitta-lab-www.is.konan-u.ac.jp/gitbucket/git/nitta-lab-2021/org.ntlab.acanthus_client.git" ).setDirectory( project ).call(); } PlotWalk revWalk = new PlotWalk(repo); @@ -44,20 +44,20 @@ RevCommit root = revWalk.parseCommit(rootId); revWalk.markStart(root); - // �R�~�b�g�R�����g + // コミットコメント PlotCommitList plotCommitList = new PlotCommitList(); plotCommitList.source(revWalk); plotCommitList.fillTo(Integer.MAX_VALUE); for (PlotCommit c: plotCommitList) { - // �R�~�b�g���b�Z�[�W - System.out.println("�R�~�b�g���b�Z�[�W: " + c.getFullMessage()); + // コミットメッセージ + System.out.println("コミットメッセージ: " + c.getFullMessage()); ObjectId curId = c.getTree(); if (c.getParentCount() == 0) { - // �����R�~�b�g + // 初期コミット System.out.println("id:" + c.getId()); } else { - // �e�R�~�b�g�Ƃ̍��� + // 親コミットとの差分 ObjectId parentId = c.getParents()[0].getTree(); System.out.println("id:" + c.getId() + " <== " + c.getParents()[0].getId()); @@ -65,23 +65,23 @@ df.setRepository(repo); df.setDiffComparator(RawTextComparator.DEFAULT); df.setDetectRenames(true); - - ObjectReader reader = repo.newObjectReader(); - CanonicalTreeParser newTreeIter = new CanonicalTreeParser(); - newTreeIter.reset(reader, curId); - CanonicalTreeParser oldTreeIter = new CanonicalTreeParser(); - oldTreeIter.reset(reader, parentId); + + ObjectReader reader = repo.newObjectReader(); + CanonicalTreeParser newTreeIter = new CanonicalTreeParser(); + newTreeIter.reset(reader, curId); + CanonicalTreeParser oldTreeIter = new CanonicalTreeParser(); + oldTreeIter.reset(reader, parentId); List entries = df.scan( oldTreeIter, newTreeIter ); for( DiffEntry entry : entries ) { - // �t�@�C�����̏�� - System.out.println("�p�X: " + entry.getNewPath()); - System.out.println("�ύX�̎��: " + entry.getChangeType()); -// System.out.println("�ύX�̓��e: " + entry); - } + // ファイル毎の情報 + System.out.println("パス: " + entry.getNewPath()); + System.out.println("変更の種類: " + entry.getChangeType()) + // System.out.println("変更の内容: " + entry); + } } - System.out.println("====="); - } + System.out.println("====="); + } } catch (IOException e) { e.printStackTrace(); } catch (InvalidRemoteException e) {