Hey all,
based on the recent feedback about the slowness of the index
operations, I've worked this weekend to create a better index
representation.
The result of this can be found in my pb/index_refactor branch. It has
a lot of changes:
Tirana:GitX pieter$ git diff master --stat
GitX.xcodeproj/project.pbxproj | 18 +-
PBGitCommitController.h | 32 +--
PBGitCommitController.m | 409 +++++---------------------
PBGitCommitView.xib | 129 ++++-----
PBGitIndex.h | 80 +++++
PBGitIndex.m | 630 ++++++++++++++++++++++++++++++++++++++++
PBGitIndexController.h | 15 -
PBGitIndexController.m | 185 ++----------
PBWebChangesController.h | 1 -
PBWebChangesController.m | 24 +-
html/views/commit/commit.js | 21 +-
11 files changed, 910 insertions(+), 634 deletions(-)
and a lot of commits:
Tirana:GitX pieter$ git rev-list master.. | wc
24 24 984
So I'm not going to post patches here. I'll try to describe what I
have done so you know what happened.
Previously index operations were divided a bit between
PBGitIndexController and PBGitCommitController.
This is a bit unfortunate as those are both view controllers. There
was also no clear separation of what would go into the indexcontroller
and what in the commitcontroller.
I've changed that by making a new class, PBGitIndex. This class uses
notifications so it's view-unaware, which means you can also use it
for a CLI program if you'd wish. Because it uses notifications, it's
easier to make stuff non-blocking. I've thought about doing that for a
bit, but using the NSFilehandle notifications is a bit bothersome, so
I might just wait until we require Snow Leopard to do that :). It has
almost all the functionality of the previous two controllers, except
for the method that adds files to the git ignore file, of which I'm
not sure where it should go at all.
The two view controllers now are a bit of a mixed bag. They could
probably be merged, but I think I've messed with enough of the code
already. I wanted to ask you to test the code for a bit before we
proceed to merge it in. I've created a new nightly build at:
http://gitx.frim.nl/Downloads/Nightly.app.zip
Any comments are welcome, of course.