diff --git a/plugins/git4idea/src/git4idea/history/GitLogParser.java b/plugins/git4idea/src/git4idea/history/GitLogParser.java index 7af8d346b1a3..1548209e691d 100644 --- a/plugins/git4idea/src/git4idea/history/GitLogParser.java +++ b/plugins/git4idea/src/git4idea/history/GitLogParser.java @@ -34,23 +34,19 @@ import java.util.regex.Pattern; /** *
Parses the 'git log' output basing on the given number of options. * Doesn't execute of prepare the command itself, performs only parsing.
- * ** Usage: * 1. Pass options you want to have in the output to the constructor using the {@link GitLogOption} enum constants. * 2. Get the custom format pattern for 'git log' by calling {@link #getPretty()} * 3. Call the command and retrieve the output. * 4. Parse the output via {@link #parse(CharSequence)} or {@link #parseOneRecord(CharSequence)} (if you want the output to be parsed line by line).
- * *The class is package visible, since it's used only in GitHistoryUtils - the class which retrieve various pieced of history information * in different formats from 'git log'
- * *Note that you may pass one set of options to the GitLogParser constructor and then execute git log with other set of options. * In that case {@link #parse(CharSequence)} will parse only those options which you've specified in the constructor. * Others will be ignored since the parser knows nothing about them: it just gets the 'git log' output to parse. * Moreover you really must use {@link #getPretty()} to pass "--pretty=format" pattern to 'git log' - otherwise the parser won't be able * to parse output of 'git log' (because special separator characters are used for that).
- * *If you use '--name-status' or '--name-only' flags in 'git log' you also must call {@link #parseStatusBeforeName(boolean)} with * true or false respectively, because it also affects the output.
* @@ -75,16 +71,15 @@ public class GitLogParser { /** * Record format: - * - * One git log record. + *One git log record.
* RECORD_START - optional: it is split out when calling parse() but it is not when calling parseOneRecord() directly.
* commit information separated by ITEMS_SEPARATOR.
* RECORD_END
- * Optionally: changed paths or paths with statuses (if --name-only or --name-status options are given).
- *
- * Example:
- * 2c815939f45fbcfda9583f84b14fe9d393ada790
Example: + *
+ * 2c815939f45fbcfda9583f84b14fe9d393ada790<ITEM_SEPARATOR>sample commit<RECORD_END> + * D a.txt*/ private static final Pattern ONE_RECORD = Pattern.compile("(?:" + RECORD_START + ")?(.*)" + RECORD_END + "\n*(.*)", Pattern.DOTALL); private static final String SINGLE_PATH = "([^\t\r\n]+)"; // something not empty, not a tab or newline.