Since we now have that gorgeous sidebar and commit list with branch filters,
command line arguments to gitx should utilize these to greater effect.
For example, if I pass:
"--local" >> read current branch and set the branch filter to "Local"
"--all" >> same as above but set "All" branch filter
- partial or full SHA-1 >> should get the branch most likely associated with
that SHA, select it in the sidebar and scroll the commit list to the commit
with the passed SHA.
- partial ref like "xyz/master" >> select the master branch
of the "xyz" folder in the sidebar and scroll the commit list to its most
recent commit.
"--subject=Test" >> filter commit list using a predicate on the commit list's
array controller (basically populating the search field programmatically).
For other "--..." CLI switches it's the same, just the filter predicate is a
bit different each time. You get the idea.
To accomplish this we make the following changes:
- gitx sets two environment variables via setenv(), one for a concatenated
version of the CLI args, and one for the indicator that we launched from gitx.
Using setenv() is unfortunate but I couldn't find a way to do it through DO
and PBCLIProxy since that proxy will do it's processing far too late into
the app's event cycle.
- the now shared application controller stores the two env vars in a BOOL
'launchedFromGitx' and an NSString 'cliArgs'.
- Because GitX makes heavy use of KVO and context switching during the app
launch we introduce the notion of a deferred selection so that we can worry
about selecting the branch and commit the user has passed to gitx in some
form or another, when the app has finished launching completely and all
KVO notifications up to this point have been handled.
- ApplicationController does the bulk work. It stores most state
changes, handles most command line switches (except for a few still in gitx.m),
deals with the deferredSelectObject.
- PBGitSidebarController populateList includes logic for fixing up a ref or
a partial SHA when appController.launchedFromGitx is true. If it can be
resolved we set this as the deferred select object so it can be selected
later on.
I'll leave the excess NSLogs in there for this commit so another can see
what went into this before.
- In PBGitSidebarView.xib
- change indentation to 12
- change font size to 11
- disable the editable behavior
- disable autoresizing
- disable user resizing (column should resize with view)
- remove the window
- remove the shared user defaults controller (not being used)
- add a project item with the project's name
- a "Stage" item to go to what has been called the commit view
- new icons for branches, remote branches and tags (created by Nathan Kinsinger)
- remove the old tiff icons, PBSourceViewRemote.h/m and PBSourceViewAction.h/m from the xcode project
- uses system icon for folder
- uses Network icon for remotes
- capitalize group names
- rename the Custom group to Other (you can't really customize items in the traditional sense)
- create a class for each item type that takes care of it's image (instead of trying to guess the image from it or it's parent's name)
- remove the branch menu toolbar item from the history view, it's redundant now
This shows in a separate window for now, so we don't
mess up the xibs. Once I'm satisfied with the result,
I can put it into the main view with a single change :)