本文整理匯總了Java中org.eclipse.jgit.revwalk.RevCommit.getShortMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java RevCommit.getShortMessage方法的具體用法?Java RevCommit.getShortMessage怎麽用?Java RevCommit.getShortMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jgit.revwalk.RevCommit
的用法示例。
在下文中一共展示了RevCommit.getShortMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: revert
import org.eclipse.jgit.revwalk.RevCommit; //導入方法依賴的package包/類
void revert(File project, String message) {
try(Git git = this.gitFactory.open(file(project))) {
RevCommit commit = git.log().setMaxCount(1).call().iterator().next();
String shortMessage = commit.getShortMessage();
String id = commit.getId().getName();
if (!shortMessage.contains("Update SNAPSHOT to ")) {
throw new IllegalStateException("Won't revert the commit with id [" + id + "] "
+ "and message [" + shortMessage + "]. Only commit that updated "
+ "snapshot to another version can be reverted");
}
log.debug("The commit to be reverted is [{}]", commit);
git.revert().include(commit).call();
git.commit().setAmend(true).setMessage(message).call();
printLog(git);
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
示例2: getGitFileInfoList
import org.eclipse.jgit.revwalk.RevCommit; //導入方法依賴的package包/類
/** 저장소의 파일 정보들을 가져와 파일 브라우져를 보여줄 때 사용.
* @param commitID
* @param filePath
* @return
*/
public List<VCSimpleFileInfo> getGitFileInfoList(String commitID,String filePath) {
List<VCSimpleFileInfo> gitFileInfoList = new ArrayList<VCSimpleFileInfo>();
List<String> fileList = this.getGitFileList(commitID);
try{
for(String path: WebUtil.getFileList(fileList, "/"+filePath)){
RevCommit revCommit = CommitUtils.getLastCommit(this.localRepo,
commitID, path.substring(1));
String[] strArray = path.substring(1).split("/");
VCSimpleFileInfo gitFileInfo = new VCSimpleFileInfo(
strArray[strArray.length-1], path.substring(1),
isDirectory(commitID,path.substring(1)),
revCommit.getName(), revCommit.getShortMessage(),
revCommit.getCommitTime(),
revCommit.getCommitterIdent().getName(),
revCommit.getCommitterIdent().getEmailAddress());
gitFileInfoList.add(gitFileInfo);
}
}catch(Exception e){}
return gitFileInfoList;
}
示例3: getLogList
import org.eclipse.jgit.revwalk.RevCommit; //導入方法依賴的package包/類
public List<VCSimpleLog> getLogList(String branchName,
int page, int number) {
List<VCSimpleLog> gitLogList = new ArrayList<VCSimpleLog>();
int startNumber = number * (page - 1);
try {
for(RevCommit commit:git.log().add(
this.getCommit(branchName)).setSkip(startNumber).setMaxCount(number).call()){
VCSimpleLog gitLog = new VCSimpleLog(commit
.getId().getName(), commit.getShortMessage(), commit
.getCommitterIdent().getName(), commit
.getCommitterIdent().getEmailAddress(),
commit.getCommitTime());
gitLogList.add(gitLog);
}
} finally {
return gitLogList;
}
}
示例4: VCSimpleLog
import org.eclipse.jgit.revwalk.RevCommit; //導入方法依賴的package包/類
public VCSimpleLog(RevCommit revCommit){
if(revCommit == null)
return;
this.logID = revCommit.getName();
this.shortMassage = revCommit.getShortMessage();
this.commiterName = revCommit.getAuthorIdent().getName();
this.commiterEmail = revCommit.getAuthorIdent().getEmailAddress();
this.commitDate = new Date(revCommit.getCommitTime()*1000L);
}