Please sign in to comment.
Major overhaul of the handling/effect of CLI args (gitx/PBCLIProxy).
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.
- Loading branch information...
Showing with 423 additions and 186 deletions.
Oops, something went wrong.