Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.PersonIdent


   * @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

        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

      String msg)
      throws IOException {
    // commit the note
    CommitBuilder builder = new CommitBuilder();
    builder.setTreeId(map.writeTree(inserter));
    builder.setAuthor(new PersonIdent(repo));
    builder.setCommitter(builder.getAuthor());
    builder.setMessage(msg);
    if (notesCommit != null)
      builder.setParentIds(notesCommit);
    ObjectId commit = inserter.insert(builder);
View Full Code Here

      String msg)
      throws IOException {
    // commit the note
    CommitBuilder builder = new CommitBuilder();
    builder.setTreeId(map.writeTree(inserter));
    builder.setAuthor(new PersonIdent(repo));
    builder.setCommitter(builder.getAuthor());
    builder.setMessage(msg);
    if (notesCommit != null)
      builder.setParentIds(notesCommit);
    ObjectId commit = inserter.insert(builder);
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

    }
    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

    // before the LF in case of LF termination resp. the penultimate
    // character if there is no trailing LF.
    final int tzBegin = lastIndexOfTrim(raw, ' ',
        nextLF(raw, emailE - 1) - 2) + 1;
    if (tzBegin <= emailE) // No time/zone, still valid
      return new PersonIdent(name, email, 0, 0);

    final int whenBegin = Math.max(emailE,
        lastIndexOfTrim(raw, ' ', tzBegin - 1) + 1);
    if (whenBegin >= tzBegin - 1) // No time/zone, still valid
      return new PersonIdent(name, email, 0, 0);

    final long when = parseLongBase10(raw, whenBegin, null);
    final int tz = parseTimeZoneOffset(raw, tzBegin);
    return new PersonIdent(name, email, when * 1000L, tz);
  }
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.