Author: struberg Date: Sun Feb 13 21:59:42 2011 New Revision: 1070310 URL: http://svn.apache.org/viewvc?rev=1070310&view=rev Log: [SCM-607] add committer parsing to GitBlameConsumer
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumer.java Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumer.java URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumer.java?rev=1070310&r1=1070309&r2=1070310&view=diff ============================================================================== --- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumer.java (original) +++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumer.java Sun Feb 13 21:59:42 2011 @@ -43,13 +43,15 @@ public class GitBlameConsumer private final static String GIT_COMMITTER_PREFIX = "committer"; private final static String GIT_COMMITTER = GIT_COMMITTER_PREFIX + " "; private final static String GIT_COMMITTER_TIME = GIT_COMMITTER_PREFIX + "-time "; + private final static String GIT_AUTHOR = "author "; private List<BlameLine> lines = new ArrayList<BlameLine>(); - private String revision = null; - private String author = null; - private Date time = null; + private String revision = null; + private String author = null; + private String committer = null; + private Date time = null; private boolean expectRevisionLine = true; @@ -79,9 +81,15 @@ public class GitBlameConsumer } else { + if ( line.startsWith( GIT_AUTHOR ) ) + { + author = line.substring( GIT_AUTHOR.length() ); + return; + } + if ( line.startsWith( GIT_COMMITTER ) ) { - author = line.substring( GIT_COMMITTER.length() ); + committer = line.substring( GIT_COMMITTER.length() ); return; } @@ -97,7 +105,7 @@ public class GitBlameConsumer { // this is the content line. // we actually don't need the content, but this is the right time to add the blame line - getLines().add( new BlameLine( time, revision, author ) ); + getLines().add( new BlameLine( time, revision, author, committer ) ); if ( getLogger().isDebugEnabled() ) {