Commit Graph

18 Commits

Author SHA1 Message Date
André Berg 38177ed968 Merge remote branch 'brotherbard/experimental' into local branch 'bb/experimental' 2010-03-24 01:41:00 +01:00
Nathan Kinsinger 4a8c524692 Add branch view filters to history scope bar
- 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
2010-03-13 22:16:44 -07:00
André Berg b6d6e0d5c2 Bug fix: Correct dot notation misuse.
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.
2009-11-08 16:20:08 +01:00
André Berg 1fed883b98 Loading message restricted to DEBUG_BUILD. 2009-11-01 00:25:34 +01:00
Pieter de Bie 44768921f3 GitRevList: run the log command in the correct directory when available 2009-09-13 16:55:20 +02:00
Pieter de Bie 8ae2cde437 GitRevList: Always run --children
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.
2009-09-13 16:55:20 +02:00
Pieter de Bie 86ea9b5469 GitRevList: replace 'id' with PBGitRepository 2009-09-13 16:55:20 +02:00
Pieter de Bie 1c80701b14 GitRevList: Use std::map.find() rather than count() 2009-05-28 16:04:03 +01:00
Pieter de Bie d63f2b1124 GitRevList: cache the values of string encodings 2009-05-28 15:19:05 +01:00
Pieter de Bie b7c46c16b8 GitRevList -- Try to read the encoding of the commit message
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.
2009-05-28 15:10:46 +01:00
Pieter de Bie 1626606579 GitRevList: fix crash when loading 0 commits
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.
2009-05-28 14:12:43 +01:00
Pieter de Bie a94981f359 RevList: Don't rely on the presence of %x00
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 :).
2009-01-28 20:30:56 +00:00
Pieter de Bie ddc9ae7654 PBGitCommit: Don't store refs
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 :)
2009-01-25 02:14:09 +00:00
Pieter de Bie 4e915cc68f Remove "extern C" declaration when importing libgit2
libgit2 takes care of thiss now, so we don't have to.
2008-11-25 17:43:11 +01:00
Pieter de Bie 483cbc9de3 GitCommit: store the date as a timestamp
This should speed up commit loading, as we don't
need the date of all commits
2008-11-24 22:54:05 +01:00
Pieter de Bie 8372aee404 PBGitCommit: Use git_oids for parent shas
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.
2008-11-24 22:54:04 +01:00
Pieter de Bie d2eafc2d52 Include libgit2 as submodule and use it to store sha's
This reduces GitX's memory usage and makes some operations much faster,
like graphing, by having a cheaper comparison
2008-11-24 22:53:48 +01:00
Pieter de Bie 1a7ad9415f PBGitRevList: Rewrite as C++ code
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
2008-11-24 22:32:51 +01:00