Class GitChangeLogConsumer
java.lang.Object
org.apache.maven.scm.util.AbstractConsumer
org.apache.maven.scm.provider.git.gitexe.command.changelog.GitChangeLogConsumer
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternThe pattern used to match git author lines.private ChangeSetThe current log entry being processed by the parser.private StringBuilderThe current comment of the entry being processed by the parser.private StringThe current revision of the entry being processed by the parser.private static final PatternThe pattern used to match git date lines.List of change log entries.private static final PatternThe pattern used to match git file lines.private static final StringDate formatter for git timestamp we use iso format cli git log --date=iso sample : 2008-08-06 01:37:18 +0200.private static final PatternThe pattern used to match git header lines.private static final PatternThe pattern used to match git author lines (raw mode)private static final PatternThe pattern used to match git author lines (raw mode)private static final PatternThe pattern used to match git parent hash lines (raw mode)private static final PatternThe pattern used to match git tree hash lines (raw mode)private intCurrent status of the parser.private static final intState machine constant: expecting author information.private static final intState machine constant: expecting comments.private static final intState machine constant: expecting date information.private static final intState machine constant: expecting file information.private static final intState machine constant: expecting header.private static final intState machine constant: expecting author name, email and timestamp information.private static final intState machine constant: expecting committer name, email and timestamp information.private static final intState machine constant: expecting parent hash information.private static final intState machine constant: expecting parent hash information.private final StringFields inherited from class AbstractConsumer
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddParentRevision(String hash) In git log, both parent and merged revisions are called parent.voidconsumeLine(String line) private voidprocessGetAuthor(String line) Process the current input line in the STATUS_GET_AUTHOR state.private voidprocessGetComment(String line) Process the current input line in the GET_COMMENT state.private voidprocessGetDate(String line, Locale locale) Process the current input line in the STATUS_GET_DATE state.private voidprocessGetFile(String line) Process the current input line in the GET_FILE state.private voidprocessGetHeader(String line) Process the current input line in the GET_HEADER state.private voidprocessGetRawAuthor(String line) Process the current input line in the STATUS_RAW_AUTHOR state.private voidprocessGetRawCommitter(String line) Process the current input line in the STATUS_RAW_AUTHOR state.private voidprocessGetRawParent(String line) Process the current input line in the STATUS_RAW_PARENT state.private voidprocessGetRawTree(String line) Process the current input line in the STATUS_RAW_TREE state.private voidMethods inherited from class AbstractConsumer
parseDate, parseDate
-
Field Details
-
GIT_TIMESTAMP_PATTERN
Date formatter for git timestamp we use iso format cli git log --date=iso sample : 2008-08-06 01:37:18 +0200.- See Also:
-
STATUS_GET_HEADER
private static final int STATUS_GET_HEADERState machine constant: expecting header.- See Also:
-
STATUS_GET_AUTHOR
private static final int STATUS_GET_AUTHORState machine constant: expecting author information.- See Also:
-
STATUS_RAW_TREE
private static final int STATUS_RAW_TREEState machine constant: expecting parent hash information.- See Also:
-
STATUS_RAW_PARENT
private static final int STATUS_RAW_PARENTState machine constant: expecting parent hash information.- See Also:
-
STATUS_RAW_AUTHOR
private static final int STATUS_RAW_AUTHORState machine constant: expecting author name, email and timestamp information.- See Also:
-
STATUS_RAW_COMMITTER
private static final int STATUS_RAW_COMMITTERState machine constant: expecting committer name, email and timestamp information.- See Also:
-
STATUS_GET_DATE
private static final int STATUS_GET_DATEState machine constant: expecting date information.- See Also:
-
STATUS_GET_FILE
private static final int STATUS_GET_FILEState machine constant: expecting file information.- See Also:
-
STATUS_GET_COMMENT
private static final int STATUS_GET_COMMENTState machine constant: expecting comments.- See Also:
-
HEADER_PATTERN
The pattern used to match git header lines. -
AUTHOR_PATTERN
The pattern used to match git author lines. -
RAW_TREE_PATTERN
The pattern used to match git tree hash lines (raw mode) -
RAW_PARENT_PATTERN
The pattern used to match git parent hash lines (raw mode) -
RAW_AUTHOR_PATTERN
The pattern used to match git author lines (raw mode) -
RAW_COMMITTER_PATTERN
The pattern used to match git author lines (raw mode) -
DATE_PATTERN
The pattern used to match git date lines. -
FILE_PATTERN
The pattern used to match git file lines. -
status
private int statusCurrent status of the parser. -
entries
-
currentChange
The current log entry being processed by the parser. -
currentRevision
The current revision of the entry being processed by the parser. -
currentComment
The current comment of the entry being processed by the parser. -
userDateFormat
-
-
Constructor Details
-
GitChangeLogConsumer
Default constructor.
-
-
Method Details
-
getModifications
-
consumeLine
-
processGetHeader
Process the current input line in the GET_HEADER state. The author, date, and the revision of the entry are gathered. Note, Git does not have per-file revisions, instead, the entire branch is given a single revision number, which is also used for the revision number of each file.- Parameters:
line- a line of text from the git log output
-
processGetAuthor
Process the current input line in the STATUS_GET_AUTHOR state. This state gathers all of the author information that are part of a log entry.- Parameters:
line- a line of text from the git log output
-
processGetRawTree
Process the current input line in the STATUS_RAW_TREE state. This state gathers tree hash part of a log entry.- Parameters:
line- a line of text from the git log output
-
processGetRawParent
Process the current input line in the STATUS_RAW_PARENT state. This state gathers parent revisions of a log entry.- Parameters:
line- a line of text from the git log output
-
addParentRevision
In git log, both parent and merged revisions are called parent. Fortunately, the real parent comes first in the log. This method takes care of the difference.- Parameters:
hash- -
-
processGetRawAuthor
Process the current input line in the STATUS_RAW_AUTHOR state. This state gathers all the author information of a log entry.- Parameters:
line- a line of text from the git log output
-
processGetRawCommitter
Process the current input line in the STATUS_RAW_AUTHOR state. This state gathers all the committer information of a log entry.- Parameters:
line- a line of text from the git log output
-
processGetDate
-
processGetComment
Process the current input line in the GET_COMMENT state. This state gathers all of the comments that are part of a log entry.- Parameters:
line- a line of text from the git log output
-
processGetFile
Process the current input line in the GET_FILE state. This state adds each file entry line to the current change log entry. Note, the revision number for the entire entry is used for the revision number of each file.- Parameters:
line- a line of text from the git log output
-
resetChangeLog
private void resetChangeLog()
-