Class RewriteGenerator

java.lang.Object
org.eclipse.jgit.revwalk.Generator
org.eclipse.jgit.revwalk.RewriteGenerator

class RewriteGenerator extends Generator
Replaces a RevCommit's parents until not colored with REWRITE.

Before a RevCommit is returned to the caller its parents are updated to create a dense DAG. Instead of reporting the actual parents as recorded when the commit was created the returned commit will reflect the next closest commit that matched the revision walker's filters.

This generator is the second phase of a path limited revision walk and assumes it is receiving RevCommits from TreeRevFilter, after they have been fully buffered by AbstractRevQueue. The full buffering is necessary to allow the simple loop used within our own rewrite(RevCommit) to pull completely through a strand of RevWalk.REWRITE colored commits and come up with a simplification that makes the DAG dense. Not fully buffering the commits first would cause this loop to abort early, due to commits not being parsed and colored correctly.

See Also: