Class GitStatusConsumer
java.lang.Object
org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumer
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
public class GitStatusConsumer
extends Object
implements org.codehaus.plexus.util.cli.StreamConsumer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternThe pattern used to match added file linesEntries are relative to working directory, not to the repositoryrootprivate static final PatternThe pattern used to match deleted file linesprivate ScmLoggerprivate static final PatternThe pattern used to match modified file linesprivate URIprivate static final PatternThe pattern used to match renamed file linesprivate ScmFileSetprivate File -
Constructor Summary
ConstructorsConstructorDescriptionGitStatusConsumer(ScmLogger logger, File workingDirectory) Consumer when workingDirectory and repositoryRootDirectory are the sameGitStatusConsumer(ScmLogger logger, File workingDirectory, URI relativeRepositoryPath) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathGitStatusConsumer(ScmLogger logger, File workingDirectory, URI relativeRepositoryPath, ScmFileSet scmFileSet) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathGitStatusConsumer(ScmLogger logger, File workingDirectory, ScmFileSet scmFileSet) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPath -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeLine(String line) private booleanprivate booleanisFileNameInFileList(List<File> fileList, String fileName) protected static StringresolvePath(String fileEntry, URI path) static URIresolveURI(String fileEntry, URI path) private static StringstripQuotes(String str) private static StringDequote a quoted string generated by git status --porcelain.static URIuriFromPath(String path) Create an URI whose getPath() returns the given path and getScheme() returns null.
-
Field Details
-
ADDED_PATTERN
The pattern used to match added file lines -
MODIFIED_PATTERN
The pattern used to match modified file lines -
DELETED_PATTERN
The pattern used to match deleted file lines -
RENAMED_PATTERN
The pattern used to match renamed file lines -
logger
-
workingDirectory
-
scmFileSet
-
changedFiles
Entries are relative to working directory, not to the repositoryroot -
relativeRepositoryPath
-
-
Constructor Details
-
GitStatusConsumer
Consumer when workingDirectory and repositoryRootDirectory are the same- Parameters:
logger- the loggerworkingDirectory- the working directory
-
GitStatusConsumer
Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
logger- the loggerworkingDirectory- the working directoryrelativeRepositoryPath- the working directory relative to the repository root- Since:
- 1.9
- See Also:
-
GitStatusConsumer
Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
logger- the loggerworkingDirectory- the working directoryscmFileSet- fileset with includes and excludes- Since:
- 1.11.0
- See Also:
-
GitStatusConsumer
public GitStatusConsumer(ScmLogger logger, File workingDirectory, URI relativeRepositoryPath, ScmFileSet scmFileSet) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
logger- the loggerworkingDirectory- the working directoryrelativeRepositoryPath- the working directory relative to the repository rootscmFileSet- fileset with includes and excludes- Since:
- 1.11.0
- See Also:
-
-
Method Details
-
consumeLine
- Specified by:
consumeLinein interfaceorg.codehaus.plexus.util.cli.StreamConsumer
-
isFileNameInFileList
-
isFile
-
resolvePath
-
resolveURI
- Parameters:
fileEntry- the fileEntry, must not benullpath- the path, must not benull- Returns:
- TODO
-
uriFromPath
Create an URI whose getPath() returns the given path and getScheme() returns null. The path may contain spaces, colons, and other special characters.- Parameters:
path- the path.- Returns:
- the new URI
-
getChangedFiles
-
stripQuotes
- Parameters:
str- the (potentially quoted) string, must not benull- Returns:
- the string with a pair of double quotes removed (if they existed)
-
unescape
Dequote a quoted string generated by git status --porcelain. The leading and trailing quotes have already been removed.- Parameters:
fileEntry-- Returns:
- TODO
-