Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileList #1

Open
wants to merge 669 commits into
base: filelist
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
669 commits
Select commit Hold shift + click to select a range
12bb962
NULL-safe escapeHTML:
RomainMuller May 10, 2011
e546078
Fixed issue with the initial commit by adding --root in diff-tree arg…
RomainMuller May 10, 2011
1f73579
Don't crash with multiline gitconfig values.
nerdrew May 10, 2011
6dd2cf8
add some class comments
Apr 26, 2011
a7dc2bf
correct typo
May 6, 2011
b0090ce
help text member
May 9, 2011
104681c
Allow the project to be built in directories with spaces in the path …
May 13, 2011
6ae5d07
pop up the action menu immediately on click
May 13, 2011
43e3d46
helpTextForRef
May 14, 2011
1d24c1d
hook up helpText; works with tags
May 14, 2011
7806e64
help tags for remotes now work
May 15, 2011
4205333
Merge pull request #54 from RomainMuller/fix
laullon May 18, 2011
f463153
Merge pull request #59 from victor/master
laullon May 18, 2011
52b587a
Merge pull request #52 from darconeous/error-on-repo-open-fix
laullon May 18, 2011
502f218
Merge pull request #56 from nerdrew/master
laullon May 18, 2011
4432997
[GH-15] disappearing history
laullon May 18, 2011
2f828bb
Correct new repos history.
laullon May 18, 2011
94efa43
conditionalize usage of 10.6-only protocols
laullon May 18, 2011
2a2761d
Updates submodule to point to GitHub repository of LibGit2
RomainMuller May 18, 2011
6d8982a
Build with WAF outside of source tree.
RomainMuller May 18, 2011
b3cfd7f
Build fat libgit2
RomainMuller May 18, 2011
451335a
Build fat and use XCode's 32_64 arch specification style.
RomainMuller May 18, 2011
16c4ef4
Switch to own fork to have wafscript hack.
RomainMuller May 18, 2011
a317561
Fix missing symbol due to relocation in libgit2.
RomainMuller May 19, 2011
e4a0cf6
Merge pull request #66 from RomainMuller/update_libgit2
laullon May 19, 2011
22e4f18
build_libgit2.sh bug
laullon May 19, 2011
970352c
New Dock menu.
firesteps May 19, 2011
3ada98c
Use of stringWithFormat in this situation is overkill.
RomainMuller May 19, 2011
a56f82a
Ugly coupling with mis-use of delegate is ugly.
RomainMuller May 19, 2011
b71e1ca
Explicit cast is needed if we abuse the delegate that way.
RomainMuller May 19, 2011
7f28149
Add missing message declaration in header file.
RomainMuller May 19, 2011
c1b3658
Explicit cast to remove warning.
RomainMuller May 19, 2011
009affe
Merge pull request #68 from RomainMuller/small_fixes
laullon May 19, 2011
96a8794
Merge pull request #67 from firesteps/master
laullon May 19, 2011
ac1019d
no libgit2
laullon May 19, 2011
e00f734
Merge pull request #61 from Uncommon/helptags
laullon May 19, 2011
07d4bef
Merge branch 'refs/heads/no_libgit2'
laullon May 19, 2011
30cbf1a
more class comments
May 21, 2011
2158f1e
start on stash work
May 21, 2011
f5f0014
Merge pull request #60 from Uncommon/action
laullon May 23, 2011
883aa1a
Enabling sudden termination on Mac OS X 10.6+.
May 25, 2011
467f7ee
Using NSWorkspaceLaunchDefault in gitx cli.
May 25, 2011
001f49b
Disabling "Open Current Directory on Launch" by default. Adding a che…
May 25, 2011
25b65ac
Ignoring .DS_Store.
May 25, 2011
59701cb
Reworking html resources. For some reason, without this change none o…
May 27, 2011
ff833ea
Fixed GitX URL scheme problem (On Lion it always comes back as 'gitx').
May 27, 2011
b348ad2
Merge remote branch 'refs/remotes/laullon/master' into stash
May 27, 2011
9b0ce4c
forward declarations
May 27, 2011
34300f9
Merge pull request #69 from roustem/master
laullon May 27, 2011
4e54ff9
Revert "get back the old gitx_asskpasswd"
laullon May 27, 2011
87bc0d8
better new git_askpasswd
laullon May 27, 2011
1a35f02
rename & add to project
Jun 3, 2011
f2d8757
rename again to accommodate implicit nib naming
Jun 3, 2011
94c08dd
stash view xib
Jun 3, 2011
e1836bb
plug the stuff in, not working yet
Jun 3, 2011
800a143
modernize loop
Jun 5, 2011
50388f5
add some spaces
Jun 5, 2011
a2c623b
delete PBWebStashController
Jun 8, 2011
e254a44
fix some tabs
Jun 8, 2011
0d89d91
fix initial stash load
Jun 8, 2011
ee67330
Merge pull request #74 from Uncommon/stash
laullon Jun 9, 2011
0da7378
saner method name
Jun 10, 2011
9f98376
start on refactoring PBWebHistoryController
Jun 10, 2011
91026f8
base PBWebHistoryController on PBWebCommitController
Jun 11, 2011
10274ae
PBViewController.superController accessor
Jun 12, 2011
60503ba
fix file name comments
Jun 12, 2011
8053f57
add PBWebStashController
Jun 13, 2011
0ec89f1
plug in PBWebStashController
Jun 13, 2011
93212a6
WIP refactor parsing
Jun 13, 2011
fc3ef16
finish parser refactor
Jun 14, 2011
c02046e
JavaScript fix
Jun 14, 2011
8676e86
fix display for merge commits, which stashes happen to be
Jun 14, 2011
4a2c139
menus for files in stash view
Jun 16, 2011
0659d79
split pane
Jun 16, 2011
26ada64
show index in lower pane
Jun 16, 2011
73b548c
fix inverted diff
Jun 17, 2011
ba51ae8
fix parent handling
Jun 17, 2011
1b9e07c
Merge pull request #79 from Uncommon/stashview
laullon Jun 17, 2011
347aeaa
build for 10.6
Jun 19, 2011
d0480c8
replace URLByAppendingPathComponent:isDirectory: (requires 10.7) with…
Jun 19, 2011
4e456d1
Merge remote-tracking branch 'refs/remotes/laullon/master' into comments
Jun 19, 2011
3674dca
Merge pull request #81 from Uncommon/comments
laullon Jun 20, 2011
6cc2e26
Merge pull request #80 from Uncommon/url
laullon Jun 24, 2011
b4557eb
return a new commit object if it's not in the list
Jun 25, 2011
a569bd6
Merge pull request #85 from Uncommon/stashfix
laullon Jun 27, 2011
3fef72e
* Fixed bug where GitX would crash if there exists old remotes that o…
grundprinzip Jul 21, 2011
f0c7644
Merge pull request #93 from grundprinzip/master
laullon Jul 21, 2011
1a6ff75
working on OX X Lion
laullon Jul 24, 2011
959c5a8
COMPILATION ERROR
laullon Jul 24, 2011
3813be3
make history view less fugly
Jun 24, 2011
3583a9c
easier on the eyes
Jun 28, 2011
ed2174d
Don't show very long diffs by default.
barrywardell Jun 27, 2011
9203177
Only show first line of commit message in header, show the rest in th…
barrywardell Jun 27, 2011
dd9faee
Only create space for badges and detailed commit message if they exist.
barrywardell Jun 27, 2011
fe06dd6
Add some padding around detailed commit message text.
barrywardell Jun 27, 2011
782675e
Improve appearance of filelist and diff section in commit view.
barrywardell Jun 27, 2011
03e69f8
Make short commit message bold.
barrywardell Jun 27, 2011
98dfdb7
added ability to clone via gitx://clone/?repo=…
Aug 2, 2011
39e0cf9
Added lion full screen
wsinnema Aug 9, 2011
683870c
Added a commit menu item with shortcut ⌘
wsinnema Aug 9, 2011
76c0a97
fix to handle bad stash output
Aug 19, 2011
5fde8e8
fix a little mistake
Aug 22, 2011
946b538
Merge pull request #115 from Uncommon/stashfix
laullon Aug 23, 2011
a33c1c8
Merge pull request #113 from cocoason/master
laullon Aug 23, 2011
5c7e052
Merge pull request #101 from barrywardell/master
laullon Aug 23, 2011
9898579
Merge pull request #109 from fourplusone/master
laullon Aug 23, 2011
23c99a7
#89: Don't link to current commit
laullon Aug 23, 2011
84d245b
Allow building in Snow Leopard
Sep 9, 2011
0cec363
Merge pull request #126 from victor/patch-1
laullon Sep 12, 2011
8da3bfa
Speedups for reloading refs when there are lots of tags.
darconeous Oct 15, 2011
ce241c6
Merge pull request #139 from darconeous/speedup
laullon Dec 9, 2011
1d3caf6
Bugfix Branch Moving
Dec 10, 2011
7b01385
Use the current working directory if git couldn't find it.
Dec 13, 2011
65ef3f5
arc and 10.7
laullon Dec 17, 2011
26b67fe
correct sheets ARC
laullon Dec 17, 2011
613f231
Merge pull request #147 from Kyriakis/master
laullon Dec 17, 2011
0d782b5
Merge pull request #149 from ptxmac/master
laullon Dec 17, 2011
fafbb05
Merge branch 'refs/heads/master' into 0.9
laullon Dec 17, 2011
4f76ae0
oops.
laullon Dec 17, 2011
82fec62
rename Remotes, Tags, Branches and Remotebranches
Dec 18, 2011
ea86893
delete RemoteBranch local and on remote
Dec 18, 2011
188891a
load only 500 commits by default.
laullon Dec 19, 2011
eb464b6
Clean Project
Dec 19, 2011
677926d
Merge commit 'eb464b691a6b9169279e1f14320075da079e2e5f' into HEAD
Dec 19, 2011
c3a29fc
Bugfix DiscardHunk
Dec 19, 2011
87e98ad
Bugfix DiscardHunk and other old beginSheetModalForWindow-Error with …
Dec 19, 2011
4878e00
Optimization Rename remote branch
Dec 20, 2011
db3892f
Beginn Remote Change URL
Dec 27, 2011
1252e38
make askpasswd key and order front of GUI
Dec 29, 2011
056a308
merge
Dec 29, 2011
700e94a
Feature Change Remote URL
Dec 29, 2011
3fd1c16
Bugfix OpenPanel at Clone to appears only at the first time
Dec 30, 2011
a2f41af
Bugfix Clone Repository with bare-Option
Dec 30, 2011
97222e1
Install GitCleanUpMechanism when Error occurs.
Dec 30, 2011
79c1c85
error Message by empty URL and changing Remote URL
Dec 30, 2011
df832bd
Make GitX able to Commit Merges
Dec 31, 2011
ff6407a
Fetch Remotes with Tags
Dec 31, 2011
3c5781c
Push Tags to Remotes
Dec 31, 2011
031defd
Bugfix Add Remote
Dec 31, 2011
7d5cc36
Delete Tag on Remotes too
Dec 31, 2011
2eb2e25
Bugfix Show hidden Files
Dec 31, 2011
8e0004c
Show determinate ProgressIndicator by cloning a repository
Jan 1, 2012
53554c0
Run Clone ProgressIndicator in separate Thread
Jan 2, 2012
09f270d
Optimize Clone ProgressIndicator
Jan 2, 2012
c1c05c3
Bugfix fetch remote
Jan 2, 2012
e4f5598
Kosmetic at CloneProgressSheet
Jan 2, 2012
4b6302b
Show ErrorMessage when deleting an Remote Tag fails
Jan 3, 2012
70cb53b
Make Remote ProgressIndicator colored
Jan 3, 2012
dff706e
Make Remote ProgressIndicator colored
Jan 3, 2012
55ceb35
Merge commit '70cb53ba60029225295758fd18f01b661ed9546e' into HEAD
Jan 3, 2012
d5c70a3
Kosmetic
Jan 3, 2012
f4571be
Merge commit '55ceb35101344f82d3bd139e817ebf9cb91ca224' into topic
Jan 3, 2012
d861cb2
Bugfix Deleting Tag on Remotes with more than one Remote
Jan 4, 2012
2a993c9
Optimizing Rename Ref Feature
Jan 6, 2012
a7ea4cd
Using of old deleteRemote-method
Jan 7, 2012
21bb70a
Feature Rename validated
Jan 7, 2012
43adbe4
changeRemoteURL changed on Parameter PBGitRef
Jan 7, 2012
698426a
Bugfix resizing PBRemoteProgressSheet
Jan 7, 2012
ad13540
Ask before deleting a remote branch also on the remote
Jan 8, 2012
275953a
ask to delete tags on remote, when tags exist there + ask for every r…
Jan 8, 2012
0f3cc69
show existence of tag on remotes at tag info
Jan 8, 2012
12d4008
After cloneTo is asked, if user want to create a new Remote to the clone
Jan 8, 2012
0c05990
Ask every time, if user wants to delete a tag or branch on a remote, …
Jan 9, 2012
fec9b6c
On failure at CreateTag, CreateBrach and RenameRef it is show detaile…
Jan 9, 2012
3c2de68
Bugfix refexists-Methods
Jan 10, 2012
b9476a1
Merge pull request #150 from Kyriakis/master
laullon Feb 12, 2012
b598367
fixes open dialog from appearing when opening a repo from the cli
lukeman Feb 19, 2012
2cedd04
Merge pull request #154 from lukeman/fix-open-dialog
laullon Feb 19, 2012
df50e5e
Reload submodules asynchronously to avoid blocking the main thread.
ksuther Feb 20, 2012
2fc59d5
Load commit diffs in PBWebCommitController asynchronously.
ksuther Feb 20, 2012
542ff91
Killed nib warnings.
ksuther Feb 20, 2012
5ea2d5e
Merge pull request #155 from ksuther/master
laullon Feb 20, 2012
48da240
Xibs target 10.6
juhagman Feb 21, 2012
d34265f
NSSegmentStyle to Textured Square
juhagman Feb 21, 2012
1f2556c
- Targets 10.7
juhagman Feb 21, 2012
3d13a66
Merge pull request #157 from juhagman/xib-warnings
laullon Feb 21, 2012
83307f6
use a concurrent queue
laullon Feb 21, 2012
12ca779
avoids sorting stashes in the sidebar so that they keep their natural…
ebertech Feb 23, 2012
d70af98
fix not-displaying submodules
Feb 24, 2012
770f0df
fix major memory leak (malloc'ed memory is not freed automatically by…
Feb 25, 2012
64bf8d1
Massive retain cycle breaking so view controllers and PBGitRepository…
ksuther Feb 25, 2012
570754c
Breaking more retain cycles. PBGitCommits are finally released correc…
ksuther Feb 25, 2012
5120a22
Make the delegate unretained in MGScopeBar.
ksuther Feb 25, 2012
6e72e21
Use hasViewLoaded bool I found.
ksuther Feb 25, 2012
bf83768
Workaround for ARC causing some of the view controllers to get releas…
ksuther Feb 25, 2012
94e722b
Notify KVO when submodules changes.
ksuther Feb 27, 2012
7e21c52
Merge pull request #164 from ksuther/master
laullon Feb 28, 2012
24153c8
Merge pull request #161 from ebertech/master
laullon Feb 28, 2012
e07911c
Revert "fix not-displaying submodules"
greay Feb 29, 2012
5abb4d5
Preload historyViewController so contextual menus appear correctly if…
ksuther Mar 6, 2012
1db49ab
Reload the sidebar when removing submodule children. Without this the…
ksuther Mar 6, 2012
ef61b97
Update Rakefile to work with ruby-1.9.2.
taybin Mar 13, 2012
ebea53b
prevent crash by reloading data before expanding items
magicseth Mar 16, 2012
d060214
Merge pull request #170 from magicseth/master
laullon Mar 28, 2012
d37f322
Merge pull request #168 from ksuther/master
laullon Mar 28, 2012
daae73a
Merge pull request #163 from greay/fixes
laullon Mar 28, 2012
a239922
Display 'commit-msg' hook output.
nicolasdespres Apr 15, 2012
fd84719
Merge pull request #174 from polrop/display-commit-msg-hook-output
laullon Apr 16, 2012
907e967
Fix bug where submodules were incorrectly grouped when the first part…
barrywardell Feb 1, 2012
34de28d
annoying Xcode reformatting
jspiro May 4, 2012
2118e98
make OK button the initialFirstResponder on PBGitXMessageSheet so you…
jspiro May 4, 2012
054c76c
add confirmation dialog to apply/pop/drop commands
jspiro May 4, 2012
b547c26
Merge pull request #177 from jspiro/master
laullon May 4, 2012
0812581
Ensure proxy icon points to project, not .git dir
mczepiel May 18, 2012
bab7599
Merge pull request #183 from mczepiel/proxy-icon-fix
laullon May 18, 2012
14e30fc
Added context menu item for deleting files from the commit view. Refs…
jphalip May 21, 2012
18376bb
Merge pull request #184 from jphalip/master
laullon May 21, 2012
7728be7
Properly restore the search field's caret position in the file histor…
jphalip May 26, 2012
57dae2b
Merge pull request #186 from jphalip/master
laullon May 26, 2012
234283b
Update branch meta data, even if the branch has slashes in its name (…
jphalip May 26, 2012
7fe17b4
Improved file search UI by showing previous/next buttons and number o…
jphalip May 27, 2012
5c32c78
Do not systematically check the remotes when creating/renaming local …
jphalip May 28, 2012
349689e
Fixed a typo in the preferences integration panel: "Gits" -> "Gists".
jphalip May 28, 2012
5e58f51
Stop continuously nagging the user with a bouncing GitX dock icon whe…
jphalip May 29, 2012
7e8d79a
Merge pull request #187 from jphalip/master
laullon May 29, 2012
0ec81d1
Added an ellipsis at the end of the "Reset" menu titles as they open …
jphalip May 30, 2012
b57c1b4
Fixed a small typo.
jphalip May 30, 2012
21b8f38
Improved overall performance (in particular when opening repositories…
jphalip May 30, 2012
754afba
Let the file view search field grab focus only when it is required.
jphalip May 31, 2012
fd49408
Show full commit summary and date in a tooltip when hovering commit n…
jphalip May 31, 2012
0e61f37
Add keyboard shortcuts to stage and upstage files
mullr May 31, 2012
e4725ae
Added a checkbox to the 'Create tag' sheet to allow replacing existin…
jphalip May 31, 2012
18d7767
In the 'Create branch' sheet: use a placeholder in the branch name te…
jphalip May 31, 2012
8a9b962
Normalized the menu items to use capitalized initials and ellipses, a…
jphalip May 31, 2012
a9b2857
Merge pull request #189 from jphalip/master
laullon May 31, 2012
6f45075
Merge pull request #190 from mullr/master
laullon May 31, 2012
f38201d
Merge pull request #191 from jphalip/8a9b9629246dc7d97d748f8de414e14a…
laullon May 31, 2012
24d05af
Minor UI improvements to commit count status label.
jphalip Jun 2, 2012
42304da
Display file list at the top of the diff window.
jphalip Jun 2, 2012
cd2e8de
Made the sign-off button optional and hidden by default, as this is a…
jphalip Jun 2, 2012
aae5e7c
Merge pull request #192 from jphalip/master
laullon Jun 4, 2012
3e045a4
Ensure that the previously selected commit remains selected after ref…
jphalip Jun 6, 2012
8ce13ad
Merge pull request #194 from jphalip/master
laullon Jun 6, 2012
839c9b6
Made the diff tables adapt nicely to the window's size. Fixes #50.
jphalip Jun 7, 2012
d249fd6
When a branch gets selected in the sidebar, make sure its correspondi…
jphalip Jun 8, 2012
748621c
Made the "(Un)stage lines" functionality in the commit view work only…
jphalip Jun 8, 2012
af773ba
No check for refs on remotes while deleting them
Jun 9, 2012
3575e87
Prevent large files from getting loaded in the commit view to prevent…
jphalip Jun 9, 2012
5958f5b
Don't display all the files selected for deletion to avoid the confir…
jphalip Jun 10, 2012
7fafdb8
Tweaked capitalization of words in contextual menu items.
jphalip Jun 10, 2012
d1a8ba9
fix for ARC errors and other warnings
Jun 15, 2012
3386fc7
Make sure the commit view gets refreshed when 'Stage' gets selected a…
jphalip Jun 17, 2012
238a97a
Fixed a tiny typo.
jphalip Jun 17, 2012
8ebb58c
Added "Copy Reference to Clipboard" context menu item in sidebar.
jphalip Jun 19, 2012
b94240c
[y so slow] :D
laullon Jul 25, 2012
47a8a1a
Merge pull request #197 from Uncommon/arcfix
laullon Jul 25, 2012
8badd8a
Merge pull request #196 from Kyriakis/master
laullon Jul 25, 2012
dd1b324
Merge pull request #195 from jphalip/master
laullon Jul 25, 2012
3b06317
Merge pull request #175 from barrywardell/master
laullon Jul 25, 2012
bff6661
Merge pull request #169 from taybin/patch-1
laullon Jul 25, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DS_Store
build
build/revision
._*
*.xcodeproj/
!*.xcodeproj/project.pbxproj
Nightly.app.zip
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

44 changes: 44 additions & 0 deletions AIURLAdditions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/


/*!
* Provides some additional functionality when working with \c NSURL objects.
*/
@interface NSURL (AIURLAdditions)

/**
* @brief The length of the URL.
*
* @return The length (number of characters) of the absolute URL.
*/
@property (readonly, nonatomic) NSUInteger length;

/*!
* @brief Returns the argument for the specified key in the query string component of
* the URL.
*
* The search is case-sensitive, and the caller is responsible for removing any
* percent escapes, as well as "+" escapes, too.
*
* @param key The key whose value should be located and returned.
* @return The argument for the specified key, or \c nil if the key could not
* be found in the query string.
*/
- (NSString *)queryArgumentForKey:(NSString *)key;
- (NSString *)queryArgumentForKey:(NSString *)key withDelimiter:(NSString *)delimiter;

@end
55 changes: 55 additions & 0 deletions AIURLAdditions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Adium is the legal property of its developers, whose names are listed in the copyright file included
* with this source distribution.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#import "AIURLAdditions.h"

@implementation NSURL (AIURLAdditions)

- (NSUInteger)length
{
return [[self absoluteString] length];
}

- (NSString *)queryArgumentForKey:(NSString *)key withDelimiter:(NSString *)delimiter
{
for (NSString *obj in [[self query] componentsSeparatedByString:delimiter]) {
NSArray *keyAndValue = [obj componentsSeparatedByString:@"="];

if (([keyAndValue count] >= 2) && ([[keyAndValue objectAtIndex:0] caseInsensitiveCompare:key] == NSOrderedSame)) {
return [keyAndValue objectAtIndex:1];
}
}

return nil;
}

- (NSString *)queryArgumentForKey:(NSString *)key
{
NSString *delimiter;

// The arguments in query strings can be delimited with a semicolon (';') or an ampersand ('&'). Since it's not
// likely a single URL would use both types of delimeters, we'll attempt to pick one and use it.
if ([[self query] rangeOfString:@";"].location != NSNotFound) {
delimiter = @";";
} else {
// Assume '&' by default, since that's more common
delimiter = @"&";
}

return [self queryArgumentForKey:key withDelimiter:delimiter];
}

@end
3 changes: 2 additions & 1 deletion ApplicationController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <Cocoa/Cocoa.h>
#import "PBGitRepository.h"

@class PBCloneRepositoryPanel;

Expand All @@ -20,6 +19,8 @@
NSManagedObjectContext *managedObjectContext;

PBCloneRepositoryPanel *cloneRepositoryPanel;

NSDictionary *notificationUserInfo;
}

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator;
Expand Down
109 changes: 93 additions & 16 deletions ApplicationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
#import "PBGitDefaults.h"
#import "PBCloneRepositoryPanel.h"
#import "Sparkle/SUUpdater.h"
#import "AIURLAdditions.h"
#import "PBGitRepository.h"

@interface ApplicationController ()
- (void) cleanUpRemotesOnError;
@end


@implementation ApplicationController

Expand All @@ -31,7 +38,7 @@ - (ApplicationController*)init

if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load])
if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load])
NSLog(@"Could not load QuickLook");
DLog(@"Could not load QuickLook");

