Commit Graph

906 Commits

Author SHA1 Message Date
Nathan Kinsinger 2c6a16a6a9 Stop a view that was not loaded from being loaded while being removed.
Example: If GitX started in stage view and the window was closed without ever looking at the history view, then [self view] will cause the history view's nib to be loaded which kicks off loading in the rev list. Wastes a lot of CPU cycles for no reason.
2010-07-04 09:45:37 -06:00
Nathan Kinsinger e4f6f960c7 Remove call to finalize 2010-07-04 09:45:22 -06:00
Nathan Kinsinger 693a23d545 Bugfix: don't remove all notifications from the web history controller
removeObserver: removes the controller from all notifications.

The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences.
2010-07-04 09:45:06 -06:00
Nathan Kinsinger 1b3f4ea4da Remove uses of dot notation for non properties of NSTask. 2010-06-27 06:35:30 -06:00
ngu 83e7c42ab4 Highlight the current commit with an orange circle 2010-06-27 06:33:19 -06:00
Seth Raphael 2ad624f7a8 Follow Commit-msg hook rules: allow it to edit the commit message, before committing. 2010-06-27 06:33:12 -06:00
André Berg 969ff24ac7 Bug fix: correct visible index scrolling in PBGitHistoryController and PBCommitList.
If the current branch filter is switched to "All" or "Local" the index that's
calculated as being the targeted index to scroll to visible, is off by the amount
in Y that the bottom split view separator is off from a multiple of rows.

-adjustScroll: on PBCommitList is called automatically whenever the list needs
laying out.
An ivar keeps track if we come from the -scrollSelectionToTopOfViewFrom: method
of PBGitHistoryController.

I'll leave the commented out NSLogs in there in case they're needed for debugging
again later.
2010-06-27 06:31:16 -06:00
André Berg a7106ba60d Add a method declaration to PBGitRevSpecifier.h to silence a compiler warning. 2010-06-27 06:31:10 -06:00
André Berg 504b61744d Add PBStringFromBranchFilterType() function for debugging purposes to PBGitRepository.
Add a PBGitXBranchFilterType typedef to the kGitX... branch filters enum.
2010-06-27 06:31:03 -06:00
André Berg c073202699 Put at-sign in front of multi-line continued string.
Probably doesn't matter since the compiler should concatenate both forms equally.
2010-06-27 06:30:51 -06:00
André Berg 427409b1c9 Populate the revList if empty in -commitForSHA:
I found that at a few points logic was based on items from revList but
at that point in the execution the revList was always empty.
2010-06-27 06:30:47 -06:00
André Berg dac9bd303b Make default (id) explicit for some method decls/defs in PBGitHistoryController.m 2010-06-27 06:30:39 -06:00
André Berg 10149fc5f3 Add in left-out (id) return labels to some methods in PBGitCommit. 2010-06-27 06:30:32 -06:00
André Berg 71c0f30ae5 Stability: employ more sanity checks when parsing author details from history.js 2010-06-27 06:30:28 -06:00
André Berg fffa02425a SCNetworkCheckReachabilityByName will be deprecated anyways, so replace it with the docs example which will work on any OS version from 10.3.
Modified-by: Nathan Kinsinger <nkinsinger@brotherbard.com>
Released the target to stop memory leak.
2010-06-27 06:29:25 -06:00
André Berg d5f9c822af PBGitHistoryView.xib: Set Key Equiv. of QuickLook button to Space. 2010-06-27 06:27:17 -06:00
André Berg a980fcea03 Make remaining sheets resizable as well. 2010-06-27 06:27:14 -06:00
André Berg a5acfe5b4a Make some of the sheets resizable (you never know how much a user wants to enter ;)). 2010-06-27 06:27:12 -06:00
André Berg e192ce801d Set a copy of the "Push" message strings for the alert panel message with a small case "p" letter because it will be appended in the middle of a sentence. 2010-06-27 06:27:08 -06:00
Nathan Kinsinger 9e8002a97e Only allow the "Copy Image" menu item for images
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.
2010-06-27 06:26:59 -06:00
André Berg 694b2ed0d7 Add Cmd+Shift+F for "Reveal in Finder" and Cmd+Shift+T for "Open Terminal". 2010-05-31 17:37:08 -06:00
Nathan Kinsinger cd9d469eda Use NSOperation's maxConcurrentOperationCount 2010-05-29 21:05:21 -06:00
Nathan Kinsinger 0eb011b8d9 Bugfix: include detached HEAD in local branches 2010-05-29 21:05:18 -06:00
Nathan Kinsinger dcba769fd3 Fix hanging and leaks in readLine
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
2010-05-29 21:05:06 -06:00
Nathan Kinsinger 98920bf0b1 Merge remote branch 'refs/remotes/dgrijalva/stable' into experimental
Conflicts:
	ApplicationController.m
	GitX.xcodeproj/project.pbxproj
	PBGitCommitView.xib
	PBGitHistoryView.xib
	PBGitRevisionCell.m
	PBGitTree.m
	PBGitWindowController.m
	PBViewController.m
	html/views/history/history.js
	html/views/history/index.html
