Re: faster egit history page and a pure java "gitk"
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Mar 25, 2008, 04:43 UTC
- Message-ID
- <20080325044308.GA4759@spearce.org>
- In-Reply-To
- <47E7ADA3.2060906@intelinet.com.br>
"Roger C. Soares" <rogersoares@intelinet.com.br> wrote:
Show 18 quoted lines
> Shawn O. Pearce escreveu: > >OK, so I decided a few weeks back that the history page was not fast > >enough. I think I've spent the past 3 weeks writing true revision > >machinary for jgit, and now connecting it up to a UI visualizer. > > > > git://repo.or.cz/egit/spearce.git plotter > > > >The history page has been completely replaced. I saw Roger has > >some patches against the current history page. :-| > > Hi Shawn. This is awesome, I can't wait to see this integrated in the > main repo :) > > I don't spend much time working on egit so I usually take a while to > make small things, but I can certainly merge my patches on top of yours. > > Robin, how should I proceed, resend all my patches from the weekend on > top of Shawn's tree?
I just pushed a newer version out that contains support for showing commits using a bold font if the commit has the highlightFlag set on it. I assume you were trying to work on a feature like gitk has where you can type in a string and have gitk bold all of the commits that contain that string in the message, right?
If you look at the newer internal.history.GitHistoryPage class there is a historyFlag available as an instance member. We also have an SWTCommitList allocated in the inputSet() method. The SWTCommitList has an applyFlag method that accepts a RevFilter and adds the passed RevFlag onto any commit that matches the filter.
There are a lot of RevFilter implementations, take a look at the revwalk.filter package, or see the command line parsing code in RevWalkTextBuiltin. We have ones for author, committer, message...
So a good part of the code is there to do a bold/unbold thing. There's also indexOf and lastIndexOf methods on SWTCommitList that can search for the highlightFlag in either direction from a given row index, making a prev/next feature pretty easy.
I decided to leave some low hanging fruit. There's bigger and more complex issues still lurking in the revwalk/treewalk features.
-- Shawn.