class RebuildCommitGraph extends TextBuiltin
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.
Modifier and Type | Class and Description |
---|---|
private static class |
RebuildCommitGraph.ToRewrite |
TextBuiltin.TerminatedByHelpException
Modifier and Type | Field and Description |
---|---|
(package private) java.io.File |
graph |
private ProgressMonitor |
pm |
(package private) boolean |
really |
private static java.lang.String |
REALLY |
(package private) java.io.File |
refList |
private java.util.Map<ObjectId,ObjectId> |
rewrites |
Constructor and Description |
---|
RebuildCommitGraph() |
Modifier and Type | Method and 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.
|
containsHelp, die, die, die, die, execute, getErrorWriter, getOutputWriter, getRepository, getResourceBundle, init, initRaw, parseArguments, printUsage, printUsageAndExit, printUsageAndExit, requiresRepository
private static final java.lang.String REALLY
boolean really
java.io.File refList
java.io.File graph
private final ProgressMonitor pm
protected void run() throws java.lang.Exception
This method should only be invoked by TextBuiltin.execute(String[])
.
run
in class TextBuiltin
java.lang.Exception
- an error occurred while processing the command. The main
framework will catch the exception and print a message on
standard error.private void recreateCommitGraph() throws java.io.IOException
java.io.IOException
private void detachHead() throws java.io.IOException
java.io.IOException
private void deleteAllRefs() throws java.lang.Exception
java.lang.Exception
private void recreateRefs() throws java.lang.Exception
java.lang.Exception
private java.util.Map<java.lang.String,Ref> computeNewRefs() throws java.io.IOException
java.io.IOException