2010-05-29 21:04:21 -06:00
Nathan Kinsinger 6e06e4b931 Bugfix: Avoid looping while parsing the children of a tree
Happens very intermittently, readLine keeps returning "\r".
v0.7.2
2010-03-30 12:59:34 -07:00
Nathan Kinsinger 096a176fbd Show the full width of text in the file content text view
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
2010-03-22 13:06:51 -06:00
Nathan Kinsinger 783e38d623 Remove the lower toolbar from the history and stage views
- in the history view move the detail/tree view and quick look buttons to the top toolbar
2010-03-22 12:26:57 -06:00
Nathan Kinsinger 4ccd9356be Maintain the selection in the file browser when the commit selection changes
- 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
2010-03-22 12:25:12 -06:00
Nathan Kinsinger 6a8f495318 Add support for QuickLook in 10.6+
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
2010-03-22 12:25:02 -06:00
Nathan Kinsinger 9236b801a8 Bugfix: Avoid looping while parsing the children of a tree
Happens very intermittently, readLine keeps returning "\r".
2010-03-22 10:55:56 -06:00
Nathan Kinsinger 5ea536be97 Fix drawing ref labels on the next tableview column
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.
2010-03-20 21:45:48 -07:00
Nathan Kinsinger 1917bca23b Fix file names with spaces not working in the contextual menu
Files with spaces end up with 4 extra spaces after the name. This stops them from working with the various commands in the contextual menus.
2010-03-20 21:44:51 -07:00
Nathan Kinsinger 2e549a18f8 Fix for "Remote host closed connection" exception
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.
2010-03-20 21:44:16 -07:00
Nathan Kinsinger f60f8ad7ad Bugfix: fix the contextual menu and drag-n-drop of refs
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).
2010-03-20 21:43:42 -07:00
Nathan Kinsinger e0a3422439 Bugfix: Index not refreshing on manual refresh
The window controller should be calling the content controller's refresh and not the repository's.
2010-03-20 18:45:45 -06:00
Kevin LaCoste 64f2745dfa Make the Preferences window a panel.
This enables the standard behaviour of dismissing the panel with the <esc> key.
2010-03-16 00:54:20 -07:00
Kevin LaCoste b87f9b0e35 Resize the text in the toolbar search field.
The default text size of 13 causes highlighting to be off by one pixel. With a text size of 12 highlighting behaves correctly.
2010-03-16 00:53:31 -07:00
Nathan Kinsinger ef26909d75 Add a Refresh button to the main window toolbar 2010-03-13 23:05:28 -07:00
Nathan Kinsinger 46b6057ce1 Speed up commit's isOnSameBranch
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.
2010-03-13 22:16:47 -07: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
Nathan Kinsinger c83f77801e Delete branches when the refs are deleted
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
2010-03-13 22:16:40 -07:00
Nathan Kinsinger 1b75af3805 Fix the tree view menu item
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
2010-03-13 22:16:37 -07:00
Nathan Kinsinger 1323638791 Add/modify convenience methods in PBRevSpecifier
- 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.
2010-03-13 22:16:34 -07:00
Nathan Kinsinger a0b11cfed1 Remove the observers from the ref controller
The ref controller is no longer responsible for updating the commit controller.
2010-03-13 22:16:31 -07:00
Nathan Kinsinger ef8fed6f4e Fix up the stage view's commit message text view
- stop the spelling error markers from being drawn over
    - allow undo/redo in the commit message view
2010-03-13 22:16:27 -07:00
Nathan Kinsinger c19d2c8058 Add Diff to contextual menus
- added to menus for refs, commits, and files
    - show a message when there are no changes
2010-03-13 22:16:24 -07:00
Nathan Kinsinger dc56af4aa6 CLIProxy: use the newly created NSURL for the workingDirectory
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.
2010-03-13 22:16:21 -07:00
Nathan Kinsinger 4a9abd2d8c Fix drawing ref labels on the next tableview column
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.
2010-03-13 22:16:18 -07:00
Nathan Kinsinger ca846bc6eb Have the preferences window remember the last view 2010-03-13 22:16:15 -07:00