Top Description Inners Fields Constructors Methods
org.eclipse.jgit.pgm.debug

pack-priv Class RebuildCommitGraph

extends TextBuiltin
Class Inheritance
Annotations
@Command
usage:usage_RebuildCommitGraph
Static Imports
java.nio.charset.StandardCharsets.UTF_8

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 and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv File
private final ProgressMonitor
private static final String
pack-priv boolean
pack-priv File
private Map<ObjectId, ObjectId>
Inherited from org.eclipse.jgit.pgm.TextBuiltin:
argWalkdberrserrwgitdirinsoutsoutw

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private Map<String, Ref>
private void
private void
private void
private void
protected void
run()

Implements abstract org.eclipse.jgit.pgm.TextBuiltin.run.

Perform the actions of this command.

Inherited from org.eclipse.jgit.pgm.TextBuiltin:
containsHelpdiediediedieexecutegetErrorWritergetOutputWritergetRepositorygetResourceBundleinitinitRawparseArgumentsprintUsageprintUsageAndExitprintUsageAndExitrequiresRepository

Field Detail

graphback to summary
pack-priv File graph
Annotations
@Argument
index:1
required:true
metaVar:metaVar_refs
usage:usage_logAllPretty
pmback to summary
private final ProgressMonitor pm
REALLYback to summary
private static final String REALLY
reallyback to summary
pack-priv boolean really
Annotations
@Option
name:--destroy-this-repository
usage:usage_approveDestructionOfRepository
refListback to summary
pack-priv File refList
Annotations
@Argument
index:0
required:true
metaVar:metaVar_refs
usage:usage_forEachRefOutput
rewritesback to summary
private Map<ObjectId, ObjectId> rewrites

Constructor Detail

RebuildCommitGraphback to summary
pack-priv RebuildCommitGraph()

Method Detail

computeNewRefsback to summary
private Map<String, Ref> computeNewRefs() throws IOException
deleteAllRefsback to summary
private void deleteAllRefs() throws Exception
detachHeadback to summary
private void detachHead() throws IOException
recreateCommitGraphback to summary
private void recreateCommitGraph() throws IOException
recreateRefsback to summary
private void recreateRefs() throws Exception
runback to summary
protected void run() throws Exception

Implements abstract org.eclipse.jgit.pgm.TextBuiltin.run.

Doc from org.eclipse.jgit.pgm.TextBuiltin.run.

Perform the actions of this command.

This method should only be invoked by execute(String[]).

Annotations
@Override
Exceptions
Exception:
an error occurred while processing the command. The main framework will catch the exception and print a message on standard error.
org.eclipse.jgit.pgm.debug back to summary

private Class RebuildCommitGraph.ToRewrite

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final long
pack-priv ObjectId
pack-priv final ObjectId
pack-priv final ObjectId[]

Constructor Summary

AccessConstructor and Description
pack-priv
ToRewrite(ObjectId o, long t, ObjectId[] p)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commitTimeback to summary
pack-priv final long commitTime
newIdback to summary
pack-priv ObjectId newId
oldIdback to summary
pack-priv final ObjectId oldId
oldParentsback to summary
pack-priv final ObjectId[] oldParents

Constructor Detail

ToRewriteback to summary
pack-priv ToRewrite(ObjectId o, long t, ObjectId[] p)