Commit Graph

943 Commits

Author SHA1 Message Date
Nathan Kinsinger e60bb3226c Refactor the gitx CLI to use apple events and the scripting bridge
Sending the arguments with the openURL:... message allows the repository document to modify it's UI without the UI flashing between states as it opens.

Covers all the existing functionality of the CLI, but modifies:
    - "--all" "--local" "--branch" change the branch filter
    - cleaned up the usage (help) text and added info on missing commands
    - looks up the full ref name of refs so the name of a branch or tag can be entered (the user can enter "master" instead of "refs/heads/master")

Modified the History Controller to watch for and react to branch filter changes.

The GitX.h file is generated by the 'sdp' tool in a run script build phase called 'Generate Scripting Bridge Header' based on the content of GitX.sdef. It is used by the Scripting Bridge so that other apps (in this case the gitx CLI) can call Applescript commands on GitX in objective-c.
2010-09-12 19:32:19 -06:00
Nathan Kinsinger beaa591b53 Include the CFBundleGitVersion in the version command of the CLI
CFBundleGitVersion has the git description information in it.
2010-09-12 19:32:15 -06:00
Nathan Kinsinger 88b2983a4c Add a Short SHA column to the commit list
Shows only the first 10 characters of the full SHA hash so as to take up less room. Show or hide it using the contextual menu for the table header.
2010-09-12 19:32:11 -06:00
Nathan Kinsinger 2bdfaa096b Fix sorting of the subject column.
Was broken back in 4e4ffcc.
2010-09-12 19:32:07 -06:00
Nathan Kinsinger f8e63e2c9c Remove the isReachable test for gravatar.com
If there is no network connection then the reachability test will take the system default time (90 seconds I think?) to time out. During this time the UI is blocked (spinning beach ball).

The test was being done even if gravatar use was turned off. It doesn't really matter if the site is unreachable, the image will not load but that's not a big deal.
2010-09-12 19:32:04 -06:00
Nathan Kinsinger e281c983d6 Add a relative date column to the commits list table view
Shows a relative time ("x minutes ago", "Yesterday", "x days ago", "x years ago").
    - Sort the column on the commit's date and not on the string value
    - Use a custom formatter connected to the cell in the XIB
    - Show or hide using the contextual menu for the table header
2010-09-12 19:31:40 -06:00
Nathan Kinsinger 986f49f70a Don't allow drag-n-drop for the checked out branch.
Moving the checked out branch would cause odd things to happen to git's index.
2010-08-22 14:14:49 -06:00
Eric Allen c077f234ea Allow zero lines of context
Hunk/line patches don't generally have context

Before this, every attempt to stage a hunk or line was met with
"patch failed" using git 1.6.6
2010-08-22 11:57:40 -06:00
Marc Liyanage d4cb11bb8b Add "Copy SHA" alternate menu item to main menu, with default binding Cmd-Option-C. It copies just the leading 7 characters of the SHA instead of the whole commit info. 2010-08-22 08:26:13 -06:00
Sebastian Staudt caa6ed01f9 Don't follow symlinks when setting Git path
This allows using /usr/local/bin/git (using Homebrew) to work across updates
2010-08-22 07:54:03 -06:00
Nathan Kinsinger 2529c02814 Fix getting the correct git directory
If the path already includes the .git directory then rev-parse will return "." to mean the current directory.
2010-08-22 07:52:15 -06:00
Nathan Kinsinger 7b17eec476 Fix spelling error 2010-08-22 07:52:04 -06:00
Nathan Kinsinger 92a44542ae Fix crashes from NSInvalidArgumentException
This happens when running the gitx cli tool from a directory that does not contain a git repository.
2010-08-22 07:51:49 -06:00
Mikhail Emelchenkov d968f8f0c7 Fix a freeze when staging/unstaging thousands of files 2010-08-22 07:51:15 -06:00
Nicholas Riley 7f17378a86 Don't remove a file from "Unstaged Changes" when attempting to discard changes if it is a new file; it'll just reappear when you refresh. 2010-08-22 07:51:10 -06:00
Nicholas Riley 11c68b728d Fix vertical alignment of multiline Subjects in history. 2010-08-22 07:51:03 -06:00
Nathan Kinsinger 9e3e2725c0 Fix issues reported by Xcode's build and analyze
Using the LLVM GCC 4.2 compiler.
2010-08-22 07:50:42 -06:00
Jan Weiß 28f4c49b48 Fixing compiler warnings. 2010-08-22 07:50:25 -06:00
Nathan Kinsinger 07651211fd Fix "Duplicate declaration of method" error when using LLVM
The class method and the instance method had different types for the window controller. The instance method should be using the NSWindowController since the sheet can be shown in a non PBGitWindowController window (the PBCloneRepositoryPanel).
2010-08-22 07:46:12 -06:00
Michael Dippery f254fd1564 .gitignore: Ignore everything but Xcode project settings 2010-07-24 12:22:18 -06:00
Nathan Kinsinger 282cc7cd25 Bugfix: fix incorrect path to PBGitXMessageSheet.xib 2010-07-15 05:26:41 -06:00
Nathan Kinsinger 549f2c1d6a Show long messages and errors in a scroll view
This stops really long sheets when the output from git is very long.
2010-07-05 09:26:50 -06:00
Nathan Kinsinger 66e260fa69 Resize the remote progress sheet if the description is larger than the text field 2010-07-05 09:26:47 -06:00
Nathan Kinsinger 6809ac31c6 Prettify the SSH password window
- use something close to the standard HIG spacing
    - add the app's icon and a title so people know what app is asking for a password
    - save the position of the window and only center the window if the user hasn't moved it before
    - the NSSecureTextField spews some garbage to STDERR which GitX would show in the success/failure sheet so close STDERR
