Use the cached commit list to avoid asking git for the info. This is used to update GUI buttons and when opening the contextual menu so making it fast is important. It wasn't possible before because we weren't storing all the commits.
- 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
In reloadRefs:
- check for any branches that are no longer in the repo and delete them
- except the detached HEAD and the "other" revs
- send KVO notice for the refs ivar changing
- get rid of the BOOL return value as it's not being used
- get rid of the outdated comments
- clean things up a bit
Checkout:
- PBGitRepository: add checkoutRefish:
- PBRefController: renamed checkoutRef: to checkout: and use new method in PBGitRepository
- add to the contextual menus for commits (it was already in the menu for refs)
- add "Checkout branch" checkbox to the Create Branch sheet
- store the state in the defaults
- tell the commitController to rearrangeObjects so that the refs highlight correctly (seems to only be a problem when going from a branch to a detached HEAD at the same commit)
A Create Tag item:
- A new class (and xib) PBCreateTagSheet
- In the Repository menu
- In the contextual menu for commits
PBRefController the method tagInfo:
- renamed to showTagInfoSheet:
- moved it under the Tags mark
Update the methods for creating a branch.
- create new class and xib PBCreateBranchSheet
- remove old addRef: methods and iVars from PBRefController
- remove old sheet from PBHistoryView.xib
- put the implementation method in PBGitRepository
- add a contextual menu item for commits
- shows an error sheet
- ask the commitController to rearrangeObjects to make sure the new branch is shown
- switch from using "update-ref" to "branch" so that branches starting at a remote branch will track automatically (or not depending on the repo's settings)
This adds a removeBranch method similar to the addBranch method. It
calls these methods when a branch is created/deleted in the UI, avoiding
the cost of simply calling refresh afterwards.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
* stable:
When selecting a folder in tree-view, display the
PBGitRepository: Correctly indicate bare/non-bare repos
Get rid of some unnecessary casts
CommitController: Don't rewrap commit message when amending
Release notes for 0.6.3
PBGitCommit: Call git show with --no-color to be safe
Info.plist: Fix handling of directories
PBGitIndexController: fix uninitialized value
Conflicts:
PBGitCommitController.m
Some hooks, such as commit-msg and
prepare-commit-msg require at least one argument.
This allows executeHook to take an array of
arguments to be passed on to the hook.
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 wasn't used anyway. A good idea would be to create a new
branchcontroller that takes care of all these revs, rather than
letting PBGitRepository take care of that
That's why it's there, after all. This also makes the system
more robust and catches some more errors.
The next thing this enables is to also allow right-clicking
on refs in the commit list.
Since 63523d00e8 (History view:
Make lozenge of currently checked out branch (HEAD) bold, same as gitk.),
-[PBGitRepository headRef] was called every time a cell needed redrawing.
This made GitX slow overall, but especially when resizing the window.
So, it's better to cache the value. We'll still reload it with an
explicit refresh though.
This introduces the PBGitConfig class. It is KVC compliant as far
as I can see, in that you can actually bind to it in IB and use
ValueForKeyPath to retrieve values. It currently only handles
strings; it should be possible to add functions to process
booleans and numbers to it.
This changes a lot of code, so quick review:
* RepositoryDocumentController now returns the document without selecting a ref
* PBGitWindowController now optionally shows the default view, or selects no view at all
* PBGitRepository keeps a pointer to its WindowController so that it can change views