- filters for All, Local/Remote, and the selected branch
- "Local" includes both branches and tags
- "Remote" includes all branches from the same remote as the selected remote branch (i.e. not other remotes)
Changes to make the above work:
- add a history list class between the repository and rev list
- store a project rev list with all the commits from the project
- use the project rev list to graph the history for individual branches when there have been no changes
- use a different rev list to show non-simple revs (history of a file, revs from the gitx tool)
- update the commits in chunks to a mutable array so the table view's array controller has less work to do
- only update the project rev list from git when actually necessary
- don't add the All Branches and Local Branches revs to the branches array
- some changes related to forcing the project's rev list to update when changes are made
- some changes related to not causing updates too often
- store the selected filter in user defaults
- when the graphing is done select the commit for the branch
As some Apple employees continue to advocate: Using dot notation for anything else than
documented (!) synthesized properties and calling non-behavioural messages can be dangerous.
Methods that look like setters/getters but aren't connected to a documented property may
introduce private state change inside the class which can further bring all sorts of subtle
and hard to debug problems. The Objective-C 2.0 Language Guide now also mentions this.
It's very difficult to determine whether or not we have a path specifier.
Because it's so difficult, it's better to just always run --children. A quick
test indicates that it doesn't matter much in run-time, and it's better to be
conservative in what we accept than to show bogus lines because the children
haven't been rewritten.
This tries to read the encoding of the commit message, if it's specified by
git (using i18n.commitEncoding at the time of committing). It uses an ugly
hack to try to convert the encoding string to an NSStringEncoding, and then
uses that for the subject and committer name.
I'm not sure how expensive this is. If it's too expensive, we might need to
cache this value.
When there were no commits to load, 'git log' would output something like:
Final output: 0 done
After that, GitX would try to read the sha after the input, which would
cause illegal string access and the throwing of a c++ exception. we fix
this by just stopping with revision loading if the input isn't at least
40 characters -- the minimum for a sha.
The %x00 pretty specifier was only added in git v1.5.6.
This is quite new, so we try to support older git clients in
GitX (v1.5.4 and up). In order to do this, we need to use another
specifier.
Unfortunately, we can't use a real \0 in our argument, as that just
cuts off our argument string. So we get the next best thing -- we use
\01 :).
We already keep this dictionary in our repository. Rather than adding a
pointer to it on every commit in our rev walk, just look it up lazily in the
dictionary when we need to. That cuts down some time in the initial revwalk
and also removes some stupid code :)
This uses a normal c array to store parent sha's. That means that we
save a lot of room, as they are only 20 bytes rather than 40 + the cost of
an NSArray and the NSStrings.
This produces cleaner code and is also significantly faster
than the old obj-c code: linux-2.6 goes from ~8 seconds
to ~6 seconds.
Using the c++ code allows us to do easy optimizations