The revision walking code made the PBGitRepository unclean. Especially if
we want to keep multiple PBGitRepository objects around (e.g. persistent
data store), it needs to be more simple. This neatly extracts the revision
walking code from the repository code.
This uses an NSMutableArray to increase the currentLine if the buffer is
full. This prevents very long messages from breaking the parsing.
If we cannot parse the log line, simple ignore it.
This is not complete and perhaps should not have been committed. However,
.xib files being what they are, rewriting history or merging is getting
very difficult so I'll just disable it for now.
If anyone wants to take a look at this: we should probably do some rev-parsing
to create a graph representation in ApplicationController. That class already
is a delegate for our table and can tell individual cells what to display.
There we should tell how many lines to draw, what color, if there are merges
or splitoffs etc.
This uses the C fgets() over the weird readLine implementation I found.
It speeds up the rev-parsing significantly: we went from ~4.5 seconds
on the git.git repo to ~0.95 seconds. And that's with the secret new date
parsing!
If a commit had invalid UTF-8 characters in them -- like one in git.git for
example -- then the revparsing would stop halfway through. This patch first
tries UTF-8 enconding, and if that fails, falls back to ASCII encoding.
Subclasses NSOutlineView to PBQLOutlineView that takes a controller which
should respond to toggleQuickLook:. This is used for our tree walker to
actually show QuickLook when space is pressed.
This adds a QuickLook button that will allow you to directly view any file in
the tree view in QuickLook. This is really nice for PDF's and images. You can
select multiple files and even play a slideshow if you want.
Currently it does not remove temporary files it created. This means that they
will probably stay around until you reboot.
This controller makes sure that only the current view
receives its notifications. Therefore we won't do any work that we don't
see, like parsing diffs or asking for trees. This makes everything quicker.
This adds a new class, PBEasyPipe, which can do most of the pipe handling
in an easy way.
We use this to call `git rev-parse --git-dir` to find our current git
repository. This means that we can now call GitX within a subdirectory :)
This makes the initial startup much faster. Commits get loaded in a separate
thread, and are displayed every 1000 commits.
There is a bug in here that makes fails a click while it is loading the commit
list. Not sure how to fix this, perhaps send the arrayController?
The diff display is rather slow now, probably because everything is
put into one big pre tag. Before we can fix this, we have to parse the
diff better. For now, just display a message.
This includes the prototype library in the bundle for convenience.
Whenever a new commit is selected, a new Commit object is created that
is going to parse the raw message. From the object we can select
author information, diffs, etc.
Currently there is still a bug with commits without content changes.