Groovy Documentation

org.ajoberstar.gradle.git.tasks
[Java] Class GitLog

java.lang.Object
  org.gradle.api.DefaultTask
      org.ajoberstar.gradle.git.tasks.GitBase
          org.ajoberstar.gradle.git.tasks.GitLog

public class GitLog
extends GitBase

Task to get the commit log of a local Git repository. The commit log will be stored in a property at the project level. This can be used to print out a list of commits as follows:


 task log(type: org.ajoberstar.gradle.git.tasks.GitLog) {
   includeRange '580504f', '580504f'
   doLast {
     log.each { println "$it.abbreviatedId $it.committer.name $it.shortMessage" }
   }
 }
 
Authors:
Alex Lixandru
Since:
0.2.3


Method Summary
void exclude(java.lang.String... excludes)

Adds to the list of commits to exclude from the log.

java.util.List getExcludes()

Gets the list of commits that will be excluded from the log.

java.util.List getIncludes()

Gets the list of commits that will be included in the log.

java.util.List getLog()

Gets the resulting log from this task.

int getMaxCommits()

Gets the maximum number of commits to get from the commit log.

int getSkipCommits()

Gets the number of commits from the log to skip before getting the commit output.

void include(java.lang.String... includes)

Adds to the list of commits to include in the log.

void includeRange(java.lang.String since, java.lang.String until)

Adds a range of commits to the include/exclude rules.

void reset()

Gets the commit log and stores it in a project property as configured.

void setExcludes(java.util.List excludes)

Sets the list of commits to exclude from the log.

void setIncludes(java.util.List includes)

Sets the list of commits to incldue in the log.

void setMaxCommits(int maxCommits)

Sets the maximum number of commits to get from the commit log.

void setSkipCommits(int skipCommits)

Sets the number of commits from the log to skip before getting the commit output.

 
Methods inherited from class GitBase
getGit, getRepoDir, setRepoPath
 

Method Detail

exclude

public void exclude(java.lang.String... excludes)
Adds to the list of commits to exclude from the log.
Parameters:
excludes - list of commits


getExcludes

public java.util.List getExcludes()
Gets the list of commits that will be excluded from the log.
Returns:
list of commits


getIncludes

public java.util.List getIncludes()
Gets the list of commits that will be included in the log.
Returns:
list of commits


getLog

public java.util.List getLog()
Gets the resulting log from this task.
Returns:
the log of commits retrieved by this task


getMaxCommits

@Input
public int getMaxCommits()
Gets the maximum number of commits to get from the commit log. Defaults to -1 (all commits will be retrieved).
Returns:
the maximum number of commits to retrieve


getSkipCommits

public int getSkipCommits()
Gets the number of commits from the log to skip before getting the commit output. Defaults to 0.
Returns:
the number of commits to skip


include

public void include(java.lang.String... includes)
Adds to the list of commits to include in the log.
Parameters:
includes - list of commits


includeRange

public void includeRange(java.lang.String since, java.lang.String until)
Adds a range of commits to the include/exclude rules.
Parameters:
since - the commit to begin at
until - the commit to end at


reset

tion
	public
public void reset()
Gets the commit log and stores it in a project property as configured.


setExcludes

public void setExcludes(java.util.List excludes)
Sets the list of commits to exclude from the log.
Parameters:
excludes - list of commits


setIncludes

public void setIncludes(java.util.List includes)
Sets the list of commits to incldue in the log.
Parameters:
includes - list of commits


setMaxCommits

public void setMaxCommits(int maxCommits)
Sets the maximum number of commits to get from the commit log. Defaults to -1 if not set.
Parameters:
maxCommits - the maximum number of commits to retrieve


setSkipCommits

public void setSkipCommits(int skipCommits)
Sets the number of commits from the log to skip before getting the commit output. Defaults to 0 if not set.
Parameters:
skipCommits - the number of commits to set


 

Groovy Documentation