Commit Graph

889 Commits

Author SHA1 Message Date
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
Nathan Kinsinger 27d4b22122 Add preferences for the column guide in the commit message 2010-03-13 22:16:12 -07:00
Nathan Kinsinger f2a395d423 Add Reopen all repositories from last session
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.
2010-03-13 22:16:09 -07:00
Nathan Kinsinger 2b0c2b200a Retry loadCommit() script when it fails
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.
2010-03-13 22:16:06 -07:00
Nathan Kinsinger 6427fd90fc Reopen the stage view if that was the last view open 2010-03-13 22:16:02 -07:00
Nathan Kinsinger 388818b045 Make the accept drop window a document modal sheet
- don't do anything if the ref is dropped on the old commit
    - clean up the message
    - allow it to be suppressed
2010-03-13 22:15:58 -07:00
Nathan Kinsinger 865ff8995a Hide menu items in the File menu that are not used
They are still there in case they are ever needed
2010-03-13 22:15:55 -07:00
Nathan Kinsinger 4903145243 Change the commit list font to be 12 pt
More closely matches Mail.app's list view
2010-03-13 22:15:52 -07:00
Nathan Kinsinger 9dc54b3316 Resize the Amend checkbox
It was being clipped by one pixel
2010-03-13 22:15:49 -07:00
Andy Fowler 9c7aaf0760 Fix typo in successful commit message 2010-03-13 22:15:46 -07:00
Nathan Kinsinger 0cd02c13db Stop the top of diffs in the stage view from being cut off 2010-03-13 22:15:43 -07:00
Nathan Kinsinger 9689c430ef Clean up the commit file list
- remove the underline from file names (makes them easier to read)
    - add icons to replace the file modification buttons (icons by Nathan Kinsinger)
2010-03-13 22:15:40 -07:00
Nathan Kinsinger 9a536fc92a Clean up the commit message
- allow the commit message text to wrap
    - use Menlo on systems that have it
2010-03-13 22:15:37 -07:00
Nathan Kinsinger b557d6b5c6 Clean up the commit header
- 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
2010-03-13 22:15:34 -07:00
Nathan Kinsinger c61f65b3e8 Set the minimum size of the window to 600x450 2010-03-13 22:15:31 -07:00
Nathan Kinsinger 446dd540da Add Terminal, Reveal and Clone To to the toolbar
The clone icon is by André Berg (in 4396081c07)
2010-03-13 22:15:28 -07:00
Nathan Kinsinger ad3ea443ca Add items to the History view's upper toolbar
- 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
2010-03-13 22:15:24 -07:00
Nathan Kinsinger 1b41171d92 Add a bottom content border/toolbar to the repository window
- 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
2010-03-13 22:15:13 -07:00