@Override public String getCommitMessageShort() throws GitCommitIdExecutionException { return evalCommit.getShortMessage().trim(); }
public static ArrayMemory valueOf(RevCommit value) { ArrayMemory memory = valueOf((RevObject) value); memory.refOfIndex("commitTime").assign(value.getCommitTime()); memory.refOfIndex("encoding").assign(value.getEncodingName()); memory.refOfIndex("shortMessage").assign(value.getShortMessage()); memory.refOfIndex("fullMessage").assign(value.getFullMessage()); ArrayMemory parents = new ArrayMemory(); for (RevCommit revCommit : value.getParents()) { parents.add(valueOf((RevObject)revCommit)); } memory.refOfIndex("parents").assign(parents); PersonIdent authorIdent = value.getAuthorIdent(); memory.refOfIndex("author").assign(authorIdent == null ? Memory.NULL : valueOf(authorIdent)); PersonIdent committerIdent = value.getCommitterIdent(); memory.refOfIndex("committer").assign(committerIdent == null ? Memory.NULL : valueOf(committerIdent)); return memory; }
/** * Construct the squashed commit message. * * @param squashedCommits * the squashed commits * @param target * the target branch * @return squashed commit message */ public String format(List<RevCommit> squashedCommits, Ref target) { StringBuilder sb = new StringBuilder(); sb.append("Squashed commit of the following:\n"); //$NON-NLS-1$ for (RevCommit c : squashedCommits) { sb.append("\ncommit "); //$NON-NLS-1$ sb.append(c.getName()); sb.append("\n"); //$NON-NLS-1$ sb.append(toString(c.getAuthorIdent())); sb.append("\n\t"); //$NON-NLS-1$ sb.append(c.getShortMessage()); sb.append("\n"); //$NON-NLS-1$ } return sb.toString(); }
if (a.getRawBuffer() != null) { w.write(' '); w.write(a.getShortMessage());
private RebaseResult cherryPickCommit(RevCommit commitToPick) throws IOException, GitAPIException, NoMessageException, UnmergedPathsException, ConcurrentRefUpdateException, WrongRepositoryStateException, NoHeadException { try { monitor.beginTask(MessageFormat.format( JGitText.get().applyingCommit, commitToPick.getShortMessage()), ProgressMonitor.UNKNOWN); if (preserveMerges) return cherryPickCommitPreservingMerges(commitToPick); else return cherryPickCommitFlattening(commitToPick); } finally { monitor.endTask(); } }
private boolean autoStashApply() throws IOException, GitAPIException { boolean conflicts = false; if (rebaseState.getFile(AUTOSTASH).exists()) { String stash = rebaseState.readFile(AUTOSTASH); try (Git git = Git.wrap(repo)) { git.stashApply().setStashRef(stash) .ignoreRepositoryState(true).setStrategy(strategy) .call(); } catch (StashApplyFailureException e) { conflicts = true; try (RevWalk rw = new RevWalk(repo)) { ObjectId stashId = repo.resolve(stash); RevCommit commit = rw.parseCommit(stashId); updateStashRef(commit, commit.getAuthorIdent(), commit.getShortMessage()); } } } return conflicts; }
/** * Checks if the commit is user (non P-patch installation) change * @param rc * @return */ protected boolean isUserChangeCommit(RevCommit rc) { return MARKER_USER_CHANGES_COMMIT.equals(rc.getShortMessage()); }
String baseCommit; if (startCommit != null) baseCommit = startCommit.getShortMessage(); else { RevCommit commit = revWalk.parseCommit(repo .resolve(getStartPointOrHead())); baseCommit = commit.getShortMessage();
upstreamCommit.getShortMessage()), ProgressMonitor.UNKNOWN); checkoutCommit(headName, upstreamCommit); monitor.endTask(); for (RevCommit commit : cherryPickList) toDoSteps.add(new RebaseTodoLine(Action.PICK, reader .abbreviate(commit), commit.getShortMessage())); repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO), toDoSteps, false); upstreamCommit.getShortMessage()), ProgressMonitor.UNKNOWN); boolean checkoutOk = false; try {
@Override public String getText(Object element) { final ReflogEntry entry = (ReflogEntry) element; RevCommit c = getCommit(entry); return c == null ? "" : c.getShortMessage(); //$NON-NLS-1$ }
builder.setMessage(MessageFormat.format(indexMessage, branch, headCommit.abbreviate(7).name(), headCommit.getShortMessage())); ObjectId indexCommit = inserter.insert(builder); builder.setMessage(MessageFormat.format(MSG_UNTRACKED, branch, headCommit.abbreviate(7).name(), headCommit.getShortMessage())); untrackedCommit = inserter.insert(builder); workingDirectoryMessage, branch, headCommit.abbreviate(7).name(), headCommit.getShortMessage())); builder.setTreeId(cache.writeTree(inserter)); commitId = inserter.insert(builder);
private void printCommitMessageToLog(TaskListener listener, GitClient git, final Build revToBuild) throws IOException { try { RevCommit commit = git.withRepository(new RevCommitRepositoryCallback(revToBuild)); listener.getLogger().println("Commit message: \"" + commit.getShortMessage() + "\""); } catch (InterruptedException e) { e.printStackTrace(listener.error("Unable to retrieve commit message")); } }
commit.setAuthor(commitToPick.getAuthorIdent()); commit.setReflogComment(REFLOG_PREFIX + " " //$NON-NLS-1$ + commitToPick.getShortMessage()); newHead = commit.call(); } else commit.setMessage(commitToPick.getFullMessage()); commit.setReflogComment(REFLOG_PREFIX + " " //$NON-NLS-1$ + commitToPick.getShortMessage()); newHead = commit.call(); } else {
: parents.size() == 0 ? "commit (initial): " //$NON-NLS-1$ : "commit: "; //$NON-NLS-1$ ru.setRefLogMessage(prefix + revCommit.getShortMessage(), false);
+ " " + srcCommit.getShortMessage(); //$NON-NLS-1$ .setMessage(srcCommit.getFullMessage()) .setReflogComment(reflogPrefix + " " //$NON-NLS-1$ + srcCommit.getShortMessage()) .setAuthor(srcCommit.getAuthorIdent()) .setNoVerify(true).call();
+ " " + srcCommit.getShortMessage(); //$NON-NLS-1$ "BASE", ourName, revertName }); //$NON-NLS-1$ String shortMessage = "Revert \"" + srcCommit.getShortMessage() //$NON-NLS-1$ + "\""; //$NON-NLS-1$ String newMessage = shortMessage + "\n\n" //$NON-NLS-1$
private String getCommitMessage(ObjectId id) { RevCommit commit; try { commit = new RevWalk(objectReader).parseCommit(id); } catch (IOException e) { Activator.logError(UIText.MergeResultDialog_couldNotFindCommit, e); return UIText.MergeResultDialog_couldNotFindCommit; } return commit.getShortMessage(); }
/** * @inheritDoc */ @Override public void resetHard(Git git, RevCommit commit){ try { git.reset().setMode(ResetCommand.ResetType.HARD).setRef(commit.getName()).call(); } catch (GitAPIException e) { throw new RuntimeException("Failed to hard reset to commit "+commit.getShortMessage(), e); } }
protected void print( RevCommit commit ) { if (!print) return; System.out.println(commit.getId().name()); PersonIdent committer = commit.getCommitterIdent(); PersonIdent author = commit.getAuthorIdent(); System.out.println(" Author = " + author); System.out.println(" Committer = " + committer); System.out.println(" Committed = " + values.dateFrom(commit.getCommitTime())); System.out.println(" Title = " + commit.getShortMessage()); System.out.println(" Message = " + commit.getFullMessage().trim()); System.out.println(" Parents = " + commit.getParents()); }
public CommitInfo createCommitInfo(RevCommit entry) { final Date date = GitFacade.getCommitDate(entry); String author = entry.getAuthorIdent().getName(); boolean merge = entry.getParentCount() > 1; String shortMessage = entry.getShortMessage(); String trimmedMessage = Strings.trimString(shortMessage, 78); String name = entry.getName(); String commitHashText = getShortCommitHash(name); return new CommitInfo(commitHashText, name, author, date, merge, trimmedMessage, shortMessage); }