Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Limitation on RevFlags number

On Thu, May 10, 2012 at 3:11 AM, ilya.ivanov@xxxxxxxxxxx
<ilya.ivanov@xxxxxxxxxxx>  wrote:
I was developing a function for finding actual branches for a list of change
Algorithm is simple - mark all refs with flags and parse the revision tree
untill all change sets in list are found.

JGit doesn't allow to create more then 24 flags.
This is because the flags are stored as bits in an 32 bit int type,
and JGit needs some of those bits internally for its own work... so it
offers the application what is left, 24 bits.

When number of branches in repo is more then 24 it needs extra cycle, which
is bad for performance. Is there a way to increase this limit?

What you could try doing is extend RevWalk and override the
createCommit method to return your own extension of RevCommit. In your
extended RevCommit you could add additional fields to store more bits,
or add a BitSet. This will cost extra memory, so you have to weigh the
additional memory per commit against the CPU time saved by running
through the graph a fewer number of times.

Thanks for the answer! Will try it.

Back to the top