private String getResult(RefUpdateElement element) { StringBuilder result = new StringBuilder(EMPTY_STRING); PushOperationResult pushOperationResult = element .getPushOperationResult(); final URIish uri = element.getUri(); result.append(UIText.PushResultTable_repository); result.append(SPACE); result.append(uri.toString()); result.append(Text.DELIMITER); result.append(Text.DELIMITER); String message = element.getRemoteRefUpdate().getMessage(); if (message != null) result.append(message).append(Text.DELIMITER); StringBuilder messagesBuffer = new StringBuilder(pushOperationResult .getPushResult(uri).getMessages()); trim(messagesBuffer); if (messagesBuffer.length() > 0) result.append(messagesBuffer).append(Text.DELIMITER); trim(result); return result.toString(); }
final Iterable<PushResult> pushResults = pushCommand.call(); for (PushResult pushResult : pushResults) { logger.debug(pushResult.getMessages());
protected RevCommit commitThenPush(Git git, String branch, CommitCommand commit) throws Exception { RevCommit answer = commit.call(); if (LOG.isDebugEnabled()) { LOG.debug("Committed " + answer.getId() + " " + answer.getFullMessage()); } if (isPushOnCommit()) { Iterable<PushResult> results = doPush(git); for (PushResult result : results) { if (LOG.isDebugEnabled()) { LOG.debug("Pushed " + result.getMessages() + " " + result.getURI() + " branch: " + branch + " updates: " + toString(result.getRemoteUpdates())); } } } return answer; }
protected RevCommit commitThenPush(Git git, CommitCommand commit) throws Exception { RevCommit answer = commit.call(); if (LOG.isDebugEnabled()) { LOG.debug("Committed " + answer.getId() + " " + answer.getFullMessage()); } if (isPushOnCommit()) { Iterable<PushResult> results = doPush(git); for (PushResult result : results) { if (LOG.isDebugEnabled()) { LOG.debug("Pushed " + result.getMessages() + " " + result.getURI() + " branch: " + branch + " updates: " + toString(result.getRemoteUpdates())); } } } return answer; }
log.warn("failed to push tag " + pushResult.getMessages());
+ pushResult.getMessages());
public static RevCommit doCommitAndPush(Git git, String message, UserDetails userDetails, PersonIdent author, String branch, String origin, boolean pushOnCommit) throws GitAPIException { CommitCommand commit = git.commit().setAll(true).setMessage(message); if (author != null) { commit = commit.setAuthor(author); } RevCommit answer = commit.call(); if (LOG.isDebugEnabled()) { LOG.debug("Committed " + answer.getId() + " " + answer.getFullMessage()); } if (pushOnCommit) { PushCommand push = git.push(); configureCommand(push, userDetails); Iterable<PushResult> results = push.setRemote(origin).call(); for (PushResult result : results) { if (LOG.isDebugEnabled()) { LOG.debug("Pushed " + result.getMessages() + " " + result.getURI() + " branch: " + branch + " updates: " + toString(result.getRemoteUpdates())); } } } return answer; }
for (PushResult result : results) { if (LOG.isDebugEnabled()) { LOG.debug("Pushed " + result.getMessages() + " " + result.getURI() + " branch: " + branch + " updates: " + toString(result.getRemoteUpdates()));
protected RevCommit doCommitAndPush(Git git, String message, CredentialsProvider credentials, PersonIdent author, String remote, String branch) throws IOException, GitAPIException { CommitCommand commit = git.commit().setAll(true).setMessage(message); if (author != null) { commit = commit.setAuthor(author); } RevCommit answer = commit.call(); if (LOG.isDebugEnabled()) { LOG.debug("Committed " + answer.getId() + " " + answer.getFullMessage()); } if (isPushOnCommit()) { Iterable<PushResult> results = git.push().setCredentialsProvider(credentials).setRemote(remote).call(); for (PushResult result : results) { if (LOG.isDebugEnabled()) { LOG.debug("Pushed " + result.getMessages() + " " + result.getURI() + " branch: " + branch + " updates: " + GitHelpers.toString(result.getRemoteUpdates())); } } } return answer; }
for (PushResult pr : i) reporter.infoText(getCommandName(), "messages: '" + pr.getMessages() + "'"); if (pr.getMessages() != null && pr.getMessages().length() > 0) { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - status: " + trackingStatus.name() + " - " + pr.getMessages()); } else { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + trackingStatus.name()); throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + pr.getMessages());
for (PushResult pr : i) reporter.infoText(getCommandName(), "messages: '" + pr.getMessages() + "'"); RefUpdate.Result trackingResult = update.getTrackingRefUpdate().getResult(); if (failedResult(trackingResult)) { if (pr.getMessages() != null && pr.getMessages().length() > 0) { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - status: " + trackingResult.name() + " - " + pr.getMessages()); } else { throw new JGitFlowGitAPIException("error pushing to " + branchToPush + " - " + trackingResult.name());
getLog().debug(" * " + pushResult.getMessages());
private void printPushResult(final ObjectReader reader, final URIish uri, final PushResult result) throws IOException { shownURI = false; boolean everythingUpToDate = true; // at first, print up-to-date ones... for (final RemoteRefUpdate rru : result.getRemoteUpdates()) { if (rru.getStatus() == Status.UP_TO_DATE) { if (verbose) printRefUpdateResult(reader, uri, result, rru); } else everythingUpToDate = false; } for (final RemoteRefUpdate rru : result.getRemoteUpdates()) { // ...then successful updates... if (rru.getStatus() == Status.OK) printRefUpdateResult(reader, uri, result, rru); } for (final RemoteRefUpdate rru : result.getRemoteUpdates()) { // ...finally, others (problematic) if (rru.getStatus() != Status.OK && rru.getStatus() != Status.UP_TO_DATE) printRefUpdateResult(reader, uri, result, rru); } AbstractFetchCommand.showRemoteMessages(errw, result.getMessages()); if (everythingUpToDate) outw.println(CLIText.get().everythingUpToDate); }