C# Класс GitSharp.Core.RevWalk.RevCommit

A commit reference to a commit in the DAG.
Наследование: RevObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
parseBody ( RevWalk walk ) : void
parseHeaders ( RevWalk walk ) : void

Описание методов

AsCommit() публичный Метод

Parse this commit buffer for display.
public AsCommit ( RevWalk walk ) : Commit
walk RevWalk /// revision walker owning this reference. ///
Результат Commit

DisposeBody() публичный Метод

public DisposeBody ( ) : void
Результат void

GetFooterLines() публичный Метод

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
Результат IList

GetFooterLines() публичный Метод

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. ///
Результат IList

GetFooterLines() публичный Метод

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. ///
Результат IList

GetParent() публичный Метод

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 ///
Результат RevCommit

RevCommit() публичный Метод

Create a new commit reference.
public RevCommit ( AnyObjectId id ) : System
id AnyObjectId object name for the commit.
Результат System

ToString() публичный Метод

public ToString ( ) : string
Результат string

carry() публичный Метод

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. ///
Результат void

carryFlags() публичный статический Метод

public static carryFlags ( RevCommit c, int carry ) : void
c RevCommit
carry int
Результат void

getAuthorIdent() публичный Метод

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
Результат PersonIdent

getCommitterIdent() публичный Метод

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
Результат PersonIdent

getFullMessage() публичный Метод

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
Результат string

getShortMessage() публичный Метод

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
Результат string

hasLF() публичный статический Метод

public static hasLF ( byte r, int b, int e ) : bool
r byte
b int
e int
Результат bool

parseCanonical() публичный Метод

public parseCanonical ( RevWalk walk, byte raw ) : void
walk RevWalk
raw byte
Результат void

reset() публичный Метод

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
Результат void