Example usage for org.eclipse.jgit.revplot PlotCommit getFullMessage

List of usage examples for org.eclipse.jgit.revplot PlotCommit getFullMessage

Introduction

In this page you can find the example usage for org.eclipse.jgit.revplot PlotCommit getFullMessage.

Prototype

public final String getFullMessage() 

Source Link

Document

Parse the complete commit message and decode it to a string.

Usage

From source file:com.madgag.agit.CommitDetailsFragment.java

License:Open Source License

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    try {//w  w w  .  ja v a2s .c  om
        Repository repository = new FileRepository(gitDirFrom(getArguments()));
        ObjectId commitId = revisionIdFrom(repository, getArguments(), REVISION);
        Log.d(TAG, "onCreateView with " + commitId);

        View v = inflater.inflate(R.layout.commit_detail_view, container, false);

        CommitNavigationView commitNavigationView = (CommitNavigationView) v
                .findViewById(R.id.commit_navigation);

        commitNavigationView.setCommitSelectedListener(commitSelectedListener);
        PlotCommit<PlotLane> commit = commitSelectedListener.plotCommitFor(commitId);

        commitNavigationView.setCommit(commit);

        ((ObjectIdView) v.findViewById(R.id.commit_id)).setObjectId(commit);

        ViewGroup vg = (ViewGroup) v.findViewById(R.id.commit_people_group);

        PersonIdent author = commit.getAuthorIdent(), committer = commit.getCommitterIdent();
        if (author.equals(committer)) {
            addPerson("Author & Committer", author, vg);
        } else {
            addPerson("Author", author, vg);
            addPerson("Committer", committer, vg);
        }
        TextView textView = (TextView) v.findViewById(R.id.commit_message_text);
        textView.setText(commit.getFullMessage());
        return v;
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.madgag.agit.CommitView.java

License:Open Source License

private void showCommitDetailsFor(final PlotCommit<PlotLane> commit) {
    commitNavigationView = (CommitNavigationView) findViewById(R.id.commit_navigation);
    Log.d("CV", "Got commitNavigationView=" + commitNavigationView + " commitSelectedListener="
            + commitSelectedListener);//from   www .  j  av  a  2 s . com
    commitNavigationView.setCommitSelectedListener(commitSelectedListener);

    ((ObjectIdView) findViewById(R.id.commit_id)).setObjectId(commit);

    ViewGroup vg = (ViewGroup) findViewById(R.id.commit_people_group);

    PersonIdent author = commit.getAuthorIdent(), committer = commit.getCommitterIdent();
    if (author.equals(committer)) {
        addPerson("Author & Committer", author, vg);
    } else {
        addPerson("Author", author, vg);
        addPerson("Committer", committer, vg);
    }
    //      ViewGroup vg = (ViewGroup) findViewById(R.id.commit_refs_group);
    //      for (int i=0; i<commit.getRefCount(); ++i) {
    //         TextView tv = new TextView(getContext());
    //         tv.setText(commit.getRef(i).getName());
    //         vg.addView(tv);
    //      }
    TextView textView = (TextView) findViewById(R.id.commit_message_text);
    textView.setText(commit.getFullMessage());
    //      
    //      int width=textView.getBackground().getIntrinsicWidth(); // textView.getBackground is null at somepoint?
    //      Log.d("CV", "M Width = "+width);
    //      textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, width/80);
}

From source file:org.commonjava.freeki.store.GitManagerTest.java

License:Open Source License

@Test
public void getLogForValidFile() throws Exception {
    final PlotCommit<PlotLane> log = git.getHeadCommit(new File(dir, "mygroup/page-id.md"));
    assertThat(log, notNullValue());//from   w  w  w . j a va 2  s.  c o  m
    final PersonIdent ident = log.getAuthorIdent();
    assertThat(ident, notNullValue());
    assertThat(ident.getName(), notNullValue());
    assertThat(ident.getEmailAddress(), notNullValue());
    assertThat(ident.getWhen(), notNullValue());

    final String message = log.getFullMessage();
    assertThat(message, notNullValue());

    System.out.printf("%s %s %s %s %s\n\n%s\n", ident.getName(), ident.getEmailAddress(), ident.getWhen(),
            ident.getTimeZone().getID(), ident.getTimeZoneOffset(), message);
}