C# Class GitSharp.Core.RevWalk.RevCommit

A commit reference to a commit in the DAG.
Inheritance: RevObject
Mostra file Open project: jagregory/GitSharp Class Usage Examples

Public Methods

Method Description
AsCommit ( RevWalk walk ) : Commit

Parse this commit buffer for display.

DisposeBody ( ) : void
GetFooterLines ( ) : IList

Parse the footer lines (e.g. "Signed-off-by") for machine processing. This method splits all of the footer lines out of the last paragraph of the commit message, providing each line as a key-value pair, ordered by the order of the line's appearance in the commit message itself. A footer line's key must match the pattern {@code ^[A-Za-z0-9-]+:}, while the value is free-form, but must not contain an LF. Very common keys seen in the wild are:

  • {@code Signed-off-by} (agrees to Developer Certificate of Origin)
  • {@code Acked-by} (thinks change looks sane in context)
  • {@code Reported-by} (originally found the issue this change fixes)
  • {@code Tested-by} (validated change fixes the issue for them)
  • {@code CC}, {@code Cc} (copy on all email related to this change)
  • {@code Bug} (link to project's bug tracking system)

GetFooterLines ( FooterKey keyName ) : IList

Get the values of all footer lines with the given key.

GetFooterLines ( string keyName ) : IList

Get the values of all footer lines with the given key.

GetParent ( int nth ) : RevCommit

Get the nth parent from this commit's parent list.

RevCommit ( AnyObjectId id ) : System

Create a new commit reference.

ToString ( ) : string
carry ( GitSharp.Core.RevWalk.RevFlag flag ) : void

Carry a RevFlag set on this commit to its parents. If this commit is parsed, has parents, and has the supplied flag set on it we automatically add it to the parents, grand-parents, and so on until an unparsed commit or a commit with no parents is discovered. This permits applications to force a flag through the history chain when necessary.

carryFlags ( RevCommit c, int carry ) : void
getAuthorIdent ( ) : PersonIdent

Parse the author identity from the raw buffer. This method parses and returns the content of the author line, after taking the commit's character set into account and decoding the author name and email address. This method is fairly expensive and produces a new PersonIdent instance on each invocation. Callers should invoke this method only if they are certain they will be outputting the result, and should cache the return value for as long as necessary to use all information from it. RevFilter implementations should try to use RawParseUtils to scan the RawBuffer instead, as this will allow faster evaluation of commits.

getCommitterIdent ( ) : PersonIdent

Parse the committer identity from the raw buffer. This method parses and returns the content of the committer line, after taking the commit's character set into account and decoding the committer name and email address. This method is fairly expensive and produces a new PersonIdent instance on each invocation. Callers should invoke this method only if they are certain they will be outputting the result, and should cache the return value for as long as necessary to use all information from it. RevFilter implementations should try to use RawParseUtils to scan the RawBuffer instead, as this will allow faster evaluation of commits.

getFullMessage ( ) : string

Parse the complete commit message and decode it to a string. This method parses and returns the message portion of the commit buffer, After taking the commit's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.

getShortMessage ( ) : string

Parse the commit message and return the first "line" of it. The first line is everything up to the first pair of LFs. This is the "oneline" format, suitable for output in a single line display. This method parses and returns the message portion of the commit buffer, after taking the commit's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.

hasLF ( byte r, int b, int e ) : bool
parseCanonical ( RevWalk walk, byte raw ) : void
reset ( ) : void

Reset this commit to allow another RevWalk with the same instances. Subclasses must call base.reset() to ensure the basic information can be correctly cleared out.

Private Methods

Method Description
parseBody ( RevWalk walk ) : void
parseHeaders ( RevWalk walk ) : void

Method Details

AsCommit() public method

Parse this commit buffer for display.
public AsCommit ( RevWalk walk ) : Commit
walk RevWalk /// revision walker owning this reference. ///
return Commit

DisposeBody() public method

public DisposeBody ( ) : void
return void

GetFooterLines() public method

Parse the footer lines (e.g. "Signed-off-by") for machine processing. This method splits all of the footer lines out of the last paragraph of the commit message, providing each line as a key-value pair, ordered by the order of the line's appearance in the commit message itself. A footer line's key must match the pattern {@code ^[A-Za-z0-9-]+:}, while the value is free-form, but must not contain an LF. Very common keys seen in the wild are:
  • {@code Signed-off-by} (agrees to Developer Certificate of Origin)
  • {@code Acked-by} (thinks change looks sane in context)
  • {@code Reported-by} (originally found the issue this change fixes)
  • {@code Tested-by} (validated change fixes the issue for them)
  • {@code CC}, {@code Cc} (copy on all email related to this change)
  • {@code Bug} (link to project's bug tracking system)
public GetFooterLines ( ) : IList
return IList

GetFooterLines() public method

Get the values of all footer lines with the given key.
public GetFooterLines ( FooterKey keyName ) : IList
keyName FooterKey /// footer key to find values of, case insensitive. ///
return IList

GetFooterLines() public method

Get the values of all footer lines with the given key.
public GetFooterLines ( string keyName ) : IList
keyName string /// footer key to find values of, case insensitive. ///
return IList

GetParent() public method

Get the nth parent from this commit's parent list.
/// An invalid parent index was specified. ///
public GetParent ( int nth ) : RevCommit
nth int /// the specified parent ///
return RevCommit

RevCommit() public method

Create a new commit reference.
public RevCommit ( AnyObjectId id ) : System
id AnyObjectId object name for the commit.
return System

ToString() public method

public ToString ( ) : string
return string

carry() public method

Carry a RevFlag set on this commit to its parents. If this commit is parsed, has parents, and has the supplied flag set on it we automatically add it to the parents, grand-parents, and so on until an unparsed commit or a commit with no parents is discovered. This permits applications to force a flag through the history chain when necessary.
public carry ( GitSharp.Core.RevWalk.RevFlag flag ) : void
flag GitSharp.Core.RevWalk.RevFlag /// The single flag value to carry back onto parents. ///
return void

carryFlags() public static method

public static carryFlags ( RevCommit c, int carry ) : void
c RevCommit
carry int
return void

getAuthorIdent() public method

Parse the author identity from the raw buffer. This method parses and returns the content of the author line, after taking the commit's character set into account and decoding the author name and email address. This method is fairly expensive and produces a new PersonIdent instance on each invocation. Callers should invoke this method only if they are certain they will be outputting the result, and should cache the return value for as long as necessary to use all information from it. RevFilter implementations should try to use RawParseUtils to scan the RawBuffer instead, as this will allow faster evaluation of commits.
public getAuthorIdent ( ) : PersonIdent
return PersonIdent

getCommitterIdent() public method

Parse the committer identity from the raw buffer. This method parses and returns the content of the committer line, after taking the commit's character set into account and decoding the committer name and email address. This method is fairly expensive and produces a new PersonIdent instance on each invocation. Callers should invoke this method only if they are certain they will be outputting the result, and should cache the return value for as long as necessary to use all information from it. RevFilter implementations should try to use RawParseUtils to scan the RawBuffer instead, as this will allow faster evaluation of commits.
public getCommitterIdent ( ) : PersonIdent
return PersonIdent

getFullMessage() public method

Parse the complete commit message and decode it to a string. This method parses and returns the message portion of the commit buffer, After taking the commit's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.
public getFullMessage ( ) : string
return string

getShortMessage() public method

Parse the commit message and return the first "line" of it. The first line is everything up to the first pair of LFs. This is the "oneline" format, suitable for output in a single line display. This method parses and returns the message portion of the commit buffer, after taking the commit's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.
public getShortMessage ( ) : string
return string

hasLF() public static method

public static hasLF ( byte r, int b, int e ) : bool
r byte
b int
e int
return bool

parseCanonical() public method

public parseCanonical ( RevWalk walk, byte raw ) : void
walk RevWalk
raw byte
return void

reset() public method

Reset this commit to allow another RevWalk with the same instances. Subclasses must call base.reset() to ensure the basic information can be correctly cleared out.
public reset ( ) : void
return void