André Berg pointed out that the "Open Image in New Window" and "Download Image" items from the contextual menu for images in the web view does not work and may cause crashes.
So limit the menu to either just show "Copy Image" or don't have a menu at all.
After the last line is read from the fileDescriptor the callee will call
readLine once last time. If the (uninitialized) buffer just happened to
contain '\r' then this method would increment bytesReceived, then
decrement it (because it has '\r' in it), then decrement it agin and
assign a null byte to the byte before the buffer (stepping on who knows
what). Then it would return the '\r'. Then, since it received something,
the callee would call readLine again, malloc would give the same buffer
it did before (with the '\r') and everything would repeat.
- initialize the buffer
- increment bytesReceived only if a byte is actually received
- don't do any work in the loop if there were no bytes received
- EINTR is a recoverable error, just reread
- give the actual reason for an error rather than some random string
- free the buffer when a newline is found or when there is an error
The text view was wrapping text well before it reached the edge of the view.
In PBGitHistory.xib in the textview for the file contents check the Resizable Horizontally checkbox in the Size Inspector
- only maintains one item, if multiple items are selected then only the first one will stay selected
- if the file is removed in the new commit then don't select anything, then if a new commit is selected that does have that file it will be selected again
- this does not maintain the expanded state of folders other than the one(s) that contain the selected file
- in PBGitHistory.xib Tree Controller turn off:
- Avoid Empty Selection
- Select Inserted Objects
In 10.6 Apple removed the private QL API that existed in 10.5 and added a new public API. However they did not port the new API back to 10.5 so we have to do some work to get it working in both.
This patch has GitX choose the correct version at run time.
- The delegate code is based on Apple's QuickLookDownloader example project
- added three of the public API methods to CWQuickLook.h to avoid warnings about unknown method calls
- In ApplicationController try to load the public API first then load the private one if it fails
- Created PBQLTextView, a subclass of NSTextView to allow the space key event to toggle the preview panel
- PBGitHistoryView.xib:
- set the text view's class to PBQLTextView
- connected the history controller to the controller outlet
- bound the quick look button's enabled binding to File's Owner.selectedCommitDetailsIndex
- added "Quick Look" to the quick look button's tooltip
- The commit list table view toggles the panel if the tree view is active
- changed name of the toggle IBAction method which caused MainMenu.xib and PBGitHistoryView.xib to update
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns.
This will not show any labels that don't fit.
EINTR errors are recoverable, just need to read() again.
Randomly while looking at files in the file browser the contents view will be empty or files will not be shown when clicking a discloser triangle. Seems to happen more when running in XCode than when running by itself.
When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work.
Offset the mouse click's x value by the x origin of the Subject column.
In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one).
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
It was no longer opening the tree view because the index in setTreeView: was wrong.
Removing the raw view was started in 34394d056b. Finish removing the raw view stuff and clean things up.
- remove the rawCommit property
- fix the incorrect index of the tree view setter
- define symbols for the indexes
- rename the selectedTab property to indicate what is being selected
- rename realCommit to selectedCommit to better indicate what it's for
- define a key for the defaults
- NSCopying
- change isEqualTo: to isEqual: so that it works well with NSArray's (containsObject: and removeObject: will use isEqual: instead of pointer equality)
- add hash to go with isEqual:
- pre-calculate the isSimpleRef value. The rangeOf... methods are very slow and have a major effect on the tight loop in reloadRefs.
NSURL's don't play nice with NSDistantObject, use the newly created NSURL instead of the NSDistantObject proxy.
This fixes problems with rev specifiers created using the gitx tool crashing GitX the second time they are viewed because the NSConnection to the tool has been closed.
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns.
This will not show any labels that don't fit.
Store all the open documents when the app closes and then open them when the app starts again. Defaults to NO, so that there is no change to the existing behavior.
Fixes a problem when opening a number of repos at once where the commit information does not show up. Get a webKit error "TypeError: Result of expression 'commit' [undefined] is not an object."
For some reason the callWebScriptMethod:withArguments: method returns nil (even after the webView:didFinishLoadForFrame: delegate is called) when the app is busy. Seems like the web view is not really ready yet and so it never actually calls loadCommit().
If we get nil (normally should get WebUndefined) then try changeContentTo: again after a little delay. This stops the loadCommitDetails() script from running before the commit object is created.
- make the "Gist it" button a Mac OS X style button
- remove the default name from each field
- move the author's gravatar and include the committer's
- move the gravatar to the left of the author's name
- add a gravatar for the committer
- move the author and commiter info to it's own table to allow for putting the gravatar image in a center column
- setGravatar() now uses the email address passed in
- add Create Branch and Create Tag buttons
- icons are modified versions of Kim Does's icons (from ca7816b523) made a bit smaller to fit in the buttons better
- add Merge, Cherry Pick, and Rebase buttons
- icons by Nathan Kinsinger
- add an action menu for the selected ref in the source view
- add Add Remote, Fetch, Pull and Push buttons to the bottom bar
- Add Remote icon by Nathan Kinsinger
- Fetch, Pull and Push icons are modified versions of André Berg's icons (from 4396081c07) made a bit smaller to fit in the UI better.
- move the status message for both the history view and the commit/stage view
- all PBViewControllers now have status and isBusy properties and can use those to put a message in the bottom bar when they are the active content controller of the window