Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Looking for an example of a custom RevWalk Sort

Hello,

 

I’m working on some history rewriting programs for a subversion to git conversion (>70,000 commits).   When we do the initial subversion to git conversion we translate svn:externals properties on the branch into a fusion.dat file in the root directory of the branch.

 

This is sort of like a submodule but within the same repository.  It maps a subdirectory name to a commit id.  We have a custom maven plugin that can do a special subtree like merge to materialize the subdirectories from the commit object given.

 

I have several rewrite history programs that are using a reverse and topo sort which end up rewriting the original commit id’s that were stored initially in these fusion.dat files.

 

I have a tool that should work to rewrite these fusion.dat files using the old commit to new commit records from the previous history rewriting however the sort order of the commits is not exactly what I need.

 

If I look at a commit with this fusion.dat file I know the id’s of the commits that have to be processed before this one.  You can image that the aggregate branch contains the fusion.dat file but it is referencing lateral branches.  In subversion these might have been all in a single commit but in Git there is the top level branch and each individual module branch.

 

I’d like to add in my own sorter so that the RevWalk will consider this additional interdependence when ordering the results.

 

I can sort of see how I might subclass RevWalk and TopoSortGenerator to include my additional sort constraint data.

 

But those classes are all package scoped so it seems not designed to be extended directly by JGit users.

 

Is there any way for me to specify my own RevWalk sort order?

 

Thanks,

 

Michael

 

 


Back to the top