/* Value Transformers */
NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init];
Expand All @@ -55,26 +62,39 @@ - (void)registerServices
int serviceVersion = [[NSUserDefaults standardUserDefaults] integerForKey:@"Services Version"];
if (serviceVersion < 2)
{
NSLog(@"Updating services menu…");
DLog(@"Updating services menu…");
NSUpdateDynamicServices();
[[NSUserDefaults standardUserDefaults] setInteger:2 forKey:@"Services Version"];
}
}

- (void)applicationWillFinishLaunching:(NSNotification*)notification
{
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
}

- (void)applicationDidFinishLaunching:(NSNotification*)notification
{
[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getArguments:) name:@"GitCommandSent" object:Nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cleanGitAfterErrorMessage:) name:@"ErrorMessageDidEnd" object:Nil];

[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
[[SUUpdater sharedUpdater] setDelegate:self];

if ([PBGitDefaults useAskPasswd]) {
// Make sure Git's SSH password requests get forwarded to our little UI tool:
setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 );
setenv( "DISPLAY", "localhost:0", 1 );

}

[self registerServices];

BOOL hasOpenedDocuments = NO;
NSArray *launchedDocuments = [[[PBRepositoryDocumentController sharedDocumentController] documents] copy];

// Only try to open a default document if there are no documents open already.
// For example, the application might have been launched by double-clicking a .git repository,
// or by dragging a folder to the app icon
Expand Down Expand Up @@ -109,11 +129,21 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification

