Package org.eclipse.jgit.pgm.debug
Class RebuildCommitGraph
- java.lang.Object
-
- org.eclipse.jgit.pgm.TextBuiltin
-
- org.eclipse.jgit.pgm.debug.RebuildCommitGraph
-
class RebuildCommitGraph extends TextBuiltin
Recreates a repository from another one's commit graph.Do not run this on a repository unless you want to destroy it.
To create the input files, in the source repository use:
git for-each-ref >in.refs git log --all '--pretty=format:%H %ct %P' >in.dag
Run the rebuild in either an empty repository, or a clone of the source. Any missing commits (which might be the entire graph) will be created. All refs will be modified to match the input exactly, which means some refs may be deleted from the current repository.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RebuildCommitGraph.ToRewrite
-
Nested classes/interfaces inherited from class org.eclipse.jgit.pgm.TextBuiltin
TextBuiltin.TerminatedByHelpException
-
-
Constructor Summary
Constructors Constructor Description RebuildCommitGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Map<java.lang.String,Ref>
computeNewRefs()
private void
deleteAllRefs()
private void
detachHead()
private void
recreateCommitGraph()
private void
recreateRefs()
protected void
run()
Perform the actions of this command.-
Methods inherited from class org.eclipse.jgit.pgm.TextBuiltin
containsHelp, die, die, die, die, execute, getErrorWriter, getOutputWriter, getRepository, getResourceBundle, init, initRaw, parseArguments, printUsage, printUsageAndExit, printUsageAndExit, requiresRepository
-
-
-
-
Field Detail
-
REALLY
private static final java.lang.String REALLY
- See Also:
- Constant Field Values
-
really
boolean really
-
refList
java.io.File refList
-
graph
java.io.File graph
-
pm
private final ProgressMonitor pm
-
-
Method Detail
-
run
protected void run() throws java.lang.Exception
Perform the actions of this command.This method should only be invoked by
TextBuiltin.execute(String[])
.- Specified by:
run
in classTextBuiltin
- Throws:
java.lang.Exception
- an error occurred while processing the command. The main framework will catch the exception and print a message on standard error.
-
recreateCommitGraph
private void recreateCommitGraph() throws java.io.IOException
- Throws:
java.io.IOException
-
detachHead
private void detachHead() throws java.io.IOException
- Throws:
java.io.IOException
-
deleteAllRefs
private void deleteAllRefs() throws java.lang.Exception
- Throws:
java.lang.Exception
-
recreateRefs
private void recreateRefs() throws java.lang.Exception
- Throws:
java.lang.Exception
-
computeNewRefs
private java.util.Map<java.lang.String,Ref> computeNewRefs() throws java.io.IOException
- Throws:
java.io.IOException
-
-