2010-07-05 09:26:41 -06:00
Uli Kusterer a6b5705a5f First stab at an executable that can be put into the SSH_ASKPASS environment variable to make GitX ask for passwords.
Set the environment variables for our tool. We have a rudimentary but working password panel now. Prettification later.

Label on password window so it's less cryptic.
2010-07-04 22:12:59 -06:00
Nathan Kinsinger de7d74cac8 Update build settings to include x86_64 arch
Set the debug configuration to NATIVE_ARCH_ACTUAL because NATIVE_ARCH will always be i386

Move the "compile libgit2" script build phase to it's own target. By setting the script to run in it's own target we get the ability to clean it durning the clean phase (normal build phase scripts don't run during clean). This will be needed if someone has built GitX prior to this commit because the object files will be for the old architectures.

Also give an error if there is no git repository. This is from several questions I've received after someone has downloaded the source from github instead of cloning the project. The problem is that there is no submodule setting to update.
2010-07-04 22:12:56 -06:00
Nathan Kinsinger d81645e411 Include the DSYM file while compiling the release build 2010-07-04 22:12:52 -06:00
Nathan Kinsinger 81d7e78e7d Select the commit as soon as it is available when updating the commit list
This is important for large repositories as the commit will be selected when it is added instead of waiting for all the commits to be loaded.

Stop attempts to select the current commit again if it's already selected.

No longer need the updatedGraph property on the history list.
2010-07-04 22:12:46 -06:00
Nathan Kinsinger 69827e920e Performance improvements for graphing commits
The big improvement is reusing the PBGraphCellInfo (~8-10%)
2010-07-04 22:12:42 -06:00
Nathan Kinsinger 7c62337ab9 Update commits every 0.1 sec instead of every 1000 commits
Slower machines will update more often and faster ones will do more work in each update.
2010-07-04 22:12:29 -06:00
Nathan Kinsinger 53d92fb73e Cleanup the views when the repository window closes and stop memory leaks.
- make sure to remove themselves from KV and notification center observers
    - add the PBWebHistoryController to PBHistoryController so it can be told to close
    - replaced the -removeView methods with -closeView (-removeView was not being used)
    - clear any obj-c objects set in web scripting objects

This last item seems to be the reason that the web controllers and the current commit did not get collected which then held the repository document from being collected as well.
2010-07-04 09:46:22 -06:00
Nathan Kinsinger a849424a46 Add a cleanup method to the history list.
The cleanup method cancels any background threads and removes KV observers when the repository document is closed.

Also removed KV observers that are no longer needed.
2010-07-04 09:46:15 -06:00
Nathan Kinsinger c17215e55e Create wrapper class around git_oid and use it
This is a convenience class to replace using NSStrings to store and compare SHAs. PBGitSHA has a much faster isEqual: function.

It is <NSCopying> compliant and implements isEqual: and hash so it can be used as a key in dictionaries.
2010-07-04 09:46:12 -06:00
Nathan Kinsinger e067390fb2 Bugfix: Stop committer names from getting mangled
If the commit's detail is not UTF8 then PBWebHistoryController's commitDetailsLoaded: method will drop down to Latin1. That can cause character's in the committer's name to not be converted correctly.

Move parsing the name to PBGitRevList where the correct encoding can be determined.
2010-07-04 09:46:07 -06:00
Nathan Kinsinger 1bad051779 Bugfix: fix duplicate commits in the history view
1) stop a threading issue with old commits being added after the commits array was reset
    2) stop using --early-output (shouldn't there be an incremental output option???)
2010-07-04 09:45:52 -06:00
Pieter de Bie 25caa849fe Fix safari 5 render issue 2010-07-04 09:45:49 -06:00
Nathan Kinsinger fb5f9a5cd5 Cache the lane colors
To reduce the number of objects created and destroyed while scrolling through the history list.

Also use a more descriptive name.
2010-07-04 09:45:45 -06:00
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