Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.PersonIdent


        String host = peer.getCanonicalHostName();
        if (host == null)
          host = peer.getHostAddress();
        String name = "anonymous";
        String email = name + "@" + host;
        rp.setRefLogIdent(new PersonIdent(name, email));
        rp.setTimeout(getTimeout());

        return rp;
      }
    };
View Full Code Here


   * @throws NoMessageException
   *             if the commit message has not been specified
   */
  private void processOptions(RepositoryState state) throws NoMessageException {
    if (committer == null)
      committer = new PersonIdent(repo);
    if (author == null)
      author = committer;

    // when doing a merge commit parse MERGE_HEAD and MERGE_MSG files
    if (state == RepositoryState.MERGING_RESOLVED) {
View Full Code Here

   *            the email of the committer used for the {@code commit}
   * @return {@code this}
   */
  public CommitCommand setCommitter(String name, String email) {
    checkCallable();
    return setCommitter(new PersonIdent(name, email));
  }
View Full Code Here

   *            the email of the author used for the {@code commit}
   * @return {@code this}
   */
  public CommitCommand setAuthor(String name, String email) {
    checkCallable();
    return setAuthor(new PersonIdent(name, email));
  }
View Full Code Here

    long timeof(RevObject o) {
      if (o instanceof RevCommit)
        return ((RevCommit) o).getCommitTime();
      if (o instanceof RevTag) {
        RevTag tag = (RevTag) o;
        PersonIdent who = tag.getTaggerIdent();
        return who != null ? who.getWhen().getTime() : 0;
      }
      return 0;
    }
View Full Code Here

    }
    return parseAuthor(raw);
  }

  private RebaseResult stop(RevCommit commitToPick) throws IOException {
    PersonIdent author = commitToPick.getAuthorIdent();
    String authorScript = toAuthorScript(author);
    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
View Full Code Here

    int minutes = Integer.parseInt(tzOffsetString.substring(3, 5));
    // this is in format (+/-)HHMM (hours and minutes)
    // we need to convert into minutes
    int tz = (hours * 60 + minutes) * multiplier;
    if (name != null && email != null)
      return new PersonIdent(name, email, when, tz);
    return null;
  }
View Full Code Here

    private static final long serialVersionUID = 1L;

    public Component getTableCellRendererComponent(final JTable table,
        final Object value, final boolean isSelected,
        final boolean hasFocus, final int row, final int column) {
      final PersonIdent pi = (PersonIdent) value;

      final String valueStr;
      if (pi != null)
        valueStr = pi.getName() + " <" + pi.getEmailAddress() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
      else
        valueStr = ""; //$NON-NLS-1$
      return super.getTableCellRendererComponent(table, valueStr,
          isSelected, hasFocus, row, column);
    }
View Full Code Here

        "yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$

    public Component getTableCellRendererComponent(final JTable table,
        final Object value, final boolean isSelected,
        final boolean hasFocus, final int row, final int column) {
      final PersonIdent pi = (PersonIdent) value;

      final String valueStr;
      if (pi != null)
        valueStr = fmt.format(pi.getWhen());
      else
        valueStr = ""; //$NON-NLS-1$
      return super.getTableCellRendererComponent(table, valueStr,
          isSelected, hasFocus, row, column);
    }
View Full Code Here

      throws IOException {
    final ObjectId oldId = update.getOldObjectId();
    final ObjectId newId = update.getNewObjectId();
    final Ref ref = update.getRef();

    PersonIdent ident = update.getRefLogIdent();
    if (ident == null)
      ident = new PersonIdent(parent);
    else
      ident = new PersonIdent(ident);

    final StringBuilder r = new StringBuilder();
    r.append(ObjectId.toString(oldId));
    r.append(' ');
    r.append(ObjectId.toString(newId));
    r.append(' ');
    r.append(ident.toExternalString());
    r.append('\t');
    r.append(msg);
    r.append('\n');
    final byte[] rec = encode(r.toString());
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.PersonIdent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.