if (![[NSApplication sharedApplication] isActive])
return;
}

// The current directory was not enabled or could not be opened (most likely it’s not a git repository).
// show an open panel for the user to select a repository to view
if ([PBGitDefaults showOpenPanelOnLaunch] && !hasOpenedDocuments)
[[PBRepositoryDocumentController sharedDocumentController] openDocument:self];
- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
NSURL *url = [NSURL URLWithString:urlString];

if ([url.host isEqual:@"clone"]) {
NSString * repo = [[url queryArgumentForKey:@"repo"] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

[self showCloneRepository:self];

[cloneRepositoryPanel.repositoryURL setStringValue:repo];
}

}

- (void) windowWillClose: sender
Expand All @@ -133,6 +163,9 @@ - (IBAction)showAboutPanel:(id)sender
if (gitversion)
[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:gitversion, @"Version", nil]];

[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:@"GitX (L)", @"ApplicationName", nil]];
[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:@"(c) Pieter de Bie,2008\n(c) German Laullon,2011\nAnd more...", @"Copyright", nil]];

#ifdef DEBUG_BUILD
[dict addEntriesFromDictionary:[[NSDictionary alloc] initWithObjectsAndKeys:@"GitX (DEBUG)", @"ApplicationName", nil]];
#endif
Expand Down Expand Up @@ -216,7 +249,7 @@ - (NSManagedObjectModel *)managedObjectModel {
return managedObjectModel;
}

managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];
managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
return managedObjectModel;
}

Expand All @@ -242,7 +275,7 @@ - (NSPersistentStoreCoordinator *) persistentStoreCoordinator {
fileManager = [NSFileManager defaultManager];
applicationSupportFolder = [self applicationSupportFolder];
if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) {
[fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil];
[fileManager createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil];
}

url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"GitTest.xml"]];
Expand Down Expand Up @@ -363,6 +396,21 @@ - (void)applicationWillTerminate:(NSNotification *)aNotification
[PBGitDefaults setPreviousDocumentPaths:paths];
}
}

[[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
id dc = [PBRepositoryDocumentController sharedDocumentController];

// Reopen last document if user prefers
if ([PBGitDefaults showOpenPanelOnLaunch])
{
[dc openDocument:self];
}

return NO;
}

/**
Expand All @@ -371,10 +419,9 @@ - (void)applicationWillTerminate:(NSNotification *)aNotification

- (void) dealloc {

[managedObjectContext release], managedObjectContext = nil;
[persistentStoreCoordinator release], persistentStoreCoordinator = nil;
[managedObjectModel release], managedObjectModel = nil;
[super dealloc];
managedObjectContext = nil;
persistentStoreCoordinator = nil;
managedObjectModel = nil;
}


Expand Down Expand Up @@ -411,9 +458,39 @@ - (IBAction)showHelp:(id)sender

- (IBAction)reportAProblem:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.lighthouseapp.com/tickets"]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/laullon/gitx/issues"]];
}


#pragma mark - Observer methods

- (void)getArguments:(NSNotification*)notification
{
notificationUserInfo = [notification userInfo];
}


- (void)cleanGitAfterErrorMessage:(NSNotification*)notification
{
// When adding a remote occurs an error the remote
// will be set on git and has to be removed to clean the remotes list
[self cleanUpRemotesOnError];



}

#pragma mark - Extensions
- (void) cleanUpRemotesOnError
{
// check, if arguments was to add a remote
if ( ([(NSString*)[notificationUserInfo valueForKey:@"Arg0"] compare:@"remote"] == NSOrderedSame) &&
([(NSString*)[notificationUserInfo valueForKey:@"Arg1"] compare:@"add"] == NSOrderedSame)
)
{
PBGitRef *remoteRef = [PBGitRef refFromString:[NSString stringWithFormat:@"%@%@", kGitXRemoteRefPrefix,[notificationUserInfo valueForKey:@"Arg3"]]];
[[notificationUserInfo valueForKey:@"Repository"] deleteRemote:remoteRef];
}
}

@end
Loading