├── .gitattributes ├── .gitignore ├── .gitmodules ├── COPYING ├── Classes ├── CWQuickLook.h ├── Controllers │ ├── ApplicationController.h │ ├── ApplicationController.m │ ├── DBPrefsWindowController.h │ ├── DBPrefsWindowController.m │ ├── OpenRecentController.h │ ├── OpenRecentController.m │ ├── PBDiffWindowController.h │ ├── PBDiffWindowController.m │ ├── PBGitCommitController.h │ ├── PBGitCommitController.m │ ├── PBGitHistoryController.h │ ├── PBGitHistoryController.m │ ├── PBGitIndexController.h │ ├── PBGitIndexController.m │ ├── PBGitSidebarController.h │ ├── PBGitSidebarController.m │ ├── PBGitWindowController.h │ ├── PBGitWindowController.m │ ├── PBHistorySearchController.h │ ├── PBHistorySearchController.m │ ├── PBPrefsWindowController.h │ ├── PBPrefsWindowController.m │ ├── PBRefController.h │ ├── PBRefController.m │ ├── PBRepositoryDocumentController.h │ ├── PBRepositoryDocumentController.m │ ├── PBServicesController.h │ ├── PBServicesController.m │ ├── PBViewController.h │ ├── PBViewController.m │ ├── PBWebChangesController.h │ ├── PBWebChangesController.m │ ├── PBWebController.h │ ├── PBWebController.m │ ├── PBWebDiffController.h │ ├── PBWebDiffController.m │ ├── PBWebHistoryController.h │ └── PBWebHistoryController.m ├── GitXRelativeDateFormatter.h ├── GitXRelativeDateFormatter.m ├── GitXScriptingConstants.h ├── NSColor+RGB.h ├── NSColor+RGB.m ├── PBCLIProxy.h ├── PBCLIProxy.m ├── PBChangedFile.h ├── PBChangedFile.m ├── PBCommitList.h ├── PBCommitList.m ├── PBGraphCellInfo.h ├── PBGraphCellInfo.m ├── PBNSURLPathUserDefaultsTransfomer.h ├── PBNSURLPathUserDefaultsTransfomer.m ├── PBRefContextDelegate.h ├── PBUnsortableTableHeader.h ├── PBUnsortableTableHeader.m ├── RoundedRectangle.h ├── RoundedRectangle.m ├── Terminal.h ├── Util │ ├── NSApplication+GitXScripting.h │ ├── NSApplication+GitXScripting.m │ ├── NSFileHandleExt.h │ ├── NSFileHandleExt.m │ ├── NSOutlineViewExt.h │ ├── NSOutlineViewExt.m │ ├── NSString_RegEx.h │ ├── NSString_RegEx.m │ ├── NSString_Truncate.h │ ├── NSString_Truncate.m │ ├── PBEasyFS.h │ ├── PBEasyFS.m │ ├── PBEasyPipe.h │ ├── PBEasyPipe.m │ ├── RJModalRepoSheet.h │ └── RJModalRepoSheet.m ├── Views │ ├── GLFileView.h │ ├── GLFileView.m │ ├── GitXTextFieldCell.h │ ├── GitXTextFieldCell.m │ ├── PBAddRemoteSheet.h │ ├── PBAddRemoteSheet.m │ ├── PBCloneRepositoryPanel.h │ ├── PBCloneRepositoryPanel.m │ ├── PBCollapsibleSplitView.h │ ├── PBCollapsibleSplitView.m │ ├── PBCommitHookFailedSheet.h │ ├── PBCommitHookFailedSheet.m │ ├── PBCommitMessageView.h │ ├── PBCommitMessageView.m │ ├── PBCreateBranchSheet.h │ ├── PBCreateBranchSheet.m │ ├── PBCreateTagSheet.h │ ├── PBCreateTagSheet.m │ ├── PBFileChangesTableView.h │ ├── PBFileChangesTableView.m │ ├── PBGitGradientBarView.h │ ├── PBGitGradientBarView.m │ ├── PBGitRevisionCell.h │ ├── PBGitRevisionCell.m │ ├── PBGitXMessageSheet.h │ ├── PBGitXMessageSheet.m │ ├── PBIconAndTextCell.h │ ├── PBIconAndTextCell.m │ ├── PBNiceSplitView.h │ ├── PBNiceSplitView.m │ ├── PBQLOutlineView.h │ ├── PBQLOutlineView.m │ ├── PBQLTextView.h │ ├── PBQLTextView.m │ ├── PBRefMenuItem.h │ ├── PBRefMenuItem.m │ ├── PBRemoteProgressSheet.h │ ├── PBRemoteProgressSheet.m │ ├── PBSourceViewAction.h │ ├── PBSourceViewAction.m │ ├── PBSourceViewBadge.h │ ├── PBSourceViewBadge.m │ ├── PBSourceViewCell.h │ ├── PBSourceViewCell.m │ ├── PBSourceViewItem.h │ ├── PBSourceViewItem.m │ ├── PBSourceViewItems.h │ ├── PBSourceViewRemote.h │ └── PBSourceViewRemote.m ├── git │ ├── GTOID+JavaScript.h │ ├── GTOID+JavaScript.m │ ├── GitRepoFinder.h │ ├── GitRepoFinder.m │ ├── PBGitBinary.h │ ├── PBGitBinary.m │ ├── PBGitCommit.h │ ├── PBGitCommit.m │ ├── PBGitDefaults.h │ ├── PBGitDefaults.m │ ├── PBGitGraphLine.h │ ├── PBGitGraphLine.m │ ├── PBGitGrapher.h │ ├── PBGitGrapher.mm │ ├── PBGitHistoryGrapher.h │ ├── PBGitHistoryGrapher.m │ ├── PBGitHistoryList.h │ ├── PBGitHistoryList.m │ ├── PBGitIndex.h │ ├── PBGitIndex.m │ ├── PBGitLane.h │ ├── PBGitLane.mm │ ├── PBGitRef.h │ ├── PBGitRef.m │ ├── PBGitRefish.h │ ├── PBGitRepository.h │ ├── PBGitRepository.m │ ├── PBGitRepositoryWatcher.h │ ├── PBGitRepositoryWatcher.m │ ├── PBGitRepositoryWatcherEventPath.h │ ├── PBGitRepositoryWatcherEventPath.m │ ├── PBGitRevList.h │ ├── PBGitRevList.mm │ ├── PBGitRevSpecifier.h │ ├── PBGitRevSpecifier.m │ ├── PBGitSVBranchItem.h │ ├── PBGitSVBranchItem.m │ ├── PBGitSVFolderItem.h │ ├── PBGitSVFolderItem.m │ ├── PBGitSVOtherRevItem.h │ ├── PBGitSVOtherRevItem.m │ ├── PBGitSVRemoteBranchItem.h │ ├── PBGitSVRemoteBranchItem.m │ ├── PBGitSVRemoteItem.h │ ├── PBGitSVRemoteItem.m │ ├── PBGitSVStageItem.h │ ├── PBGitSVStageItem.m │ ├── PBGitSVSubmoduleItem.h │ ├── PBGitSVSubmoduleItem.m │ ├── PBGitSVTagItem.h │ ├── PBGitSVTagItem.m │ ├── PBGitTree.h │ ├── PBGitTree.m │ ├── PBGitXErrors.h │ ├── PBGitXErrors.m │ ├── PBGitXProtocol.h │ └── PBGitXProtocol.m ├── gitx.m ├── gitx_askpasswd_main.m ├── main.m └── speedtest.h ├── Common.xcconfig ├── Debug.xcconfig ├── Documentation ├── CallingFromWebKit.txt ├── GraphingAPI.txt ├── README └── ReleaseNotes │ ├── v0.2.1.txt │ ├── v0.2.txt │ ├── v0.3.1.txt │ ├── v0.3.txt │ ├── v0.4.1.txt │ ├── v0.4.txt │ ├── v0.5.txt │ ├── v0.6.1.txt │ ├── v0.6.2.txt │ ├── v0.6.3.txt │ ├── v0.6.txt │ ├── v0.7.1.txt │ └── v0.7.txt ├── English.lproj ├── InfoPlist.strings ├── MainMenu.xib ├── PBAddRemoteSheet.xib ├── PBCloneRepositoryPanel.xib ├── PBCreateBranchSheet.xib ├── PBCreateTagSheet.xib ├── PBRemoteProgressSheet.xib ├── Preferences.xib └── RepositoryWindow.xib ├── GitX.entitlements ├── GitX.h ├── GitX.sdef ├── GitX.xcodeproj ├── .gitignore ├── project.pbxproj ├── project.xcworkspace │ ├── .gitignore │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ ├── Debug.xcscheme │ └── Release.xcscheme ├── GitX_Prefix.pch ├── Install.xcconfig ├── README.markdown ├── Release.xcconfig ├── Resources ├── Credits.html ├── Images │ ├── AddBranchTemplate.pdf │ ├── AddLabelTemplate.pdf │ ├── AddRemoteTemplate.pdf │ ├── BranchTemplate.pdf │ ├── Buttons.svg │ ├── CherryPickTemplate.pdf │ ├── DetailViewTemplate.pdf │ ├── FetchTemplate.pdf │ ├── Files.svg │ ├── FolderClosedTemplate.pdf │ ├── FolderTemplate.pdf │ ├── Images.svg │ ├── MergeTemplate.pdf │ ├── Preferences │ │ └── Updates.png │ ├── PullTemplate.pdf │ ├── PushTemplate.pdf │ ├── RebaseTemplate.pdf │ ├── RemoteBranchTemplate.pdf │ ├── RemoteTemplate.pdf │ ├── StageTemplate.pdf │ ├── TagTemplate.pdf │ ├── TreeViewTemplate.pdf │ ├── deleted_file.pdf │ ├── empty_file.pdf │ ├── gitx_icon.psd │ ├── mainSplitterBar.tiff │ ├── mainSplitterDimple.tiff │ ├── new_file.pdf │ └── rewindImage.pdf ├── Info.plist ├── UpdateKey.pem ├── XIBs │ ├── OpenRecentPopup.xib │ ├── PBCommitHookFailedSheet.xib │ ├── PBDiffWindow.xib │ ├── PBGitCommitView.xib │ ├── PBGitHistoryView.xib │ ├── PBGitSidebarView.xib │ └── PBGitXMessageSheet.xib ├── gitx.icns └── source.css ├── Site ├── .gitignore ├── Rakefile ├── UserManual │ ├── .gitignore │ ├── assets │ │ └── images │ │ │ ├── branch-lanes.png │ │ │ ├── branchswitcher.png │ │ │ ├── commitview.png │ │ │ ├── detailswitcher.png │ │ │ ├── display_diff.png │ │ │ ├── gistie.png │ │ │ ├── gitx.png │ │ │ ├── historyview.png │ │ │ ├── left-right.png │ │ │ ├── menubar.png │ │ │ ├── quicklook.png │ │ │ └── viewswitcher.png │ ├── template.html │ └── text │ │ ├── 01 - Introduction.markdown │ │ ├── 02 - Overview.markdown │ │ ├── 03 - Committing.markdown │ │ └── 04 - Advance GitX usage.markdown ├── assets │ ├── css │ │ ├── master.css │ │ └── usermanual.css │ └── images │ │ ├── bg.png │ │ ├── download.png │ │ ├── favicon.png │ │ ├── header.jpg │ │ └── qtime.png ├── lib │ └── release_notes.rb ├── templates │ ├── site.html │ └── sparkle.xml └── text │ ├── contact.markdown │ ├── contribute.markdown │ ├── index.markdown │ ├── links.markdown │ ├── release_history.markdown │ └── seeit.markdown ├── SyntaxHighlighter-missing ├── shBrushObjC.js └── xregexp-min.js ├── appcast.py ├── build.py ├── html ├── css │ ├── GitX.css │ ├── diff.css │ ├── notification.css │ ├── shCoreGitX.css │ └── shThemeGitX.css ├── dragtest.html ├── images │ ├── added.svg │ ├── modified.svg │ ├── removed.svg │ ├── renamed.svg │ └── spinner.gif ├── inlinedifftest.html ├── lib │ ├── GitX.js │ ├── diffHighlighter.js │ ├── jquery-1.3.2.min.js │ ├── jquery-2.0.2.min.js │ ├── keyboardNavigation.js │ ├── md5.js │ └── syntaxhighlighter │ │ ├── GPL-LICENSE │ │ ├── MIT-LICENSE │ │ ├── index.html │ │ ├── scripts │ │ ├── shAutoloader.js │ │ ├── shBrushAS3.js │ │ ├── shBrushAppleScript.js │ │ ├── shBrushBash.js │ │ ├── shBrushCSharp.js │ │ ├── shBrushColdFusion.js │ │ ├── shBrushCpp.js │ │ ├── shBrushCss.js │ │ ├── shBrushDelphi.js │ │ ├── shBrushDiff.js │ │ ├── shBrushErlang.js │ │ ├── shBrushGroovy.js │ │ ├── shBrushHaxe.js │ │ ├── shBrushJScript.js │ │ ├── shBrushJava.js │ │ ├── shBrushJavaFX.js │ │ ├── shBrushObjC.js │ │ ├── shBrushPerl.js │ │ ├── shBrushPhp.js │ │ ├── shBrushPlain.js │ │ ├── shBrushPowerShell.js │ │ ├── shBrushPython.js │ │ ├── shBrushRuby.js │ │ ├── shBrushSass.js │ │ ├── shBrushScala.js │ │ ├── shBrushSql.js │ │ ├── shBrushTAP.js │ │ ├── shBrushTypeScript.js │ │ ├── shBrushVb.js │ │ ├── shBrushXml.js │ │ ├── shCore.js │ │ └── shLegacy.js │ │ └── styles │ │ ├── shCore.css │ │ ├── shCoreDefault.css │ │ ├── shCoreDjango.css │ │ ├── shCoreEclipse.css │ │ ├── shCoreEmacs.css │ │ ├── shCoreFadeToGrey.css │ │ ├── shCoreMDUltra.css │ │ ├── shCoreMidnight.css │ │ ├── shCoreRDark.css │ │ ├── shThemeDefault.css │ │ ├── shThemeDjango.css │ │ ├── shThemeEclipse.css │ │ ├── shThemeEmacs.css │ │ ├── shThemeFadeToGrey.css │ │ ├── shThemeMDUltra.css │ │ ├── shThemeMidnight.css │ │ └── shThemeRDark.css └── views │ ├── blame │ ├── blame.css │ ├── blame.js │ └── index.html │ ├── commit │ ├── commit.css │ ├── commit.js │ ├── index.html │ ├── multipleSelection.js │ └── test.html │ ├── diff │ ├── diffWindow.css │ ├── diffWindow.js │ └── index.html │ ├── fileview │ ├── fileview.js │ ├── index.html │ ├── index_test.html │ └── source.css │ ├── history │ ├── history.css │ ├── history.js │ └── index.html │ ├── log │ ├── format.html │ ├── index.html │ ├── log.css │ ├── log.js │ └── test.html │ └── source │ ├── index.html │ ├── source.css │ └── source.js ├── package.py ├── requirements.txt ├── sign.py └── updates ├── .gitignore ├── GitX-dev.css ├── GitX-dev.html └── GitX-dev.xml.tmpl /.gitattributes: -------------------------------------------------------------------------------- 1 | *.m diff=objc 2 | *.mm diff=objc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | stats/ 2 | build/ 3 | /release/ 4 | .DS_Store 5 | __pycache__/ 6 | *.pyc 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "objective-git"] 2 | path = objective-git 3 | url = git://github.com/rowanj/objective-git.git 4 | [submodule "Sparkle"] 5 | path = Sparkle 6 | url = https://github.com/rowanj/Sparkle.git 7 | [submodule "SyntaxHighlighter"] 8 | path = SyntaxHighlighter 9 | url = git://github.com/alexgorbatchev/SyntaxHighlighter.git 10 | [submodule "MGScopeBar"] 11 | path = MGScopeBar 12 | url = git://github.com/rowanj/MGScopeBar.git 13 | -------------------------------------------------------------------------------- /Classes/Controllers/ApplicationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitTest_AppDelegate.h 3 | // GitTest 4 | // 5 | // Created by Pieter de Bie on 13-06-08. 6 | // Copyright __MyCompanyName__ 2008 . All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRepository.h" 11 | 12 | @class PBCloneRepositoryPanel; 13 | 14 | @interface ApplicationController : NSObject 15 | { 16 | IBOutlet NSWindow *window; 17 | IBOutlet id firstResponder; 18 | 19 | PBCloneRepositoryPanel *cloneRepositoryPanel; 20 | bool started; 21 | } 22 | 23 | - (IBAction)openPreferencesWindow:(id)sender; 24 | - (IBAction)showAboutPanel:(id)sender; 25 | 26 | - (IBAction)installCliTool:(id)sender; 27 | 28 | - (IBAction)showHelp:(id)sender; 29 | - (IBAction)showChangeLog:(id)sender; 30 | - (IBAction)reportAProblem:(id)sender; 31 | 32 | - (IBAction)showCloneRepository:(id)sender; 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/Controllers/OpenRecentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OpenRecentController.h 3 | // GitX 4 | // 5 | // Created by Hajo Nils Krabbenhöft on 07.10.10. 6 | // Copyright 2010 spratpix GmbH & Co. KG. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OpenRecentController : NSWindowController { 13 | IBOutlet NSSearchField* searchField; 14 | NSURL* selectedResult; 15 | IBOutlet NSTableView* resultViewer; 16 | } 17 | 18 | @property (strong) NSMutableArray* currentResults; 19 | @property (strong) NSMutableArray* possibleResults; 20 | 21 | - (void) hide; 22 | - (void) show; 23 | 24 | - (IBAction)doSearch:(id) sender; 25 | - (IBAction)changeSelection:(id) sender; 26 | - (IBAction)tableDoubleClick:(id)sender; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/Controllers/PBDiffWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBDiffWindowController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 13-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitCommit; 12 | 13 | @interface PBDiffWindowController : NSWindowController { 14 | NSString *diff; 15 | } 16 | 17 | + (void) showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit; 18 | - (id) initWithDiff:(NSString *)diff; 19 | 20 | @property (readonly) NSString *diff; 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/Controllers/PBDiffWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBDiffWindowController.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 13-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import "PBDiffWindowController.h" 10 | #import "PBGitRepository.h" 11 | #import "PBGitCommit.h" 12 | #import "PBGitDefaults.h" 13 | 14 | 15 | @implementation PBDiffWindowController 16 | @synthesize diff; 17 | 18 | - (id) initWithDiff:(NSString *)aDiff 19 | { 20 | self = [super initWithWindowNibName:@"PBDiffWindow"]; 21 | 22 | if (self) 23 | diff = aDiff; 24 | 25 | return self; 26 | } 27 | 28 | 29 | + (void) showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit 30 | { 31 | if (!startCommit) 32 | return; 33 | 34 | if (!diffCommit) 35 | diffCommit = [startCommit.repository headCommit]; 36 | 37 | NSString *commitSelector = [NSString stringWithFormat:@"%@..%@", [startCommit realSha], [diffCommit realSha]]; 38 | NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", @"--no-ext-diff", commitSelector, nil]; 39 | 40 | if (![PBGitDefaults showWhitespaceDifferences]) 41 | [arguments insertObject:@"-w" atIndex:1]; 42 | 43 | if (filePaths) { 44 | [arguments addObject:@"--"]; 45 | [arguments addObjectsFromArray:filePaths]; 46 | } 47 | 48 | int retValue; 49 | NSString *diff = [startCommit.repository outputInWorkdirForArguments:arguments retValue:&retValue]; 50 | if (retValue) { 51 | NSLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff); 52 | return; 53 | } 54 | 55 | PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]]; 56 | [diffController showWindow:nil]; 57 | } 58 | 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Classes/Controllers/PBGitCommitController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitCommitController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 19-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBViewController.h" 11 | 12 | @class PBGitIndexController; 13 | @class PBIconAndTextCell; 14 | @class PBWebChangesController; 15 | @class PBGitIndex; 16 | @class PBNiceSplitView; 17 | @class PBCommitMessageView; 18 | 19 | @interface PBGitCommitController : PBViewController { 20 | // This might have to transfer over to the PBGitRepository 21 | // object sometime 22 | PBGitIndex *index; 23 | 24 | IBOutlet PBCommitMessageView *commitMessageView; 25 | IBOutlet NSArrayController *unstagedFilesController; 26 | IBOutlet NSArrayController *cachedFilesController; 27 | IBOutlet NSButton *commitButton; 28 | 29 | IBOutlet PBGitIndexController *indexController; 30 | IBOutlet PBWebChangesController *webController; 31 | IBOutlet PBNiceSplitView *commitSplitView; 32 | } 33 | 34 | @property(readonly) PBGitIndex *index; 35 | 36 | - (IBAction) refresh:(id) sender; 37 | - (IBAction) commit:(id) sender; 38 | - (IBAction) forceCommit:(id) sender; 39 | - (IBAction)signOff:(id)sender; 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/Controllers/PBGitIndexController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitIndexController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 18-11-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitCommitController.h" 11 | #import "PBChangedFile.h" 12 | 13 | @interface PBGitIndexController : NSObject { 14 | IBOutlet NSArrayController *stagedFilesController, *unstagedFilesController; 15 | IBOutlet PBGitCommitController *commitController; 16 | 17 | IBOutlet NSTableView *unstagedTable; 18 | IBOutlet NSTableView *stagedTable; 19 | } 20 | 21 | - (IBAction) rowClicked:(NSCell *) sender; 22 | - (IBAction) tableClicked:(NSTableView *)tableView; 23 | 24 | - (NSMenu *) menuForTable:(NSTableView *)table; 25 | 26 | - (void) stageSelectedFiles; 27 | - (void) unstageSelectedFiles; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/Controllers/PBGitSidebarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSidebar.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBViewController.h" 11 | 12 | @class PBSourceViewItem; 13 | @class PBGitHistoryController; 14 | @class PBGitCommitController; 15 | 16 | @interface PBGitSidebarController : PBViewController { 17 | IBOutlet NSWindow *window; 18 | IBOutlet NSOutlineView *sourceView; 19 | IBOutlet NSView *sourceListControlsView; 20 | IBOutlet NSPopUpButton *actionButton; 21 | IBOutlet NSSegmentedControl *remoteControls; 22 | 23 | NSMutableArray *items; 24 | 25 | /* Specific things */ 26 | PBSourceViewItem *stage; 27 | 28 | PBSourceViewItem *branches, *remotes, *tags, *others, *submodules; 29 | 30 | PBGitHistoryController *historyViewController; 31 | PBGitCommitController *commitViewController; 32 | } 33 | 34 | - (void) selectStage; 35 | - (void) selectCurrentBranch; 36 | 37 | - (NSMenu *) menuForRow:(NSInteger)row; 38 | - (void) menuNeedsUpdate:(NSMenu *)menu; 39 | 40 | - (IBAction) fetchPullPushAction:(id)sender; 41 | 42 | - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; 43 | 44 | @property(readonly) NSMutableArray *items; 45 | @property(readonly) NSView *sourceListControlsView; 46 | @property(readonly) PBGitHistoryController *historyViewController; 47 | @property(readonly) PBGitCommitController *commitViewController; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/Controllers/PBGitWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBDetailController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 16-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBViewController, PBGitSidebarController, PBGitCommitController, PBGitRepository; 12 | @class RJModalRepoSheet; 13 | 14 | @interface PBGitWindowController : NSWindowController { 15 | PBViewController *contentController; 16 | 17 | PBGitSidebarController *sidebarController; 18 | IBOutlet NSView *sourceListControlsView; 19 | IBOutlet NSSplitView *splitView; 20 | IBOutlet NSView *sourceSplitView; 21 | IBOutlet NSView *contentSplitView; 22 | 23 | IBOutlet NSTextField *statusField; 24 | IBOutlet NSProgressIndicator *progressIndicator; 25 | 26 | PBViewController* viewController; 27 | 28 | IBOutlet NSToolbarItem *terminalItem; 29 | IBOutlet NSToolbarItem *finderItem; 30 | } 31 | 32 | @property (nonatomic, weak) PBGitRepository *repository; 33 | 34 | - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)display; 35 | 36 | - (void)changeContentController:(PBViewController *)controller; 37 | 38 | - (void)showCommitHookFailedSheet:(NSString *)messageText infoText:(NSString *)infoText commitController:(PBGitCommitController *)controller GITX_DEPRECATED; 39 | - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText GITX_DEPRECATED; 40 | - (void)showErrorSheet:(NSError *)error GITX_DEPRECATED; 41 | - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output GITX_DEPRECATED; 42 | 43 | - (void)showModalSheet:(RJModalRepoSheet*)sheet; 44 | - (void)hideModalSheet:(RJModalRepoSheet*)sheet; 45 | 46 | - (IBAction) showCommitView:(id)sender; 47 | - (IBAction) showHistoryView:(id)sender; 48 | - (IBAction) revealInFinder:(id)sender; 49 | - (IBAction) openInTerminal:(id)sender; 50 | - (IBAction) refresh:(id)sender; 51 | 52 | - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Classes/Controllers/PBHistorySearchController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBHistorySearchController.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 8/21/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef enum historySearchModes { 13 | kGitXBasicSeachMode = 1, 14 | kGitXPickaxeSearchMode, 15 | kGitXRegexSearchMode, 16 | kGitXPathSearchMode, 17 | kGitXMaxSearchMode // always keep this item last 18 | } PBHistorySearchMode; 19 | 20 | @class PBGitHistoryController; 21 | 22 | 23 | @interface PBHistorySearchController : NSObject { 24 | PBHistorySearchMode searchMode; 25 | NSIndexSet *results; 26 | NSTimer *searchTimer; 27 | NSTask *backgroundSearchTask; 28 | NSPanel *rewindPanel; 29 | } 30 | 31 | @property (assign) IBOutlet PBGitHistoryController *historyController; 32 | @property (assign) IBOutlet NSArrayController *commitController; 33 | 34 | @property (assign) IBOutlet NSSearchField *searchField; 35 | @property (assign) IBOutlet NSSegmentedControl *stepper; 36 | @property (assign) IBOutlet NSTextField *numberOfMatchesField; 37 | @property (assign) IBOutlet NSProgressIndicator *progressIndicator; 38 | 39 | @property PBHistorySearchMode searchMode; 40 | 41 | 42 | - (BOOL)isRowInSearchResults:(NSInteger)rowIndex; 43 | - (BOOL)hasSearchResults; 44 | 45 | - (void)selectSearchMode:(id)sender; 46 | 47 | - (void)selectNextResult; 48 | - (void)selectPreviousResult; 49 | - (IBAction)stepperPressed:(id)sender; 50 | 51 | - (void)clearSearch; 52 | - (IBAction)updateSearch:(id)sender; 53 | 54 | - (void)setHistorySearch:(NSString *)searchString mode:(NSInteger)mode; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Classes/Controllers/PBPrefsWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBPrefsWindowController.h 3 | // GitX 4 | // 5 | // Created by Christian Jacobsen on 02/10/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DBPrefsWindowController.h" 11 | 12 | @interface PBPrefsWindowController : DBPrefsWindowController { 13 | /* Outlets for Preference Views */ 14 | IBOutlet NSView *generalPrefsView; 15 | IBOutlet NSView *integrationPrefsView; 16 | IBOutlet NSView *updatesPrefsView; 17 | 18 | /* Variables for the Updates View */ 19 | IBOutlet NSPathControl *gitPathController; 20 | IBOutlet NSImageView *badGitPathIcon; 21 | IBOutlet NSView *gitPathOpenAccessory; 22 | NSOpenPanel *gitPathOpenPanel; 23 | 24 | } 25 | 26 | - (IBAction) checkGitValidity: sender; 27 | - (void)pathCell:(NSPathCell *)pathCell willDisplayOpenPanel:(NSOpenPanel *)openPanel; 28 | - (IBAction) showHideAllFiles: sender; 29 | - (IBAction) resetGitPath: sender; 30 | - (IBAction)resetAllDialogWarnings:(id)sender; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/Controllers/PBRefController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBLabelController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 21-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitHistoryController.h" 11 | #import "PBCommitList.h" 12 | #import "PBGitRef.h" 13 | #import "PBGitCommit.h" 14 | #import "PBRefContextDelegate.h" 15 | 16 | @class PBRefMenuItem; 17 | 18 | @interface PBRefController : NSObject { 19 | IBOutlet PBGitHistoryController *historyController; 20 | IBOutlet NSArrayController *commitController; 21 | IBOutlet PBCommitList *commitList; 22 | 23 | IBOutlet NSPopUpButton *branchPopUp; 24 | } 25 | 26 | - (void) fetchRemote:(PBRefMenuItem *)sender; 27 | - (void) pullRemote:(PBRefMenuItem *)sender; 28 | - (void) pushUpdatesToRemote:(PBRefMenuItem *)sender; 29 | - (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender; 30 | - (void) pushToRemote:(PBRefMenuItem *)sender; 31 | - (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef; 32 | 33 | - (void) checkout:(PBRefMenuItem *)sender; 34 | - (void) merge:(PBRefMenuItem *)sender; 35 | - (void) cherryPick:(PBRefMenuItem *)sender; 36 | - (void) rebaseHeadBranch:(PBRefMenuItem *)sender; 37 | - (void) createBranch:(PBRefMenuItem *)sender; 38 | - (void) copySHA:(PBRefMenuItem *)sender; 39 | - (void) copyShortSHA:(PBRefMenuItem *)sender; 40 | - (void) copyPatch:(PBRefMenuItem *)sender; 41 | - (void) diffWithHEAD:(PBRefMenuItem *)sender; 42 | - (void) createTag:(PBRefMenuItem *)sender; 43 | - (void) showTagInfoSheet:(PBRefMenuItem *)sender; 44 | 45 | - (NSArray *) menuItemsForRef:(PBGitRef *)ref; 46 | - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; 47 | - (NSArray *)menuItemsForRow:(NSInteger)rowIndex; 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Classes/Controllers/PBRepositoryDocumentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRepositoryDocumentController.h 3 | // GitX 4 | // 5 | // Created by Ciarán Walsh on 15/08/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PBRepositoryDocumentController : NSDocumentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/Controllers/PBRepositoryDocumentController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBRepositoryDocumentController.mm 3 | // GitX 4 | // 5 | // Created by Ciarán Walsh on 15/08/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBRepositoryDocumentController.h" 10 | #import "PBGitRepository.h" 11 | #import "PBGitRevList.h" 12 | #import "PBEasyPipe.h" 13 | #import "PBGitBinary.h" 14 | #import "GitRepoFinder.h" 15 | 16 | #import 17 | 18 | @implementation PBRepositoryDocumentController 19 | // This method is overridden to configure the open panel to only allow 20 | // selection of directories 21 | - (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions 22 | { 23 | [openPanel setCanChooseFiles:YES]; 24 | [openPanel setCanChooseDirectories:YES]; 25 | [openPanel setAllowedFileTypes:[NSArray arrayWithObject:@"git"]]; 26 | return [openPanel runModal]; 27 | } 28 | 29 | - (id)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError *__autoreleasing *)outError { 30 | NSOpenPanel *op = [NSOpenPanel openPanel]; 31 | 32 | [op setCanChooseFiles:NO]; 33 | [op setCanChooseDirectories:YES]; 34 | [op setAllowsMultipleSelection:NO]; 35 | [op setMessage:@"Initialize a repository here:"]; 36 | [op setTitle:@"New Repository"]; 37 | if ([op runModal] != NSFileHandlingPanelOKButton) { 38 | if (outError) { 39 | *outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]; 40 | } 41 | return nil; 42 | } 43 | 44 | BOOL success = [GTRepository initializeEmptyRepositoryAtFileURL:[op URL] error:outError]; 45 | if (!success) 46 | return nil; // Repo creation failed 47 | 48 | return [[PBGitRepository alloc] initWithContentsOfURL:[op URL] ofType:PBGitRepositoryDocumentType error:outError]; 49 | } 50 | 51 | - (BOOL)validateMenuItem:(NSMenuItem *)item 52 | { 53 | if ([item action] == @selector(newDocument:)) 54 | return ([PBGitBinary path] != nil); 55 | return [super validateMenuItem:item]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/Controllers/PBServicesController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBServicesController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 10/24/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBServicesController : NSObject { 13 | 14 | } 15 | 16 | - (NSString *)completeSHA1For:(NSString *)sha; 17 | 18 | - (void)completeSha:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Controllers/PBServicesController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBServicesController.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 10/24/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBServicesController.h" 10 | #import "PBGitRepository.h" 11 | 12 | @implementation PBServicesController 13 | 14 | - (NSString *)completeSHA1For:(NSString *)sha 15 | { 16 | NSArray *documents = [[NSApplication sharedApplication] orderedDocuments]; 17 | for (PBGitRepository *repo in documents) 18 | { 19 | int ret = 1; 20 | NSString *s = [repo outputForArguments:[NSArray arrayWithObjects:@"log", @"-1", @"--pretty=format:%h (%s)", sha, nil] retValue:&ret]; 21 | if (!ret) 22 | return s; 23 | } 24 | return @"Could not find SHA"; 25 | } 26 | 27 | -(NSString *)runNameRevFor:(NSString *)s 28 | { 29 | NSArray *repositories = [[NSApplication sharedApplication] orderedDocuments]; 30 | if ([repositories count] == 0) 31 | return s; 32 | PBGitRepository *repo = [repositories objectAtIndex:0]; 33 | int ret = 1; 34 | NSString *returnString = [repo outputForArguments:[NSArray arrayWithObjects:@"name-rev", @"--stdin", nil] inputString:s retValue:&ret]; 35 | if (ret) 36 | return s; 37 | return returnString; 38 | } 39 | 40 | -(void)completeSha:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error 41 | { 42 | NSArray *types = [pboard types]; 43 | if (![types containsObject:NSStringPboardType]) 44 | { 45 | *error = @"Could not get data"; 46 | return; 47 | } 48 | 49 | NSString *s = [pboard stringForType:NSStringPboardType]; 50 | if ([s rangeOfString:@" "].location == NSNotFound) 51 | s = [self completeSHA1For:s]; 52 | else 53 | s = [self runNameRevFor:s]; 54 | 55 | [pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 56 | [pboard setString:s forType:NSStringPboardType]; 57 | } 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/Controllers/PBViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBViewController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 22-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRepository.h" 11 | #import "PBGitWindowController.h" 12 | 13 | @interface PBViewController : NSViewController { 14 | __weak PBGitRepository *repository; 15 | PBGitWindowController *superController; 16 | 17 | NSString *status; 18 | BOOL isBusy; 19 | BOOL hasViewLoaded; 20 | } 21 | 22 | @property (weak, readonly) PBGitRepository *repository; 23 | @property(copy) NSString *status; 24 | @property(assign) BOOL isBusy; 25 | 26 | - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; 27 | 28 | /* closeView is called when the repository window will be closed */ 29 | - (void)closeView; 30 | 31 | /* Updateview is called every time it is loaded into the main view */ 32 | - (void) updateView; 33 | 34 | /* Called after awakeFromNib:, and the view has been loaded into the main view. 35 | * Useful for resizing stuff after everything has been set in the right position 36 | */ 37 | - (void)viewLoaded; 38 | 39 | - (NSResponder *)firstResponder; 40 | - (IBAction) refresh:(id)sender; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Classes/Controllers/PBViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBViewController.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 22-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBViewController.h" 10 | 11 | 12 | @implementation PBViewController 13 | 14 | @synthesize repository; 15 | @synthesize status; 16 | @synthesize isBusy; 17 | 18 | - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller 19 | { 20 | NSString *nibName = [[[self class] description] stringByReplacingOccurrencesOfString:@"Controller" 21 | withString:@"View"]; 22 | if(self = [self initWithNibName:nibName bundle:nil]) { 23 | repository = theRepository; 24 | superController = controller; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | - (void)dealloc { 31 | superController = nil; 32 | } 33 | 34 | - (void)closeView 35 | { 36 | [self unbind:@"repository"]; 37 | if (hasViewLoaded) 38 | [[self view] removeFromSuperview]; // remove the current view 39 | } 40 | 41 | - (void)awakeFromNib 42 | { 43 | hasViewLoaded = YES; 44 | } 45 | 46 | - (NSResponder *)firstResponder; 47 | { 48 | return nil; 49 | } 50 | 51 | - (IBAction) refresh: sender 52 | { 53 | } 54 | 55 | // The next methods should be implemented in the subclass if necessary 56 | - (void)updateView 57 | { 58 | } 59 | 60 | - (void)viewLoaded 61 | { 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Classes/Controllers/PBWebChangesController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBWebChangesController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 22-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBWebController.h" 11 | #import "PBGitCommitController.h" 12 | #import "PBChangedFile.h" 13 | 14 | @class PBGitIndexController; 15 | 16 | @interface PBWebChangesController : PBWebController { 17 | IBOutlet NSArrayController *unstagedFilesController; 18 | IBOutlet NSArrayController *cachedFilesController; 19 | IBOutlet PBGitCommitController *controller; 20 | IBOutlet PBGitIndexController *indexController; 21 | 22 | PBChangedFile *selectedFile; 23 | BOOL selectedFileIsCached; 24 | } 25 | 26 | - (void) refresh; 27 | - (void) setStateMessage:(NSString *)state; 28 | 29 | - (void) showMultiple:(NSArray *)files; 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/Controllers/PBWebController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBWebController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 08-10-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PBWebController : NSObject { 13 | IBOutlet WebView* view; 14 | NSString *startFile; 15 | BOOL finishedLoading; 16 | 17 | // For async git reading 18 | NSMapTable *callbacks; 19 | 20 | // For the repository access 21 | IBOutlet id repository; 22 | } 23 | 24 | @property NSString *startFile; 25 | @property id repository; 26 | 27 | - (WebScriptObject *) script; 28 | - (void) closeView; 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/Controllers/PBWebDiffController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBWebDiffController.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 13-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBWebController.h" 11 | #import "PBDiffWindowController.h" 12 | 13 | @interface PBWebDiffController : PBWebController { 14 | IBOutlet PBDiffWindowController *diffController; 15 | } 16 | 17 | - (void) showDiff:(NSString *)diff; 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/Controllers/PBWebDiffController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBWebDiffController.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 13-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import "PBWebDiffController.h" 10 | 11 | 12 | @implementation PBWebDiffController 13 | 14 | - (void) awakeFromNib 15 | { 16 | startFile = @"diff"; 17 | [super awakeFromNib]; 18 | [diffController addObserver:self forKeyPath:@"diff" options:0 context:@"ChangedDiff"]; 19 | } 20 | 21 | - (void)closeView 22 | { 23 | [diffController removeObserver:self forKeyPath:@"diff"]; 24 | 25 | [super closeView]; 26 | } 27 | 28 | 29 | - (void) didLoad 30 | { 31 | [self showDiff:diffController.diff]; 32 | } 33 | 34 | - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 35 | { 36 | if ([(__bridge NSString *)context isEqualToString: @"ChangedDiff"]) 37 | [self showDiff:diffController.diff]; 38 | } 39 | 40 | - (void) showDiff: (NSString *) diff 41 | { 42 | if (diff == nil || !finishedLoading) 43 | return; 44 | 45 | id script = [view windowScriptObject]; 46 | if ([diff length] == 0) 47 | [script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObject:@"There are no differences"]]; 48 | else 49 | [script callWebScriptMethod:@"showDiff" withArguments:[NSArray arrayWithObject:diff]]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/Controllers/PBWebHistoryController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBWebGitController.h 3 | // GitTest 4 | // 5 | // Created by Pieter de Bie on 14-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBWebController.h" 11 | 12 | #import "PBGitCommit.h" 13 | #import "PBGitHistoryController.h" 14 | #import "PBRefContextDelegate.h" 15 | 16 | 17 | @class GTOID; 18 | 19 | 20 | @interface PBWebHistoryController : PBWebController { 21 | IBOutlet PBGitHistoryController* historyController; 22 | IBOutlet id contextMenuDelegate; 23 | 24 | GTOID* currentSha; 25 | NSString* diff; 26 | } 27 | 28 | - (void) changeContentTo: (PBGitCommit *) content; 29 | - (void) sendKey: (NSString*) key; 30 | 31 | @property (readonly) NSString* diff; 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/GitXRelativeDateFormatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitXRelativeDateFormatter.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 9/1/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface GitXRelativeDateFormatter : NSFormatter { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/GitXScriptingConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitXScriptingConstants.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 8/15/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #define kGitXBundleIdentifier @"net.phere.GitX" 10 | 11 | 12 | #define kGitXAEKeyArgumentsList 'ARGS' 13 | 14 | #define kGitXCloneDestinationURLKey @"destinationURL" 15 | #define kGitXCloneIsBareKey @"isBare" 16 | 17 | #define kGitXFindSearchStringKey @"searchString" 18 | #define kGitXFindInModeKey @"inMode" 19 | -------------------------------------------------------------------------------- /Classes/NSColor+RGB.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+RGB.h 3 | // GitX 4 | // 5 | // Created by Rowan James on 18/08/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSColor (RGB) 12 | 13 | + (NSColor *)colorWithR:(uint8_t)r G:(uint8_t)g B:(uint8_t)b; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/NSColor+RGB.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+RGB.m 3 | // GitX 4 | // 5 | // Created by Rowan James on 18/08/13. 6 | // 7 | // 8 | 9 | #import "NSColor+RGB.h" 10 | 11 | @implementation NSColor (RGB) 12 | 13 | + (NSColor *)colorWithR:(uint8_t)r G:(uint8_t)g B:(uint8_t)b 14 | { 15 | const CGFloat MAX_RGB = 255.0; 16 | NSColor *result = [NSColor colorWithCalibratedRed:(r/MAX_RGB) green:(g/MAX_RGB) blue:(b/MAX_RGB) alpha:1]; 17 | return result; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/PBCLIProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCLIProxy.h 3 | // GitX 4 | // 5 | // Created by Ciarán Walsh on 15/08/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PBCLIProxy : NSObject 12 | { 13 | NSConnection *connection; 14 | } 15 | @property (retain) NSConnection* connection; 16 | @end 17 | 18 | #define ConnectionName @"GitX DO Connection" 19 | #define PBCLIProxyErrorDomain @"PBCLIProxyErrorDomain" 20 | 21 | @protocol GitXCliToolProtocol 22 | - (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(NSError**)error; 23 | - (void)openDiffWindowWithDiff:(NSString *)diff; 24 | @end -------------------------------------------------------------------------------- /Classes/PBChangedFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBChangedFile.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 22-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | NEW, 13 | MODIFIED, 14 | DELETED 15 | } PBChangedFileStatus; 16 | 17 | @interface PBChangedFile : NSObject { 18 | NSString *path; 19 | BOOL hasStagedChanges; 20 | BOOL hasUnstagedChanges; 21 | 22 | // Index and HEAD stuff, to be used to revert changes 23 | NSString *commitBlobSHA; 24 | NSString *commitBlobMode; 25 | 26 | PBChangedFileStatus status; 27 | } 28 | 29 | 30 | @property (copy) NSString *path, *commitBlobSHA, *commitBlobMode; 31 | @property (assign) PBChangedFileStatus status; 32 | @property (assign) BOOL hasStagedChanges, hasUnstagedChanges; 33 | 34 | - (NSImage *)icon; 35 | - (NSString *)indexInfo; 36 | 37 | - (id) initWithPath:(NSString *)p; 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/PBChangedFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBChangedFile.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 22-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBChangedFile.h" 10 | #import "PBEasyPipe.h" 11 | 12 | @implementation PBChangedFile 13 | 14 | @synthesize path, status, hasStagedChanges, hasUnstagedChanges, commitBlobSHA, commitBlobMode; 15 | 16 | - (id) initWithPath:(NSString *)p 17 | { 18 | self = [super init]; 19 | 20 | if (self) { 21 | path = p; 22 | } 23 | return self; 24 | } 25 | 26 | - (NSString *)indexInfo 27 | { 28 | NSAssert(status == NEW || self.commitBlobSHA, @"File is not new, but doesn't have an index entry!"); 29 | if (!self.commitBlobSHA) 30 | return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@\0", self.path]; 31 | else 32 | return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path]; 33 | } 34 | 35 | - (NSImage *) icon 36 | { 37 | NSString *filename; 38 | switch (status) { 39 | case NEW: 40 | filename = @"new_file"; 41 | break; 42 | case DELETED: 43 | filename = @"deleted_file"; 44 | break; 45 | default: 46 | filename = @"empty_file"; 47 | break; 48 | } 49 | return [NSImage imageNamed:filename]; 50 | } 51 | 52 | + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector 53 | { 54 | return NO; 55 | } 56 | 57 | + (BOOL)isKeyExcludedFromWebScript:(const char *)name { 58 | return NO; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Classes/PBCommitList.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCommitList.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/11/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class PBGitHistoryController; 13 | @class PBWebHistoryController; 14 | @class PBHistorySearchController; 15 | 16 | typedef void(^PBFindPanelActionBlock)(id sender); 17 | 18 | @interface PBCommitList : NSTableView { 19 | IBOutlet WebView* webView; 20 | IBOutlet PBWebHistoryController *webController; 21 | IBOutlet PBGitHistoryController *controller; 22 | IBOutlet PBHistorySearchController *searchController; 23 | 24 | BOOL useAdjustScroll; 25 | NSPoint mouseDownPoint; 26 | } 27 | 28 | @property (readonly) NSPoint mouseDownPoint; 29 | @property (assign) BOOL useAdjustScroll; 30 | @property (copy) PBFindPanelActionBlock findPanelActionBlock; 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/PBGraphCellInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGraphCellInfo.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitGraphLine.h" 11 | 12 | @interface PBGraphCellInfo : NSObject 13 | { 14 | int position; 15 | struct PBGitGraphLine *lines; 16 | int nLines; 17 | int numColumns; 18 | char sign; 19 | } 20 | 21 | @property struct PBGitGraphLine *lines; 22 | @property(assign) int nLines; 23 | @property(assign) int position, numColumns; 24 | @property(assign) char sign; 25 | 26 | 27 | - (id)initWithPosition:(int) p andLines:(struct PBGitGraphLine *) l; 28 | 29 | @end -------------------------------------------------------------------------------- /Classes/PBGraphCellInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGraphCellInfo.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBGraphCellInfo.h" 10 | 11 | 12 | @implementation PBGraphCellInfo 13 | @synthesize position, numColumns, sign, nLines; 14 | - (id)initWithPosition:(int)p andLines:(struct PBGitGraphLine *)l 15 | { 16 | position = p; 17 | lines = l; 18 | 19 | return self; 20 | } 21 | 22 | - (struct PBGitGraphLine*)lines 23 | { 24 | return lines; 25 | } 26 | 27 | - (void)setLines:(struct PBGitGraphLine *)l 28 | { 29 | free(lines); 30 | lines = l; 31 | } 32 | 33 | -(void) dealloc 34 | { 35 | free(lines); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/PBNSURLPathUserDefaultsTransfomer.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBNSURLPathUserDefaultsTransfomer.h 3 | // GitX 4 | // 5 | // Created by Christian Jacobsen on 28/09/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBNSURLPathUserDefaultsTransfomer : NSValueTransformer { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/PBNSURLPathUserDefaultsTransfomer.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBNSURLPathUserDefaultsTransfomer.m 3 | // GitX 4 | // 5 | // Created by Christian Jacobsen on 28/09/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBNSURLPathUserDefaultsTransfomer.h" 10 | 11 | /* 12 | This ValueTransformer is used to store NSURLs in the user defaults system 13 | as strings, without a host part. It is assumed that the path is an absolute 14 | path in the local filesystem. 15 | */ 16 | 17 | @implementation PBNSURLPathUserDefaultsTransfomer 18 | 19 | + (Class)transformedValueClass { 20 | return [NSURL class]; 21 | } 22 | 23 | + (BOOL)allowsReverseTransformation { 24 | return YES; 25 | } 26 | 27 | - (id)transformedValue:(id)value { 28 | if(value == nil) 29 | { 30 | return nil; 31 | } 32 | 33 | return [NSURL URLWithString:value 34 | relativeToURL:[NSURL URLWithString:@"file://localhost/"]]; 35 | } 36 | 37 | - (id)reverseTransformedValue:(id)value { 38 | if(value == nil) 39 | { 40 | return nil; 41 | } 42 | 43 | return [value path]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Classes/PBRefContextDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRefContextDelegate.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 01-11-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | 10 | @class PBGitRef; 11 | @class PBGitCommit; 12 | 13 | 14 | @protocol PBRefContextDelegate 15 | - (NSArray *) menuItemsForRef:(PBGitRef *)ref; 16 | - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; 17 | - (NSArray *)menuItemsForRow:(NSInteger)rowIndex; 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/PBUnsortableTableHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBUnsortableTableHeader.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 03-10-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBUnsortableTableHeader : NSTableHeaderView { 13 | IBOutlet NSArrayController *controller; 14 | int clickCount; 15 | int columnIndex; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/PBUnsortableTableHeader.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBUnsortableTableHeader.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 03-10-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBUnsortableTableHeader.h" 10 | 11 | 12 | @implementation PBUnsortableTableHeader 13 | 14 | - (void)mouseDown:(NSEvent *)theEvent 15 | { 16 | NSPoint location = [self convertPoint:[[self window] mouseLocationOutsideOfEventStream] fromView:[[self window] contentView]]; 17 | int aColumnIndex = [self columnAtPoint:location]; 18 | 19 | // If the user pressed on another column, reset 20 | if (aColumnIndex != columnIndex) 21 | { 22 | clickCount = 1; 23 | columnIndex = aColumnIndex; 24 | [super mouseDown:theEvent]; 25 | return; 26 | } 27 | 28 | // On the third click, reset the sorting and 29 | // Don't pass on the click 30 | if (++clickCount == 3) 31 | { 32 | clickCount = 0; 33 | controller.sortDescriptors = [NSArray array]; 34 | [controller rearrangeObjects]; 35 | return; 36 | } 37 | [super mouseDown:theEvent]; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/RoundedRectangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // RoundedRectangle.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 24-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSBezierPath (RoundedRectangle) 13 | 14 | + (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/RoundedRectangle.m: -------------------------------------------------------------------------------- 1 | // 2 | // RoundedRectangle.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 24-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "RoundedRectangle.h" 10 | 11 | 12 | @implementation NSBezierPath (RoundedRectangle) 13 | + (NSBezierPath *)bezierPathWithRoundedRect: (NSRect) aRect cornerRadius: (double) cRadius 14 | { 15 | double left = aRect.origin.x, bottom = aRect.origin.y, width = aRect.size.width, height = aRect.size.height; 16 | 17 | //now, crop the radius so we don't get weird effects 18 | double lesserDim = width < height ? width : height; 19 | if ( cRadius > lesserDim / 2 ) 20 | { 21 | cRadius = lesserDim / 2; 22 | } 23 | 24 | //these points describe the rectangle as start and stop points of the 25 | //arcs making up its corners --points c, e, & g are implicit endpoints of arcs 26 | //and are unnecessary 27 | NSPoint a = NSMakePoint( 0, cRadius ), b = NSMakePoint( 0, height - cRadius ), 28 | d = NSMakePoint( width - cRadius, height ), f = NSMakePoint( width, cRadius ), 29 | h = NSMakePoint( cRadius, 0 ); 30 | 31 | //these points describe the center points of the corner arcs 32 | NSPoint cA = NSMakePoint( cRadius, height - cRadius ), 33 | cB = NSMakePoint( width - cRadius, height - cRadius ), 34 | cC = NSMakePoint( width - cRadius, cRadius ), 35 | cD = NSMakePoint( cRadius, cRadius ); 36 | 37 | //start 38 | NSBezierPath *bp = [NSBezierPath bezierPath]; 39 | [bp moveToPoint: a ]; 40 | [bp lineToPoint: b ]; 41 | [bp appendBezierPathWithArcWithCenter: cA radius: cRadius startAngle:180 endAngle:90 clockwise: YES]; 42 | [bp lineToPoint: d ]; 43 | [bp appendBezierPathWithArcWithCenter: cB radius: cRadius startAngle:90 endAngle:0 clockwise: YES]; 44 | [bp lineToPoint: f ]; 45 | [bp appendBezierPathWithArcWithCenter: cC radius: cRadius startAngle:0 endAngle:270 clockwise: YES]; 46 | [bp lineToPoint: h ]; 47 | [bp appendBezierPathWithArcWithCenter: cD radius: cRadius startAngle:270 endAngle:180 clockwise: YES]; 48 | [bp closePath]; 49 | 50 | //Transform path to rectangle's origin 51 | NSAffineTransform *transform = [NSAffineTransform transform]; 52 | [transform translateXBy: left yBy: bottom]; 53 | [bp transformUsingAffineTransform: transform]; 54 | 55 | return bp; //it's already been autoreleased 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /Classes/Util/NSApplication+GitXScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSApplication+GitXScripting.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 8/15/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSApplication (GitXScripting) 13 | 14 | - (void)showDiffScriptCommand:(NSScriptCommand *)command; 15 | - (void)initRepositoryScriptCommand:(NSScriptCommand *)command; 16 | - (void)cloneRepositoryScriptCommand:(NSScriptCommand *)command; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/Util/NSFileHandleExt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Extension for NSFileHandle to make it capable of easy network programming 3 | * 4 | * Version 1.0, get the newest from http://michael.stapelberg.de/NSFileHandleExt.php 5 | * 6 | * Copyright 2007 Michael Stapelberg 7 | * 8 | * Distributed under BSD-License, see http://michael.stapelberg.de/BSD.php 9 | * 10 | */ 11 | 12 | #import 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | @interface NSFileHandle(NSFileHandleExt) 19 | -(NSString*)readLine; 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/Util/NSFileHandleExt.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Extension for NSFileHandle to make it capable of easy network programming 3 | * 4 | * Version 1.0, get the newest from http://michael.stapelberg.de/NSFileHandleExt.php 5 | * 6 | * Copyright 2007 Michael Stapelberg 7 | * 8 | * Distributed under BSD-License, see http://michael.stapelberg.de/BSD.php 9 | * 10 | */ 11 | 12 | 13 | #define CONN_TIMEOUT 5 14 | #define BUFFER_SIZE 256 15 | 16 | @implementation NSFileHandle(NSFileHandleExt) 17 | 18 | -(NSString*)readLine { 19 | // If the socket is closed, return an empty string 20 | if ([self fileDescriptor] <= 0) 21 | return @""; 22 | 23 | int fd = [self fileDescriptor]; 24 | 25 | // Allocate BUFFER_SIZE bytes to store the line 26 | int bufferSize = BUFFER_SIZE; 27 | char *buffer = (char*)malloc(bufferSize + 1); 28 | if (buffer == NULL) 29 | [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; 30 | buffer[0] = '\0'; 31 | 32 | int bytesReceived = 0, n = 0; 33 | 34 | while (1) { 35 | n = read(fd, buffer + bytesReceived, 1); 36 | 37 | if (n == 0) 38 | break; 39 | 40 | if (n < 0) { 41 | if (errno == EINTR) 42 | continue; 43 | 44 | free(buffer); 45 | NSString *reason = [NSString stringWithFormat:@"%s:%d: read() error: %s", __PRETTY_FUNCTION__, __LINE__, strerror(errno)]; 46 | [[NSException exceptionWithName:@"Socket error" reason:reason userInfo:nil] raise]; 47 | } 48 | 49 | bytesReceived++; 50 | 51 | if (bytesReceived >= bufferSize) { 52 | // Make buffer bigger 53 | bufferSize += BUFFER_SIZE; 54 | buffer = (char *)reallocf(buffer, bufferSize + 1); 55 | if (buffer == NULL) 56 | [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; 57 | } 58 | 59 | char receivedByte = buffer[bytesReceived-1]; 60 | if (receivedByte == '\n') { 61 | bytesReceived--; 62 | break; 63 | } 64 | 65 | if (receivedByte == '\r') 66 | bytesReceived--; 67 | } 68 | 69 | buffer[bytesReceived] = '\0'; 70 | NSString *retVal = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding]; 71 | if ([retVal length] == 0) 72 | retVal = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; 73 | 74 | free(buffer); 75 | return retVal; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Classes/Util/NSOutlineViewExt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSOutlineViewExit.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/9/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSOutlineView (PBExpandParents) 13 | 14 | - (void)PBExpandItem:(id)item expandParents:(BOOL)expand; 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/Util/NSOutlineViewExt.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSOutlineViewExit.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/9/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "NSOutlineViewExt.h" 10 | 11 | 12 | @implementation NSOutlineView (PBExpandParents) 13 | 14 | - (void)PBExpandItem:(id)item expandParents:(BOOL)expand 15 | { 16 | NSMutableArray *parents = [NSMutableArray array]; 17 | while (item) { 18 | [parents insertObject:item atIndex:0]; 19 | item = [item parent]; 20 | } 21 | 22 | for (id p in parents) 23 | [self expandItem:p]; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/Util/NSString_RegEx.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString_RegEx.h 3 | // 4 | // Created by John R Chang on 2005-11-08. 5 | // This code is Creative Commons Public Domain. You may use it for any purpose whatsoever. 6 | // http://creativecommons.org/licenses/publicdomain/ 7 | // 8 | 9 | #import 10 | 11 | /* 12 | For regular expression help, see re_format(7) man page. 13 | */ 14 | 15 | @interface NSString (RegEx) 16 | 17 | /* 18 | Common are REG_ICASE and REG_NEWLINE. For other possible option flags, 19 | see regex(3) man page. You don't need to specify REG_EXTENDED. 20 | 21 | is the number of subexpressions to match. 22 | Returns an array of strings. The first string is the matching substring, 23 | the remaining are the matching subexpressions, up to nmatch+1 number. 24 | 25 | If nmatch is -1, works like grep. Returns an array containing self if matching. 26 | 27 | Returns nil if regular expression does not match or if an error has occurred. 28 | */ 29 | - (NSArray *) substringsMatchingRegularExpression:(NSString *)pattern count:(int)nmatch 30 | options:(int)options ranges:(NSArray **)ranges error:(NSError **)error; 31 | 32 | - (BOOL) grep:(NSString *)pattern options:(int)options; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/Util/NSString_Truncate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString_Truncate.h 3 | // GitX 4 | // 5 | // Created by Andre Berg on 24.03.10. 6 | // Copyright 2010 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | typedef enum { 23 | PBNSStringTruncateModeCenter = 0, 24 | PBNSStringTruncateModeStart = 1, 25 | PBNSStringTruncateModeEnd = 2 26 | } PBNSStringTruncateMode; 27 | 28 | @interface NSString (PBGitXTruncateExtensions) 29 | 30 | - (NSString *) truncateToLength:(NSUInteger)length mode:(PBNSStringTruncateMode)mode indicator:(NSString *)indicatorString; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/Util/PBEasyFS.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBEasyFS.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 6/17/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBEasyFS : NSObject { 13 | 14 | } 15 | + (NSString*) tmpNameWithSuffix: (NSString*) path; 16 | + (NSString*) tmpDirWithPrefix: (NSString*) path; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/Util/PBEasyFS.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBEasyFS.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 6/17/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBEasyFS.h" 10 | 11 | 12 | @implementation PBEasyFS 13 | 14 | + (NSString*) tmpNameWithSuffix: (NSString*) path 15 | { 16 | NSString* newName = [NSString stringWithFormat: @"%@/XXXXXX%@", NSTemporaryDirectory(), path]; 17 | char *template = (char*) [newName fileSystemRepresentation]; 18 | int fd = mkstemps(template, [path length]); 19 | close(fd); 20 | return [NSString stringWithUTF8String:template]; 21 | } 22 | 23 | + (NSString*) tmpDirWithPrefix: (NSString*) path 24 | { 25 | NSString* newName = [NSString stringWithFormat: @"%@%@.XXXXXX", NSTemporaryDirectory(), path]; 26 | char *template = (char*) [newName fileSystemRepresentation]; 27 | template = mkdtemp(template); 28 | return [NSString stringWithUTF8String:template]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/Util/PBEasyPipe.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBEasyPipe.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 16-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PBEasyPipe: NSObject { 12 | 13 | } 14 | 15 | + (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir GITX_DEPRECATED; 16 | 17 | + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args GITX_DEPRECATED; 18 | + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir GITX_DEPRECATED; 19 | 20 | + (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args GITX_DEPRECATED; 21 | + (NSString*) outputForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir GITX_DEPRECATED; 22 | + (NSString*) outputForCommand:(NSString *) cmd 23 | withArgs:(NSArray *) args 24 | inDir:(NSString *) dir 25 | retValue:(int *) ret GITX_DEPRECATED; 26 | + (NSString*) outputForCommand:(NSString *) cmd 27 | withArgs:(NSArray *) args 28 | inDir:(NSString *) dir 29 | inputString:(NSString *)input 30 | retValue:(int *) ret GITX_DEPRECATED; 31 | + (NSString*) outputForCommand:(NSString *) cmd 32 | withArgs:(NSArray *) args 33 | inDir:(NSString *) dir 34 | byExtendingEnvironment:(NSDictionary *)dict 35 | inputString:(NSString *)input 36 | retValue:(int *) ret GITX_DEPRECATED; 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/Util/RJModalRepoSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // RJModalRepoSheet.h 3 | // GitX 4 | // 5 | // Created by Rowan James on 1/7/12. 6 | // Copyright (c) 2012 Phere Development Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | @class PBGitWindowController; 13 | 14 | @interface RJModalRepoSheet : NSWindowController 15 | 16 | @property (nonatomic, strong) PBGitRepository* repository; 17 | @property (nonatomic, strong) PBGitWindowController* repoWindow; 18 | 19 | - (id) initWithWindowNibName:(NSString *)windowNibName forRepo:(PBGitRepository*)repo; 20 | 21 | - (void) show; 22 | - (void) hide; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/Util/RJModalRepoSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // RJModalRepoSheet.m 3 | // GitX 4 | // 5 | // Created by Rowan James on 1/7/12. 6 | // Copyright (c) 2012 Phere Development Pty. Ltd. All rights reserved. 7 | // 8 | 9 | #import "RJModalRepoSheet.h" 10 | 11 | #import "PBGitRepository.h" 12 | #import "PBGitWindowController.h" 13 | 14 | @implementation RJModalRepoSheet 15 | 16 | @synthesize repository; 17 | @synthesize repoWindow; 18 | 19 | - (id) initWithWindowNibName:(NSString *)windowNibName forRepo:(PBGitRepository*)repo 20 | { 21 | self = [super initWithWindowNibName:windowNibName]; 22 | if (!self) 23 | return nil; 24 | 25 | self.repository = repo; 26 | self.repoWindow = repo.windowController; 27 | 28 | return self; 29 | } 30 | 31 | - (void) show 32 | { 33 | [repoWindow showModalSheet:self]; 34 | } 35 | 36 | - (void) hide 37 | { 38 | [repoWindow hideModalSheet:self]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Classes/Views/GLFileView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GLFileView.h 3 | // GitX 4 | // 5 | // Created by German Laullon on 14/09/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "PBWebController.h" 13 | 14 | @class PBGitHistoryController; 15 | 16 | @interface GLFileView : PBWebController { 17 | IBOutlet PBGitHistoryController* historyController; 18 | IBOutlet MGScopeBar *typeBar; 19 | NSMutableArray *groups; 20 | NSString *logFormat; 21 | IBOutlet NSView *accessoryView; 22 | IBOutlet NSSplitView *fileListSplitView; 23 | } 24 | 25 | - (void)showFile; 26 | - (void)didLoad; 27 | - (NSString *)parseBlame:(NSString *)txt; 28 | - (NSString *)parseHTML:(NSString *)txt; 29 | 30 | @property NSMutableArray *groups; 31 | @property NSString *logFormat; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/Views/GitXTextFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitXTextFieldCell.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 8/27/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol PBRefContextDelegate; 12 | 13 | @interface GitXTextFieldCell : NSTextFieldCell { 14 | IBOutlet id contextMenuDelegate; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Views/GitXTextFieldCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // GitXTextFieldCell.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 8/27/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "GitXTextFieldCell.h" 10 | #import "PBGitCommit.h" 11 | #import "PBRefController.h" 12 | #import "PBRefContextDelegate.h" 13 | 14 | 15 | @implementation GitXTextFieldCell 16 | 17 | - (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView 18 | { 19 | // disables the cell's selection highlight 20 | return nil; 21 | } 22 | 23 | - (NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSTableView *)commitList 24 | { 25 | NSInteger rowIndex = [commitList rowAtPoint:(cellFrame.origin)]; 26 | NSArray *items = [contextMenuDelegate menuItemsForRow:rowIndex]; 27 | if (!items) 28 | return nil; 29 | 30 | NSMenu *menu = [[NSMenu alloc] init]; 31 | [menu setAutoenablesItems:NO]; 32 | for (NSMenuItem *item in items) 33 | [menu addItem:item]; 34 | 35 | return menu; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Views/PBAddRemoteSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBAddRemoteSheet.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/8/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RJModalRepoSheet.h" 12 | @class PBGitRepository; 13 | 14 | @interface PBAddRemoteSheet : RJModalRepoSheet 15 | 16 | - (id) initWithRepository:(PBGitRepository*)repo; 17 | 18 | - (IBAction) browseFolders:(id)sender; 19 | - (IBAction) addRemote:(id)sender; 20 | - (IBAction) showHideHiddenFiles:(id)sender; 21 | - (IBAction) cancelOperation:(id)sender; 22 | 23 | @property (readwrite, weak) IBOutlet NSTextField *remoteName; 24 | @property (readwrite, weak) IBOutlet NSTextField *remoteURL; 25 | @property (readwrite, weak) IBOutlet NSTextField *errorMessage; 26 | 27 | @property (readwrite, strong) NSOpenPanel *browseSheet; 28 | @property (readwrite, strong) IBOutlet NSView *browseAccessoryView; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/Views/PBCloneRepositoryPanel.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCloneRepositoryPanel.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/7/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBCloneRepositoryPanel : NSWindowController { 13 | NSOpenPanel *browseRepositoryPanel; 14 | NSOpenPanel *browseDestinationPanel; 15 | 16 | NSString *path; 17 | BOOL isBare; 18 | } 19 | 20 | + (id) panel; 21 | + (void)beginCloneRepository:(NSString *)repository toURL:(NSURL *)targetURL isBare:(BOOL)bare; 22 | 23 | - (void)showErrorSheet:(NSError *)error; 24 | 25 | - (IBAction) closeCloneRepositoryPanel:(id)sender; 26 | - (IBAction) clone:(id)sender; 27 | - (IBAction) browseRepository:(id)sender; 28 | - (IBAction) showHideHiddenFiles:(id)sender; 29 | - (IBAction) browseDestination:(id)sender; 30 | 31 | @property (nonatomic, weak) IBOutlet NSTextField *repositoryURL; 32 | @property (nonatomic, weak) IBOutlet NSTextField *destinationPath; 33 | @property (nonatomic, weak) IBOutlet NSTextField *errorMessage; 34 | @property (nonatomic, weak) IBOutlet NSView *repositoryAccessoryView; 35 | 36 | @property (assign) BOOL isBare; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Views/PBCollapsibleSplitView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCollapsibleSplitView.h 3 | // GitX 4 | // 5 | // This is a limited subclass of a SplitView. It adds methods to aid in 6 | // collapsing/uncollapsing subviews using the mouse or programmatically. 7 | // Right now it only works for vertical layouts and with two subviews. 8 | // 9 | // Created by Johannes Gilger on 6/21/09. 10 | // Copyright 2009 Johannes Gilger. All rights reserved. 11 | // 12 | 13 | #import 14 | #import "PBNiceSplitView.h" 15 | 16 | @interface PBCollapsibleSplitView : PBNiceSplitView { 17 | CGFloat topViewMin; 18 | CGFloat bottomViewMin; 19 | CGFloat splitterPosition; 20 | } 21 | 22 | @property (readonly) CGFloat topViewMin; 23 | @property (readonly) CGFloat bottomViewMin; 24 | 25 | - (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin; 26 | - (void)uncollapse; 27 | - (void)keyDown:(NSEvent *)event; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/Views/PBCollapsibleSplitView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBCollapsibleSplitView.m 3 | // GitX 4 | // 5 | // Created by Johannes Gilger on 6/21/09. 6 | // Copyright 2009 Johannes Gilger. All rights reserved. 7 | // 8 | 9 | #import "PBCollapsibleSplitView.h" 10 | 11 | @implementation PBCollapsibleSplitView 12 | @synthesize topViewMin, bottomViewMin; 13 | 14 | - (void)setTopMin:(CGFloat)topMin andBottomMin:(CGFloat)bottomMin { 15 | topViewMin = topMin; 16 | bottomViewMin = bottomMin; 17 | } 18 | 19 | - (void)uncollapse { 20 | for (NSView *subview in [self subviews]) { 21 | if([self isSubviewCollapsed:subview]) { 22 | [self setPosition:[self frame].size.height / 3 ofDividerAtIndex:0]; 23 | [self adjustSubviews]; 24 | } 25 | } 26 | } 27 | 28 | - (void)collapseSubview:(NSInteger)index { 29 | // Already collapsed, just uncollapse 30 | if ([self isSubviewCollapsed:[[self subviews] objectAtIndex:index]]) { 31 | [self setPosition:splitterPosition ofDividerAtIndex:0]; 32 | return; 33 | } 34 | 35 | // Store splitterposition if the other view isn't collapsed 36 | if (![self isSubviewCollapsed:[[self subviews] objectAtIndex:(index + 1) % 2]]) 37 | splitterPosition = [[[self subviews] objectAtIndex:0] frame].size.height; 38 | 39 | if (index == 0) // Top view 40 | [self setPosition:0.0 ofDividerAtIndex:0]; 41 | else // Bottom view 42 | [self setPosition:[self frame].size.height ofDividerAtIndex:0]; 43 | } 44 | 45 | - (void)keyDown:(NSEvent *)event { 46 | if (!([event modifierFlags] & NSShiftKeyMask && [event modifierFlags] & NSCommandKeyMask)) 47 | return [super keyDown:event]; 48 | 49 | if ([event keyCode] == 0x07E) { // Up-Key 50 | [self collapseSubview:0]; 51 | [[self window] makeFirstResponder:[[self subviews] objectAtIndex:1]]; 52 | } else if ([event keyCode] == 0x07D) { // Down-Key 53 | [self collapseSubview:1]; 54 | [[self window] makeFirstResponder:[[self subviews] objectAtIndex:0]]; 55 | } 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /Classes/Views/PBCommitHookFailedSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCommitHookFailedSheet.h 3 | // GitX 4 | // 5 | // Created by Sebastian Staudt on 9/12/10. 6 | // Copyright 2010 Sebastian Staudt. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "PBGitCommitController.h" 12 | #import "PBGitXMessageSheet.h" 13 | 14 | 15 | @interface PBCommitHookFailedSheet : PBGitXMessageSheet 16 | {} 17 | 18 | + (void)beginWithMessageText:(NSString *)message 19 | infoText:(NSString *)info 20 | commitController:(PBGitCommitController *)controller; 21 | 22 | - (id)initWithWindowNibName:(NSString*)windowNibName 23 | andController:(PBGitCommitController*)controller; 24 | 25 | - (IBAction)forceCommit:(id)sender; 26 | 27 | @property (nonatomic, strong) PBGitCommitController* commitController; 28 | 29 | @end -------------------------------------------------------------------------------- /Classes/Views/PBCommitHookFailedSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBCommitHookFailedSheet.m 3 | // GitX 4 | // 5 | // Created by Sebastian Staudt on 9/12/10. 6 | // Copyright 2010 Sebastian Staudt. All rights reserved. 7 | // 8 | 9 | #import "PBCommitHookFailedSheet.h" 10 | #import "PBGitWindowController.h" 11 | 12 | 13 | @implementation PBCommitHookFailedSheet 14 | 15 | @synthesize commitController; 16 | 17 | #pragma mark - 18 | #pragma mark PBCommitHookFailedSheet 19 | 20 | 21 | + (void)beginWithMessageText:(NSString *)message 22 | infoText:(NSString *)info 23 | commitController:(PBGitCommitController *)controller; 24 | { 25 | PBCommitHookFailedSheet* sheet = [[self alloc] initWithWindowNibName:@"PBCommitHookFailedSheet" 26 | andController:controller]; 27 | [sheet beginMessageSheetWithMessageText:message 28 | infoText:info]; 29 | } 30 | 31 | - (id)initWithWindowNibName:(NSString*)windowNibName 32 | andController:(PBGitCommitController*)controller; 33 | { 34 | self = [self initWithWindowNibName:windowNibName forRepo:controller.repository]; 35 | if (!self) 36 | return nil; 37 | 38 | self.commitController = controller; 39 | 40 | return self; 41 | } 42 | 43 | - (IBAction)forceCommit:(id)sender 44 | { 45 | PBGitCommitController *controller = self.commitController; 46 | [self closeMessageSheet:sender]; 47 | [controller forceCommit:sender]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Classes/Views/PBCommitMessageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCommitMessageView.h 3 | // GitX 4 | // 5 | // Created by Jeff Mesnil on 13/10/08. 6 | // Copyright 2008 Jeff Mesnil (http://jmesnil.net/). All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | 13 | @interface PBCommitMessageView : NSTextView 14 | 15 | @property (nonatomic, strong) PBGitRepository *repository; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Views/PBCreateBranchSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCreateBranchSheet.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/13/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRefish.h" 11 | #import "RJModalRepoSheet.h" 12 | 13 | 14 | @class PBGitRepository; 15 | 16 | 17 | @interface PBCreateBranchSheet : RJModalRepoSheet 18 | 19 | + (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; 20 | 21 | 22 | - (IBAction) createBranch:(id)sender; 23 | - (IBAction) closeCreateBranchSheet:(id)sender; 24 | 25 | 26 | @property (nonatomic, strong) PBGitRepository *repository; 27 | @property (nonatomic, strong) id startRefish; 28 | @property (nonatomic, assign) BOOL shouldCheckoutBranch; 29 | 30 | @property (nonatomic, assign) IBOutlet NSTextField *branchNameField; 31 | @property (nonatomic, assign) IBOutlet NSTextField *errorMessageField; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/Views/PBCreateTagSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBCreateTagSheet.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/18/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "PBGitRefish.h" 12 | #import "RJModalRepoSheet.h" 13 | 14 | @class PBGitRepository; 15 | 16 | 17 | @interface PBCreateTagSheet : RJModalRepoSheet 18 | { 19 | } 20 | 21 | + (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo; 22 | 23 | - (IBAction) createTag:(id)sender; 24 | - (IBAction) closeCreateTagSheet:(id)sender; 25 | 26 | @property (nonatomic, strong) id targetRefish; 27 | 28 | @property (nonatomic, weak) IBOutlet NSTextField *tagNameField; 29 | @property (nonatomic, strong) IBOutlet NSTextView *tagMessageText; 30 | @property (nonatomic, weak) IBOutlet NSTextField *errorMessageField; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/Views/PBCreateTagSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBCreateTagSheet.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/18/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBCreateTagSheet.h" 10 | #import "PBGitRepository.h" 11 | #import "PBGitCommit.h" 12 | #import "PBGitRef.h" 13 | #import "PBGitWindowController.h" 14 | #import "PBGitRevSpecifier.h" 15 | 16 | @interface PBCreateTagSheet () 17 | 18 | - (void) beginCreateTagSheetAtRefish:(id )refish; 19 | 20 | @end 21 | 22 | 23 | @implementation PBCreateTagSheet 24 | 25 | @synthesize repository; 26 | @synthesize targetRefish; 27 | 28 | @synthesize tagNameField; 29 | @synthesize tagMessageText; 30 | @synthesize errorMessageField; 31 | 32 | 33 | 34 | #pragma mark - 35 | #pragma mark PBCreateTagSheet 36 | 37 | + (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo 38 | { 39 | PBCreateTagSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateTagSheet" forRepo:repo]; 40 | [sheet beginCreateTagSheetAtRefish:refish]; 41 | } 42 | 43 | 44 | - (void) beginCreateTagSheetAtRefish:(id )refish 45 | { 46 | self.targetRefish = refish; 47 | 48 | [self window]; 49 | [self.errorMessageField setStringValue:@""]; 50 | 51 | [self show]; 52 | } 53 | 54 | 55 | 56 | #pragma mark IBActions 57 | 58 | - (IBAction) createTag:(id)sender 59 | { 60 | NSString *tagName = [self.tagNameField stringValue]; 61 | [self.errorMessageField setHidden:YES]; 62 | 63 | NSString *refName = [@"refs/tags/" stringByAppendingString:tagName]; 64 | if (![self.repository checkRefFormat:refName]) { 65 | [self.errorMessageField setStringValue:@"Invalid name"]; 66 | [self.errorMessageField setHidden:NO]; 67 | return; 68 | } 69 | 70 | for (PBGitRevSpecifier *rev in self.repository.branches) { 71 | NSString *name = [[rev ref] tagName]; 72 | if ([tagName isEqualToString:name]) { 73 | [self.errorMessageField setStringValue:@"Tag already exists"]; 74 | [self.errorMessageField setHidden:NO]; 75 | return; 76 | } 77 | } 78 | 79 | 80 | NSString *message = [self.tagMessageText string]; 81 | [self.repository createTag:tagName message:message atRefish:self.targetRefish]; 82 | 83 | [self closeCreateTagSheet:sender]; 84 | } 85 | 86 | 87 | - (IBAction) closeCreateTagSheet:(id)sender 88 | { 89 | [self hide]; 90 | } 91 | 92 | 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Classes/Views/PBFileChangesTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBFileChangesTableView.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 09-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBFileChangesTableView : NSTableView { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/Views/PBGitGradientBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitGradientBarView.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/22/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBGitGradientBarView : NSView { 13 | NSGradient *gradient; 14 | } 15 | 16 | - (void) setTopShade:(float)topShade bottomShade:(float)bottomShade; 17 | - (void) setTopColor:(NSColor *)topShade bottomColor:(NSColor *)bottomColor; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Views/PBGitGradientBarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitGradientBarView.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/22/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitGradientBarView.h" 10 | 11 | 12 | 13 | @implementation PBGitGradientBarView 14 | 15 | 16 | - (id) initWithFrame:(NSRect)frame 17 | { 18 | self = [super initWithFrame:frame]; 19 | if (!self) 20 | return nil; 21 | 22 | [self setTopShade:1.0 bottomShade:0.0]; 23 | 24 | return self; 25 | } 26 | 27 | 28 | - (void) drawRect:(NSRect)dirtyRect 29 | { 30 | [gradient drawInRect:[self bounds] angle:90]; 31 | } 32 | 33 | 34 | - (void) setTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor 35 | { 36 | if (!topColor || !bottomColor) 37 | return; 38 | 39 | gradient = [[NSGradient alloc] initWithStartingColor:bottomColor endingColor:topColor]; 40 | [self setNeedsDisplay:YES]; 41 | } 42 | 43 | 44 | - (void) setTopShade:(float)topShade bottomShade:(float)bottomShade 45 | { 46 | NSColor *topColor = [NSColor colorWithCalibratedWhite:topShade alpha:1.0]; 47 | NSColor *bottomColor = [NSColor colorWithCalibratedWhite:bottomShade alpha:1.0]; 48 | [self setTopColor:topColor bottomColor:bottomColor]; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/Views/PBGitRevisionCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRevisionCell.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 17-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitGrapher.h" 11 | #import "PBGraphCellInfo.h" 12 | #import "PBGitHistoryController.h" 13 | #import "PBRefContextDelegate.h" 14 | 15 | @interface PBGitRevisionCell : NSActionCell { 16 | PBGitCommit *objectValue; 17 | PBGraphCellInfo *cellInfo; 18 | NSTextFieldCell *textCell; 19 | IBOutlet PBGitHistoryController *controller; 20 | IBOutlet id contextMenuDelegate; 21 | } 22 | 23 | - (int) indexAtX:(float)x; 24 | - (NSRect) rectAtIndex:(int)index; 25 | - (void) drawLabelAtIndex:(int)index inRect:(NSRect)rect; 26 | 27 | @property PBGitCommit* objectValue; 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/Views/PBGitXMessageSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitXMessageSheet.h 3 | // GitX 4 | // 5 | // Created by BrotherBard on 7/4/10. 6 | // Copyright 2010 BrotherBard. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RJModalRepoSheet.h" 12 | 13 | @interface PBGitXMessageSheet : RJModalRepoSheet 14 | { 15 | NSImageView *iconView; 16 | NSTextField *messageField; 17 | NSTextView *infoView; 18 | NSScrollView *scrollView; 19 | } 20 | 21 | + (void)beginMessageSheetForRepo:(PBGitRepository *)repo 22 | withMessageText:(NSString *)message 23 | infoText:(NSString *)info; 24 | + (void)beginMessageSheetForRepo:(PBGitRepository *)repo 25 | withError:(NSError *)error; 26 | 27 | 28 | - (void)beginMessageSheetWithMessageText:(NSString *)message 29 | infoText:(NSString *)info; 30 | - (IBAction)closeMessageSheet:(id)sender; 31 | 32 | 33 | @property IBOutlet NSImageView *iconView; 34 | @property IBOutlet NSTextField *messageField; 35 | @property IBOutlet NSTextView *infoView; 36 | @property IBOutlet NSScrollView *scrollView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Views/PBIconAndTextCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBIconAndTextCell.h 3 | // GitX 4 | // 5 | // Created by Ciarán Walsh on 23/09/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBIconAndTextCell : NSTextFieldCell 13 | { 14 | BOOL mouseDownInButton; 15 | BOOL mouseHoveredInButton; 16 | } 17 | @property NSImage *image; 18 | 19 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; 20 | - (NSSize)cellSize; 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/Views/PBNiceSplitView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBNiceSplitView.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 31-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PBNiceSplitView : NSSplitView { 12 | 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/Views/PBNiceSplitView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBNiceSplitView.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 31-10-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import "PBNiceSplitView.h" 10 | 11 | static NSImage *bar; 12 | static NSImage *grip; 13 | 14 | @implementation PBNiceSplitView 15 | 16 | +(void) initialize 17 | { 18 | NSString *barPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterBar" ofType:@"tiff"]; 19 | bar = [[NSImage alloc] initWithContentsOfFile: barPath]; 20 | [bar setFlipped: YES]; 21 | 22 | NSString *gripPath = [[NSBundle mainBundle] pathForResource:@"mainSplitterDimple" ofType:@"tiff"]; 23 | grip = [[NSImage alloc] initWithContentsOfFile: gripPath]; 24 | [grip setFlipped: YES]; 25 | } 26 | 27 | - (void)drawDividerInRect:(NSRect)aRect 28 | { 29 | // Draw bar and grip onto the canvas 30 | NSRect gripRect = aRect; 31 | gripRect.origin.x = (NSMidX(aRect) - ([grip size].width/2)); 32 | gripRect.size.width = 8; 33 | 34 | [self lockFocus]; 35 | [bar drawInRect:aRect fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; 36 | [grip drawInRect:gripRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; 37 | [self unlockFocus]; 38 | } 39 | 40 | - (CGFloat)dividerThickness 41 | { 42 | return 10.0; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/Views/PBQLOutlineView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBQLOutlineView.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 6/17/08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitHistoryController.h" 11 | 12 | @interface PBQLOutlineView : NSOutlineView { 13 | IBOutlet PBGitHistoryController* controller; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/Views/PBQLTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBQLTextView.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/22/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class PBGitHistoryController; 13 | 14 | 15 | @interface PBQLTextView : NSTextView { 16 | IBOutlet PBGitHistoryController *controller; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Views/PBQLTextView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBQLTextView.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/22/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBQLTextView.h" 10 | #import "PBGitHistoryController.h" 11 | 12 | 13 | @implementation PBQLTextView 14 | 15 | - (void) keyDown: (NSEvent *) event 16 | { 17 | if ([[event characters] isEqualToString:@" "]) { 18 | [controller toggleQLPreviewPanel:self]; 19 | return; 20 | } 21 | 22 | [super keyDown:event]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/Views/PBRefMenuItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRefMenuItem.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 01-11-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRef.h" 11 | #import "PBGitCommit.h" 12 | 13 | @interface PBRefMenuItem : NSMenuItem { 14 | id refish; 15 | } 16 | 17 | @property id refish; 18 | 19 | + (PBRefMenuItem *) separatorItem; 20 | + (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitRepository *)repo target:(id)target; 21 | + (NSArray *) defaultMenuItemsForCommit:(PBGitCommit *)commit target:(id)target; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/Views/PBRemoteProgressSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRemoteProgressSheetController.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/6/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RJModalRepoSheet.h" 12 | 13 | extern NSString * const kGitXProgressDescription; 14 | extern NSString * const kGitXProgressSuccessDescription; 15 | extern NSString * const kGitXProgressSuccessInfo; 16 | extern NSString * const kGitXProgressErrorDescription; 17 | extern NSString * const kGitXProgressErrorInfo; 18 | 19 | @class PBGitWindowController; 20 | @class PBGitRepository; 21 | 22 | @interface PBRemoteProgressSheet : RJModalRepoSheet { 23 | NSArray *arguments; 24 | NSString *title; 25 | NSString *description; 26 | bool hideSuccessScreen; 27 | 28 | NSTask *gitTask; 29 | NSInteger returnCode; 30 | 31 | NSTextField *progressDescription; 32 | NSProgressIndicator *progressIndicator; 33 | 34 | NSTimer *taskTimer; 35 | } 36 | 37 | + (void) beginRemoteProgressSheetForArguments:(NSArray *)args 38 | title:(NSString *)theTitle 39 | description:(NSString *)theDescription 40 | inDir:(NSString *)dir 41 | windowController:(PBGitWindowController *)windowController; 42 | + (void) beginRemoteProgressSheetForArguments:(NSArray *)args 43 | title:(NSString *)theTitle 44 | description:(NSString *)theDescription 45 | inDir:(NSString *)dir 46 | windowController:(PBGitWindowController *)windowController 47 | hideSuccessScreen:(bool)hideSucc; 48 | 49 | + (void) beginRemoteProgressSheetForArguments:(NSArray *)args 50 | title:(NSString *)theTitle 51 | description:(NSString *)theDescription 52 | inRepository:(PBGitRepository *)repo; 53 | + (void) beginRemoteProgressSheetForArguments:(NSArray *)args 54 | title:(NSString *)theTitle 55 | description:(NSString *)theDescription 56 | inRepository:(PBGitRepository *)repo 57 | hideSuccessScreen:(bool)hideSucc; 58 | 59 | @property IBOutlet NSTextField *progressDescription; 60 | @property IBOutlet NSProgressIndicator *progressIndicator; 61 | 62 | @end -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewAction.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBSourceViewAction : PBSourceViewItem { 13 | NSImage *icon; 14 | } 15 | 16 | @property(retain) NSImage *icon; 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewAction.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewAction.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBSourceViewAction.h" 10 | 11 | 12 | @implementation PBSourceViewAction 13 | @synthesize icon; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewBadge.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewBadge.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/13/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBSourceViewBadge : NSObject { 13 | 14 | } 15 | 16 | + (NSImage *) checkedOutBadgeForCell:(NSTextFieldCell *)cell; 17 | + (NSImage *) numericBadge:(NSInteger)number forCell:(NSTextFieldCell *)cell; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewCell.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 1/7/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBIconAndTextCell.h" 11 | 12 | 13 | @interface PBSourceViewCell : PBIconAndTextCell { 14 | BOOL isCheckedOut; 15 | } 16 | 17 | @property (assign) BOOL isCheckedOut; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewCell.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 1/7/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBSourceViewCell.h" 10 | #import "PBGitSidebarController.h" 11 | #import "PBSourceViewBadge.h" 12 | 13 | 14 | 15 | 16 | @implementation PBSourceViewCell 17 | 18 | @synthesize isCheckedOut; 19 | 20 | # pragma mark context menu delegate methods 21 | 22 | - (NSMenu *) menuForEvent:(NSEvent *)event inRect:(NSRect)rect ofView:(NSOutlineView *)view 23 | { 24 | NSPoint point = [view convertPoint:[event locationInWindow] fromView:nil]; 25 | NSInteger row = [view rowAtPoint:point]; 26 | 27 | PBGitSidebarController *controller = (PBGitSidebarController*)[view delegate]; 28 | 29 | return [controller menuForRow:row]; 30 | } 31 | 32 | 33 | #pragma mark drawing 34 | 35 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)outlineView 36 | { 37 | if (isCheckedOut) { 38 | NSImage *checkedOutImage = [PBSourceViewBadge checkedOutBadgeForCell:self]; 39 | NSSize imageSize = [checkedOutImage size]; 40 | NSRect imageFrame; 41 | NSDivideRect(cellFrame, &imageFrame, &cellFrame, imageSize.width + 3, NSMaxXEdge); 42 | imageFrame.size = imageSize; 43 | 44 | // center the decal verctically 45 | imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2); 46 | 47 | [checkedOutImage drawInRect:imageFrame 48 | fromRect:NSZeroRect 49 | operation:NSCompositeSourceOver 50 | fraction:1.0f 51 | respectFlipped:YES 52 | hints:nil]; 53 | } 54 | 55 | [super drawWithFrame:cellFrame inView:outlineView]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewItem.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRevSpecifier; 12 | @class PBGitRef; 13 | 14 | @interface PBSourceViewItem : NSObject { 15 | NSMutableOrderedSet *childrenSet; 16 | 17 | NSString *title; 18 | PBGitRevSpecifier *revSpecifier; 19 | 20 | BOOL isGroupItem; 21 | BOOL isUncollapsible; 22 | } 23 | 24 | + (id)groupItemWithTitle:(NSString *)title; 25 | + (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; 26 | + (id)itemWithTitle:(NSString *)title; 27 | 28 | - (void)addChild:(PBSourceViewItem *)child; 29 | - (void)removeChild:(PBSourceViewItem *)child; 30 | - (NSImage*)iconNamed:(NSString*)name; 31 | 32 | // This adds the ref to the path, which should match the item's title, 33 | // so "refs/heads/pu/pb/sidebar" would have the path [@"pu", @"pb", @"sidebare"] 34 | // to the 'local' branch thing 35 | - (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; 36 | - (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev; 37 | 38 | - (PBGitRef *) ref; 39 | 40 | @property NSString *title; 41 | @property(nonatomic, readonly) NSArray *sortedChildren; 42 | @property(assign) BOOL isGroupItem, isUncollapsible, isExpanded; 43 | @property PBGitRevSpecifier *revSpecifier; 44 | @property (assign)PBSourceViewItem *parent; 45 | @property(readonly) NSString *iconName; 46 | @property(readonly) NSImage *icon; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewItems.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewItems.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBSourceViewItem.h" 10 | 11 | #import "PBGitSVStageItem.h" 12 | 13 | #import "PBGitRevSpecifier.h" 14 | #import "PBGitSVBranchItem.h" 15 | #import "PBGitSVRemoteItem.h" 16 | #import "PBGitSVRemoteBranchItem.h" 17 | #import "PBGitSVTagItem.h" 18 | #import "PBGitSVOtherRevItem.h" 19 | #import "PBGitSVFolderItem.h" 20 | #import "PBGitSVSubmoduleItem.h" -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewRemote.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewRemote.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBSourceViewRemote : PBSourceViewItem { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/Views/PBSourceViewRemote.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewRemote.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/8/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBSourceViewRemote.h" 10 | 11 | 12 | @implementation PBSourceViewRemote 13 | 14 | - (NSImage *)icon 15 | { 16 | return [NSImage imageNamed:@"remote"]; 17 | } 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/GTOID+JavaScript.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTOID+JavaScript.h 3 | // GitX 4 | // 5 | // Created by Sven Weidauer on 18.05.14. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface GTOID (JavaScript) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/git/GTOID+JavaScript.m: -------------------------------------------------------------------------------- 1 | // 2 | // GTOID+JavaScript.m 3 | // GitX 4 | // 5 | // Created by Sven Weidauer on 18.05.14. 6 | // 7 | // 8 | 9 | #import "GTOID+JavaScript.h" 10 | 11 | @implementation GTOID (JavaScript) 12 | 13 | + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector 14 | { 15 | return NO; 16 | } 17 | 18 | + (BOOL)isKeyExcludedFromWebScript:(const char *)name { 19 | return NO; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/git/GitRepoFinder.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitRepoFinder.h 3 | // GitX 4 | // 5 | // Created by Rowan James on 13/11/2012. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface GitRepoFinder : NSObject 12 | 13 | + (NSURL*)workDirForURL:(NSURL*)fileURL; 14 | + (NSURL*)gitDirForURL:(NSURL*)fileURL; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/git/GitRepoFinder.m: -------------------------------------------------------------------------------- 1 | // 2 | // GitRepoFinder.m 3 | // GitX 4 | // 5 | // Created by Rowan James on 13/11/2012. 6 | // 7 | // 8 | 9 | #import "GitRepoFinder.h" 10 | 11 | @implementation GitRepoFinder 12 | 13 | + (NSURL*)workDirForURL:(NSURL*)fileURL; 14 | { 15 | if (!fileURL.isFileURL) 16 | { 17 | return nil; 18 | } 19 | git_repository* repo = nil; 20 | git_repository_open_ext(&repo, fileURL.path.UTF8String, GIT_REPOSITORY_OPEN_CROSS_FS, NULL); 21 | if (!repo) 22 | { 23 | return nil; 24 | } 25 | const char* workdir = git_repository_workdir(repo); 26 | NSURL* result = nil; 27 | if (workdir) 28 | { 29 | result = [NSURL fileURLWithPath:[NSString stringWithUTF8String:workdir]]; 30 | } 31 | git_repository_free(repo); repo = nil; 32 | return result; 33 | } 34 | 35 | + (NSURL *)gitDirForURL:(NSURL *)fileURL 36 | { 37 | if (!fileURL.isFileURL) 38 | { 39 | return nil; 40 | } 41 | git_buf path_buffer = {NULL, 0, 0}; 42 | int gitResult = git_repository_discover(&path_buffer, 43 | [fileURL.path UTF8String], 44 | GIT_REPOSITORY_OPEN_CROSS_FS, 45 | nil); 46 | 47 | NSData *repoPathBuffer = nil; 48 | if (path_buffer.ptr) { 49 | repoPathBuffer = [NSData dataWithBytes:path_buffer.ptr length:path_buffer.asize]; 50 | git_buf_free(&path_buffer); 51 | } 52 | 53 | if (gitResult == GIT_OK && repoPathBuffer.length) 54 | { 55 | NSString* repoPath = [NSString stringWithUTF8String:repoPathBuffer.bytes]; 56 | BOOL isDirectory; 57 | if ([[NSFileManager defaultManager] fileExistsAtPath:repoPath 58 | isDirectory:&isDirectory] && isDirectory) 59 | { 60 | NSURL* result = [NSURL fileURLWithPath:repoPath 61 | isDirectory:isDirectory]; 62 | return result; 63 | } 64 | } 65 | return nil; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Classes/git/PBGitBinary.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitBinary.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 04-10-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define MIN_GIT_VERSION "1.6.0" 12 | 13 | @interface PBGitBinary : NSObject { 14 | 15 | } 16 | 17 | + (NSString *) path; 18 | + (NSString *) version; 19 | + (NSArray *) searchLocations; 20 | + (NSString *) notFoundError; 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/git/PBGitCommit.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitCommit.h 3 | // GitTest 4 | // 5 | // Created by Pieter de Bie on 13-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRefish.h" // for @protocol PBGitRefish 11 | 12 | @class PBGitRepository; 13 | @class PBGitTree; 14 | @class PBGitRef; 15 | @class PBGraphCellInfo; 16 | 17 | extern NSString * const kGitXCommitType; 18 | 19 | 20 | @interface PBGitCommit : NSObject 21 | 22 | @property (nonatomic, weak, readonly) PBGitRepository* repository; 23 | 24 | @property (nonatomic, strong, readonly) GTOID *sha; 25 | 26 | @property (nonatomic, strong, readonly) NSDate *date; 27 | @property (nonatomic, strong, readonly) NSString *subject; 28 | @property (nonatomic, strong, readonly) NSString *author; 29 | @property (nonatomic, strong, readonly) NSString *committer; 30 | @property (nonatomic, strong, readonly) NSString *details; 31 | @property (nonatomic, strong, readonly) NSString *patch; 32 | @property (nonatomic, strong, readonly) NSString *realSHA; 33 | @property (nonatomic, strong, readonly) NSString *SVNRevision; 34 | 35 | @property (nonatomic, strong, readonly) NSArray *parents; 36 | @property NSMutableArray* refs; 37 | 38 | @property (nonatomic, assign) char sign; 39 | @property (nonatomic, strong) PBGraphCellInfo *lineInfo; 40 | 41 | @property (nonatomic, readonly) PBGitTree* tree; 42 | @property (readonly) NSArray* treeContents; 43 | 44 | 45 | - (id)initWithRepository:(PBGitRepository *)repo andCommit:(GTCommit *)gtCommit; 46 | 47 | - (void) addRef:(PBGitRef *)ref; 48 | - (void) removeRef:(id)ref; 49 | - (BOOL) hasRef:(PBGitRef *)ref; 50 | 51 | - (NSString *)realSha; 52 | - (BOOL) isOnSameBranchAs:(PBGitCommit *)other; 53 | - (BOOL) isOnHeadBranch; 54 | 55 | // 56 | - (NSString *) refishName; 57 | - (NSString *) shortName; 58 | - (NSString *) refishType; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Classes/git/PBGitDefaults.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitDefaults.h 3 | // GitX 4 | // 5 | // Created by Jeff Mesnil on 19/10/08. 6 | // Copyright 2008 Jeff Mesnil (http://jmesnil.net/). All rights reserved. 7 | // 8 | 9 | @interface PBGitDefaults : NSObject 10 | { 11 | 12 | } 13 | 14 | + (int) commitMessageViewVerticalLineLength; 15 | + (int) commitMessageViewVerticalBodyLineLength; 16 | + (BOOL) commitMessageViewHasVerticalLine; 17 | + (BOOL) isGistEnabled; 18 | + (BOOL) isGravatarEnabled; 19 | + (BOOL) confirmPublicGists; 20 | + (BOOL) isGistPublic; 21 | + (BOOL)showWhitespaceDifferences; 22 | + (BOOL) shouldCheckoutBranch; 23 | + (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; 24 | + (NSString *) recentCloneDestination; 25 | + (void) setRecentCloneDestination:(NSString *)path; 26 | + (BOOL) showStageView; 27 | + (void) setShowStageView:(BOOL)suppress; 28 | + (NSInteger) branchFilter; 29 | + (void) setBranchFilter:(NSInteger)state; 30 | + (NSInteger)historySearchMode; 31 | + (void)setHistorySearchMode:(NSInteger)mode; 32 | + (BOOL)useRepositoryWatcher; 33 | 34 | 35 | // Suppressed Dialog Warnings 36 | + (void)suppressDialogWarningForDialog:(NSString *)dialog; 37 | + (BOOL)isDialogWarningSuppressedForDialog:(NSString *)dialog; 38 | + (void)resetAllDialogWarnings; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/git/PBGitGraphLine.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBLine.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | struct PBGitGraphLine 10 | { 11 | int upper : 1; 12 | int from : 8; 13 | int to : 8; 14 | int colorIndex : 8; 15 | }; 16 | -------------------------------------------------------------------------------- /Classes/git/PBGitGraphLine.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBLine.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBGitGraphLine.h" 10 | 11 | /* 12 | @implementation PBGitGraphLine 13 | @synthesize upper, from, to, colorIndex; 14 | - (id)initWithUpper: (char) u From: (char) f to: (char) t color: (char) c; 15 | { 16 | upper = u; 17 | from = f; 18 | to = t; 19 | colorIndex = c; 20 | return self; 21 | } 22 | 23 | + (PBGitGraphLine*) lowerLineFrom:(char) f to: (char) t color: (char) c 24 | { 25 | return [[PBGitGraphLine alloc] initWithUpper:0 From:f to:t color:c]; 26 | } 27 | 28 | + (PBGitGraphLine*) upperLineFrom:(char) f to: (char) t color: (char) c 29 | { 30 | return [[PBGitGraphLine alloc] initWithUpper:1 From:f to:t color: c]; 31 | } 32 | @end */ 33 | -------------------------------------------------------------------------------- /Classes/git/PBGitGrapher.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitGrapher.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 17-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | @class PBGitRepository; 10 | @class PBGitCommit; 11 | 12 | @interface PBGitGrapher : NSObject 13 | 14 | - (id) initWithRepository:(PBGitRepository *)repo; 15 | - (void) decorateCommit:(PBGitCommit *)commit; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/git/PBGitHistoryGrapher.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitHistoryGrapher.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/20/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | #define kCurrentQueueKey @"kCurrentQueueKey" 13 | #define kNewCommitsKey @"kNewCommitsKey" 14 | 15 | 16 | @class PBGitGrapher; 17 | 18 | 19 | @interface PBGitHistoryGrapher : NSObject { 20 | id delegate; 21 | NSOperationQueue *currentQueue; 22 | 23 | NSMutableSet *searchSHAs; 24 | PBGitGrapher *grapher; 25 | BOOL viewAllBranches; 26 | } 27 | 28 | - (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll queue:(NSOperationQueue *)queue delegate:(id)theDelegate; 29 | - (void) graphCommits:(NSArray *)revList; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/git/PBGitHistoryList.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitHistoryList.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 2/20/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @class PBGitRepository; 13 | @class PBGitRevSpecifier; 14 | @class PBGitRef; 15 | @class PBGitRevList; 16 | @class PBGitHistoryGrapher; 17 | @class GTOID; 18 | 19 | @interface PBGitHistoryList : NSObject { 20 | __weak PBGitRepository *repository; 21 | 22 | PBGitRevList *projectRevList; 23 | PBGitRevList *currentRevList; 24 | 25 | GTOID *lastSHA; 26 | NSSet *lastRefSHAs; 27 | NSInteger lastBranchFilter; 28 | PBGitRef *lastRemoteRef; 29 | BOOL resetCommits; 30 | BOOL shouldReloadProjectHistory; 31 | 32 | PBGitHistoryGrapher *grapher; 33 | NSOperationQueue *graphQueue; 34 | 35 | NSMutableArray *commits; 36 | BOOL isUpdating; 37 | } 38 | 39 | - (id) initWithRepository:(PBGitRepository *)repo; 40 | - (void) forceUpdate; 41 | - (void) updateHistory; 42 | - (void)cleanup; 43 | 44 | - (void) updateCommitsFromGrapher:(NSDictionary *)commitData; 45 | 46 | 47 | @property PBGitRevList *projectRevList; 48 | @property NSMutableArray *commits; 49 | @property (readonly) NSArray *projectCommits; 50 | @property (assign) BOOL isUpdating; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/git/PBGitLane.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitLane.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | class PBGitLane { 12 | git_oid d_sha; 13 | int d_index; 14 | 15 | public: 16 | 17 | PBGitLane(const git_oid *sha) 18 | { 19 | d_sha = *sha; 20 | } 21 | 22 | PBGitLane(int index, const git_oid *sha) 23 | : d_index(index) 24 | { 25 | git_oid_cpy(&d_sha, sha); 26 | } 27 | 28 | bool isCommit(const git_oid *sha) const 29 | { 30 | return !git_oid_cmp(&d_sha, sha); 31 | } 32 | 33 | void setSha(const git_oid *sha); 34 | 35 | git_oid const *sha() const 36 | { 37 | return &d_sha; 38 | } 39 | 40 | int index() const; 41 | }; -------------------------------------------------------------------------------- /Classes/git/PBGitLane.mm: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitLane.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 27-08-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBGitLane.h" 10 | 11 | int PBGitLane::index() const 12 | { 13 | return d_index; 14 | } 15 | 16 | void PBGitLane::setSha(const git_oid *sha) 17 | { 18 | d_sha = *sha; 19 | } 20 | -------------------------------------------------------------------------------- /Classes/git/PBGitRef.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRef.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 06-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBGitRefish.h" 11 | 12 | extern NSString * const kGitXTagType; 13 | extern NSString * const kGitXBranchType; 14 | extern NSString * const kGitXRemoteType; 15 | extern NSString * const kGitXRemoteBranchType; 16 | 17 | extern NSString * const kGitXTagRefPrefix; 18 | extern NSString * const kGitXBranchRefPrefix; 19 | extern NSString * const kGitXRemoteRefPrefix; 20 | 21 | 22 | @interface PBGitRef : NSObject 23 | 24 | // 25 | - (NSString *) refishName; 26 | - (NSString *) shortName; 27 | - (NSString *) refishType; 28 | 29 | - (NSString *) tagName; 30 | - (NSString *) branchName; 31 | - (NSString *) remoteName; 32 | - (NSString *) remoteBranchName; 33 | 34 | - (NSString *) type; 35 | - (BOOL) isBranch; 36 | - (BOOL) isTag; 37 | - (BOOL) isRemote; 38 | - (BOOL) isRemoteBranch; 39 | 40 | - (PBGitRef *) remoteRef; 41 | 42 | - (BOOL) isEqualToRef:(PBGitRef *)otherRef; 43 | 44 | + (PBGitRef*) refFromString: (NSString*) s; 45 | - (PBGitRef*) initWithString: (NSString*) s; 46 | 47 | @property(nonatomic, strong, readonly) NSString* ref; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/git/PBGitRefish.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRefish.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 12/25/09. 6 | // Copyright 2009 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | // Several git commands can take a ref "refs/heads/master" or an SHA. 13 | // Use to accept a PBGitRef or a PBGitCommit without having to write 14 | // two separate methods. 15 | // 16 | // refishName the full name of the ref "refs/heads/master" or the full SHA 17 | // used in git commands 18 | // shortName a more user friendly version of the refName, "master" or a short SHA 19 | // refishType a short name for the type 20 | 21 | @protocol PBGitRefish 22 | 23 | - (NSString *) refishName; 24 | - (NSString *) shortName; 25 | - (NSString *) refishType; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/git/PBGitRepositoryWatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitHistoryWatcher.h 3 | // GitX 4 | // 5 | // Watches a specified path 6 | // 7 | // Created by Dave Grijalva on 1/26/09. 8 | // Copyright 2009 __MyCompanyName__. All rights reserved. 9 | // 10 | 11 | #import 12 | @class PBGitRepository; 13 | 14 | typedef UInt32 PBGitRepositoryWatcherEventType; 15 | enum { 16 | PBGitRepositoryWatcherEventTypeNone = 0x00000000, 17 | PBGitRepositoryWatcherEventTypeGitDirectory = 0x00000001, 18 | PBGitRepositoryWatcherEventTypeWorkingDirectory = 0x00000002, 19 | PBGitRepositoryWatcherEventTypeIndex = 0x00000004 20 | }; 21 | 22 | extern NSString *PBGitRepositoryEventNotification; 23 | extern NSString *kPBGitRepositoryEventTypeUserInfoKey; 24 | extern NSString *kPBGitRepositoryEventPathsUserInfoKey; 25 | 26 | typedef void(^PBGitRepositoryWatcherCallbackBlock)(NSArray *changedFiles); 27 | 28 | @interface PBGitRepositoryWatcher : NSObject { 29 | FSEventStreamRef gitDirEventStream; 30 | FSEventStreamRef workDirEventStream; 31 | PBGitRepositoryWatcherCallbackBlock gitDirChangedBlock; 32 | PBGitRepositoryWatcherCallbackBlock workDirChangedBlock; 33 | NSDate *gitDirTouchDate; 34 | NSDate *indexTouchDate; 35 | 36 | NSString *gitDir; 37 | NSString *workDir; 38 | 39 | __strong PBGitRepositoryWatcher* ownRef; 40 | BOOL _running; 41 | } 42 | 43 | @property (readonly, weak) PBGitRepository *repository; 44 | 45 | - (id) initWithRepository:(PBGitRepository *)repository; 46 | - (void) start; 47 | - (void) stop; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/git/PBGitRepositoryWatcherEventPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRepositoryWatcherEventPath.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/6/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface PBGitRepositoryWatcherEventPath : NSObject 13 | { 14 | NSString *path; 15 | FSEventStreamEventFlags flag; 16 | } 17 | 18 | @property NSString *path; 19 | @property (assign) FSEventStreamEventFlags flag; 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/git/PBGitRepositoryWatcherEventPath.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRepositoryWatcherEventPath.m 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/6/09. 6 | // Copyright 2009 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "PBGitRepositoryWatcherEventPath.h" 10 | 11 | 12 | @implementation PBGitRepositoryWatcherEventPath 13 | @synthesize path, flag; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/git/PBGitRevList.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRevList.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 17-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | @class PBGitRevSpecifier; 13 | 14 | @interface PBGitRevList : NSObject 15 | 16 | @property (nonatomic, assign) BOOL isParsing; 17 | @property (nonatomic, strong) NSMutableArray *commits; 18 | 19 | - (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph; 20 | - (void) loadRevisons; 21 | - (void)cancel; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/git/PBGitRevSpecifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRevSpecifier.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 12-09-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | @class PBGitRef; 11 | 12 | @interface PBGitRevSpecifier : NSObject { 13 | NSString *description; 14 | NSArray *parameters; 15 | NSURL *workingDirectory; 16 | BOOL isSimpleRef; 17 | } 18 | 19 | - (id) initWithParameters:(NSArray *)params description:(NSString *)descrip; 20 | - (id) initWithParameters:(NSArray*) params; 21 | - (id) initWithRef: (PBGitRef*) ref; 22 | 23 | - (NSString*) simpleRef; 24 | - (PBGitRef *) ref; 25 | - (BOOL) hasPathLimiter; 26 | - (NSString *) title; 27 | 28 | - (BOOL) isEqual: (PBGitRevSpecifier*) other; 29 | - (BOOL) isAllBranchesRev; 30 | - (BOOL) isLocalBranchesRev; 31 | 32 | + (PBGitRevSpecifier *)allBranchesRevSpec; 33 | + (PBGitRevSpecifier *)localBranchesRevSpec; 34 | 35 | @property(retain) NSString *description; 36 | @property(readonly) NSArray *parameters; 37 | @property(retain) NSURL *workingDirectory; 38 | @property(readonly) BOOL isSimpleRef; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVBranchItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVBranchItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVBranchItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVBranchItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVBranchItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVBranchItem.h" 10 | #import "PBGitRevSpecifier.h" 11 | 12 | @implementation PBGitSVBranchItem 13 | 14 | 15 | + (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier 16 | { 17 | PBGitSVBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; 18 | item.revSpecifier = revSpecifier; 19 | 20 | return item; 21 | } 22 | 23 | 24 | - (NSString*) iconName 25 | { 26 | return @"BranchTemplate"; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVFolderItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVFolderItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVFolderItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)folderItemWithTitle:(NSString *)title; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVFolderItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVFolderItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVFolderItem.h" 10 | 11 | 12 | @implementation PBGitSVFolderItem 13 | 14 | + (id)folderItemWithTitle:(NSString *)title 15 | { 16 | PBGitSVFolderItem *item = [self itemWithTitle:title]; 17 | 18 | return item; 19 | } 20 | 21 | - (NSString*) iconName 22 | { 23 | return (self.isExpanded) ? @"FolderTemplate" : @"FolderClosedTemplate"; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVOtherRevItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVOtherRevItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVOtherRevItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVOtherRevItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVOtherRevItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVOtherRevItem.h" 10 | #import "PBGitRevSpecifier.h" 11 | 12 | 13 | @implementation PBGitSVOtherRevItem 14 | 15 | 16 | + (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier 17 | { 18 | PBGitSVOtherRevItem *item = [self itemWithTitle:[revSpecifier title]]; 19 | item.revSpecifier = revSpecifier; 20 | 21 | return item; 22 | } 23 | 24 | - (NSString*) iconName 25 | { 26 | return @"BranchTemplate"; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVRemoteBranchItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVRemoteBranchItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVRemoteBranchItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVRemoteBranchItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVRemoteBranchItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVRemoteBranchItem.h" 10 | #import "PBGitRevSpecifier.h" 11 | 12 | @implementation PBGitSVRemoteBranchItem 13 | 14 | 15 | + (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier 16 | { 17 | PBGitSVRemoteBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; 18 | item.revSpecifier = revSpecifier; 19 | 20 | return item; 21 | } 22 | 23 | - (NSString*) iconName 24 | { 25 | return @"RemoteBranchTemplate"; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVRemoteItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVRemoteItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVRemoteItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)remoteItemWithTitle:(NSString *)title; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVRemoteItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVRemoteItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVRemoteItem.h" 10 | #import "PBGitRef.h" 11 | 12 | 13 | @implementation PBGitSVRemoteItem 14 | 15 | 16 | + (id)remoteItemWithTitle:(NSString *)title 17 | { 18 | PBGitSVRemoteItem *item = [self itemWithTitle:title]; 19 | 20 | return item; 21 | } 22 | 23 | - (NSString*) iconName 24 | { 25 | return @"RemoteTemplate"; 26 | } 27 | 28 | - (PBGitRef *) ref 29 | { 30 | return [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:self.title]]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVStageItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVStageItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVStageItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id) stageItem; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVStageItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVStageItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVStageItem.h" 10 | 11 | 12 | @implementation PBGitSVStageItem 13 | 14 | 15 | + (id) stageItem 16 | { 17 | PBGitSVStageItem *item = [self itemWithTitle:@"Stage"]; 18 | 19 | return item; 20 | } 21 | 22 | 23 | - (NSString*) iconName 24 | { 25 | return @"StageTemplate"; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVSubmoduleItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVSubmoduleItem.h 3 | // GitX 4 | // 5 | // Created by Seth Raphael on 9/14/12. 6 | // 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | 13 | @interface PBGitSVSubmoduleItem : PBSourceViewItem 14 | + (id) itemWithSubmodule:(GTSubmodule*)submodule; 15 | @property (nonatomic, strong) GTSubmodule* submodule; 16 | @property (nonatomic, readonly) NSURL *path; 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVSubmoduleItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVSubmoduleItem.m 3 | // GitX 4 | // 5 | // Created by Seth Raphael on 9/14/12. 6 | // 7 | // 8 | 9 | #import "PBGitSVSubmoduleItem.h" 10 | 11 | @implementation PBGitSVSubmoduleItem 12 | 13 | + (id) itemWithSubmodule:(GTSubmodule*)submodule 14 | { 15 | PBGitSVSubmoduleItem* item = [[self alloc] init]; 16 | item.submodule = submodule; 17 | return item; 18 | } 19 | 20 | - (NSString *)title 21 | { 22 | return self.submodule.name; 23 | } 24 | 25 | - (NSURL *)path 26 | { 27 | NSURL *parentURL = self.submodule.parentRepository.fileURL; 28 | NSURL *result = [parentURL URLByAppendingPathComponent:self.submodule.path]; 29 | return result; 30 | } 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVTagItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVTagItem.h 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | 12 | @interface PBGitSVTagItem : PBSourceViewItem { 13 | 14 | } 15 | 16 | + (id)tagItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVTagItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitSVTagItem.m 3 | // GitX 4 | // 5 | // Created by Nathan Kinsinger on 3/2/10. 6 | // Copyright 2010 Nathan Kinsinger. All rights reserved. 7 | // 8 | 9 | #import "PBGitSVTagItem.h" 10 | #import "PBGitRevSpecifier.h" 11 | 12 | @implementation PBGitSVTagItem 13 | 14 | 15 | + (id)tagItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier 16 | { 17 | PBGitSVTagItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; 18 | item.revSpecifier = revSpecifier; 19 | 20 | return item; 21 | } 22 | 23 | - (NSString*) iconName 24 | { 25 | return @"TagTemplate"; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Classes/git/PBGitTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitTree.h 3 | // GitTest 4 | // 5 | // Created by Pieter de Bie on 15-06-08. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | 13 | @interface PBGitTree : NSObject { 14 | long long _fileSize; 15 | 16 | NSString* sha; 17 | NSString* path; 18 | NSArray* children; 19 | BOOL leaf; 20 | 21 | NSString* localFileName; 22 | NSDate* localMtime; 23 | } 24 | 25 | + (PBGitTree*) rootForCommit: (id) commit; 26 | + (PBGitTree*) treeForTree: (PBGitTree*) tree andPath: (NSString*) path; 27 | - (void) saveToFolder: (NSString *) directory; 28 | - (NSString *)textContents; 29 | - (NSString *)blame; 30 | - (NSString *) log:(NSString *)format; 31 | 32 | - (NSString*) tmpFileNameForContents; 33 | - (long long)fileSize; 34 | 35 | @property(copy) NSString* sha; 36 | @property(copy) NSString* path; 37 | @property(assign) BOOL leaf; 38 | @property(nonatomic, weak) PBGitRepository* repository; 39 | @property(nonatomic, weak) PBGitTree* parent; 40 | 41 | @property(readonly) NSArray* children; 42 | @property(readonly) NSString* fullPath; 43 | @property(readonly) NSString* contents; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/git/PBGitXErrors.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitXErrors.h 3 | // GitX 4 | // 5 | // Created by Andre Berg on 31.10.09. 6 | // Copyright 2009 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import 21 | 22 | extern NSString * const PBGitXErrorDomain; 23 | extern NSString * const PBCLIProxyErrorDomain; 24 | extern NSString * const PBGitRepositoryErrorDomain; 25 | 26 | extern NSString * const PBInvalidBranchErrorMessage; 27 | extern NSString * const PBMissingRemoteErrorMessage; 28 | 29 | extern const NSInteger PBFileReadingUnsupportedErrorCode; /* @"Reading files is not supported." */ 30 | extern const NSInteger PBNotAGitRepositoryErrorCode; /* @"%@ does not appear to be a git repository." */ 31 | extern const NSInteger PBGitBinaryNotFoundErrorCode; 32 | extern const NSInteger PBNotAValidRefFormatErrorCode; /* happens when check-ref-format in PBGitRepository -checkRefFormat returns NO */ 33 | // extern const NSInteger PBCLINilValueForArgumentsCode; /* PBCLIProxy -openRepository:arguments:error: is passed nil for arguments */ 34 | // extern const NSInteger PBCLINilValueForRepositoryPathErrorCode; /* PBCLIProxy -openRepository:arguments:error: is passed nil for repositoryPath */ -------------------------------------------------------------------------------- /Classes/git/PBGitXErrors.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitXErrors.m 3 | // GitX 4 | // 5 | // Created by Andre Berg on 31.10.09. 6 | // Copyright 2009 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #import "PBGitXErrors.h" 21 | 22 | NSString * const PBGitXErrorDomain = @"PBGitXErrorDomain"; 23 | NSString * const PBCLIProxyErrorDomain = @"PBCLIProxyErrorDomain"; 24 | NSString * const PBGitRepositoryErrorDomain = @"PBGitRepositoryErrorDomain"; 25 | 26 | NSString * const PBInvalidBranchErrorMessage = @"Please select a local branch from the branch popup menu, which has a corresponding remote tracking branch set up.\n\n" 27 | @"You can also use the context menu to choose a branch by right clicking on its label in the history view."; 28 | 29 | NSString * const PBMissingRemoteErrorMessage = @"This branch does not appear to have a remote tracking branch associated in its config file section."; 30 | 31 | const NSInteger PBNotAGitRepositoryErrorCode = 1; 32 | const NSInteger PBFileReadingUnsupportedErrorCode = 2; 33 | const NSInteger PBGitBinaryNotFoundErrorCode = 3; 34 | const NSInteger PBNotAValidRefFormatErrorCode = 4; 35 | // const NSInteger PBCLINilValueForArgumentsCode = 5; 36 | // const NSInteger PBCLINilValueForRepositoryPathErrorCode = 6; 37 | -------------------------------------------------------------------------------- /Classes/git/PBGitXProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitXProtocol.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 01-11-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | @class PBGitRepository; 11 | 12 | @interface PBGitXProtocol : NSURLProtocol { 13 | NSFileHandle *handle; 14 | } 15 | @end 16 | 17 | @interface NSURLRequest (PBGitXProtocol) 18 | @property (nonatomic, strong) PBGitRepository *repository; 19 | @end 20 | 21 | @interface NSMutableURLRequest (PBGitXProtocol) 22 | @property (nonatomic, strong) PBGitRepository *repository; 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /Classes/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GitTest 4 | // 5 | // Created by Pieter de Bie on 13-06-08. 6 | // Copyright __MyCompanyName__ 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char **argv) 12 | { 13 | int result; 14 | @autoreleasepool { 15 | result = NSApplicationMain(argc, argv); 16 | } 17 | return result; 18 | } 19 | -------------------------------------------------------------------------------- /Classes/speedtest.h: -------------------------------------------------------------------------------- 1 | // 2 | // speedtest.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 20-11-08. 6 | // Copyright 2008 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface speedtest : NSObject { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Common.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Common.xcconfig 3 | // GitX 4 | // 5 | // Created by Andre Berg on 25.03.10. 6 | // Copyright 2010 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | // Archs and Target SDKs 21 | 22 | ARCHS = ppc i386 x86_64 23 | SDKROOT = macosx10.5 24 | MACOSX_DEPLOYMENT_TARGET = 10.5 25 | 26 | // Search Paths 27 | 28 | HEADER_SEARCH_PATHS = libgit2/src 29 | LIBRARY_SEARCH_PATHS = libgit2 30 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SRCROOT)" 31 | 32 | // Info.plist 33 | 34 | INFOPLIST_PREPROCESS = YES 35 | INFOPLIST_OTHER_PREPROCESSOR_FLAGS = -traditional 36 | INFOPLIST_FILE = Info.plist 37 | INFOPLIST_PREFIX_HEADER = $PROJECT_TEMP_DIR/revision // needed for the `git describe --long` output in the about dialog 38 | 39 | // Compiler 40 | 41 | GCC_ENABLE_OBJC_GC = required 42 | // GCC_VERSION = // System Default (GCC 4.2) 43 | GCC_VERSION = com.apple.compilers.llvmgcc42 // LLVM GCC 4.2 44 | // GCC_VERSION = com.apple.compilers.llvm.clang.1_0 // Clang LLVM 1.0 45 | GCC_C_LANGUAGE_STANDARD = gnu99 46 | 47 | // Prefix Header 48 | 49 | GCC_PRECOMPILE_PREFIX_HEADER = YES 50 | GCC_PREFIX_HEADER = GitX_Prefix.pch 51 | 52 | // Linking 53 | 54 | PREBINDING = NO 55 | ZERO_LINK = NO // this is no longer needed 56 | 57 | // Other 58 | 59 | LLVM_LTO = NO // Link-Time Optimization causes a Rel32 address space error when linking (since we now target x86_64 inclusively) 60 | 61 | -------------------------------------------------------------------------------- /Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Debug.xcconfig 3 | // GitX 4 | // 5 | // Created by Andre Berg on 25.03.10. 6 | // Copyright 2010 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #include "Common.xcconfig" 21 | 22 | // Macros 23 | 24 | GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = DEBUG_BUILD 25 | 26 | OTHER_CFLAGS = -fdiagnostics-show-option 27 | 28 | // Warnings 29 | 30 | GCC_WARN_UNUSED_VARIABLE = YES 31 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES 32 | GCC_WARN_ABOUT_RETURN_TYPE = YES 33 | -------------------------------------------------------------------------------- /Documentation/GraphingAPI.txt: -------------------------------------------------------------------------------- 1 | The core of the graphing functionality is in the PBGitGrapher class. This 2 | class has one function - parseCommits() that takes an NSArray of commits and 3 | creates a PBGraphCellInfo for each commit. These PBGraphCellInfo are stored in 4 | an array that can later be accessed using the cellInfoForRow: function. 5 | 6 | The PBGraphCellInfo has only basic information -- The column the commit 7 | associated with this commit should be drawn in, and other lines that should be 8 | drawn. 9 | 10 | These lines are in an array of PBLines. A PBLine has a few pieces of 11 | information -- a start column, an end column and whether the line should be 12 | drawn on the top or bottom part of the row. Furthermore, it has a colorIndex 13 | to indicate the color the line should be given. Note that this number 14 | increases forever, so you can modulo it with the number of colors you have. 15 | 16 | In the PBGitWindowController, the - 17 | (void)tableView:willDisplayCell:forTableColumn:row: is implemented which sets 18 | the correct PBGraphCellInfo for the cell to be drawn. This cell is of the 19 | class PBGitRevisionCell, which has the actual drawing implementation. 20 | 21 | The basic algorithm for the graphing is like this: 22 | 23 | For each commit 24 | For each previous column 25 | If this commit should be in this column 26 | mark this position and set this commits first parent 27 | as the next commit for this lane 28 | Else if this commit should be in a previous column 29 | add a line to that column and discard the previous 30 | column 31 | Else 32 | Keep this column for the current row 33 | For each parent of this commit 34 | If it has not been displayed, add it as a column -------------------------------------------------------------------------------- /Documentation/README: -------------------------------------------------------------------------------- 1 | This directory is meant to document some of the API's that we use -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.2.1.txt: -------------------------------------------------------------------------------- 1 | V0.2.1 2 | === 3 | * Added Sparkle update system 4 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.2.txt: -------------------------------------------------------------------------------- 1 | V0.2: Changes since v0.1 2 | ==== 3 | * The graph now has colors 4 | * There are now lables attached to commits -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.3.1.txt: -------------------------------------------------------------------------------- 1 | v0.3.1 2 | === 3 | * Fixed a serious crasher 4 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.3.txt: -------------------------------------------------------------------------------- 1 | V0.3: Changes since v0.2.1 2 | ==== 3 | * You can now pass on command-line arguments just like you can with 'git log' 4 | * The program has an icon 5 | * Also displays remote branches in the branch list 6 | * Is better in determining if a directory is a bare git repository 7 | * Support for --left-right: use 'gitx --left-right HEAD..origin/master' 8 | to see which commits are only on your branch or on their branch 9 | * Navigate through changed hunks by using j/k keys 10 | * Scroll down in webview by using space / shift-space 11 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.4.1.txt: -------------------------------------------------------------------------------- 1 | v0.4.1 2 | == 3 | 4 | This is a maintenance release. Most important fixes: 5 | 6 | * The diff display is now much faster 7 | * More locations are now searched for a default git 8 | * Code pasted online is now private 9 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.4.txt: -------------------------------------------------------------------------------- 1 | v0.4: Changes since v0.3.1 2 | === 3 | * A new commitview, allowing you to selectively add changes and commit them. 4 | * You can now upload a commit as a patch to gist.github.com 5 | * GitX now searches for your git binary in more directories and is smarter 6 | about reporting errors regarding git paths. 7 | * You can now remove branches by right-clicking on them in the detailed view 8 | * GitX now comes with a spicy new icon 9 | * The diff view has become prettier and now also highlights trailing 10 | whitespace. 11 | * Various little changes and stability improvement 12 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.5.txt: -------------------------------------------------------------------------------- 1 | v0.5 2 | ==== 3 | 4 | This feature release has several new smaller or larger features: 5 | 6 | * The current branch is now highlighted 7 | * In the commit view, there is an option to amend commits 8 | * The "Gist it" button now respects github.user/token 9 | * Display a gravatar of the committer 10 | * The commit message view now displays a vertical line at 50 characters 11 | * It is now possible to revert changes by using the context menu in the 12 | commit view 13 | * You can now stage only parts of a file by using the "Stage Hunk" buttons 14 | in the commit view 15 | * You can now use GitX to show a diff of anything, for example by using 16 | 'gitx --diff HEAD^^' or 'git diff HEAD~3 | gitx --diff' 17 | * You can now drag and drop refs to move them and also create branches 18 | 19 | In addition, the following bugs have been fixed: 20 | 21 | * Better detection of git version 22 | * Branch lines are no longer interspersed with half a pixel of whitespace 23 | * The toolbar keeps its state when switching views 24 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.6.1.txt: -------------------------------------------------------------------------------- 1 | v0.6.1 2 | === 3 | 4 | This is a bugfix release. The following bugs have been fixed: 5 | 6 | * The commit view shows new files with linebreaks 7 | * The history view works with Git >= 1.5.4 again 8 | * Reloading the detailed view in the History no longer causes an empty page 9 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.6.2.txt: -------------------------------------------------------------------------------- 1 | v0.6.2 2 | === 3 | 4 | This is a maintenance release. The following bugs have been fixed: 5 | 6 | * Fix many display bugs in the history view (Thanks to Johannes Gilger) 7 | * Fix moving of refs 8 | * GitX no longer stalls if you have a large amount of untracked files 9 | * GitX now asks for confirmation before deleting a branch 10 | * GitX no longer shows ghost files after staging a hunk 11 | * Dragging and dropping a tree now correctly copies all files 12 | 13 | In addition, the following features have been added: 14 | 15 | * There is now a 'New…' option to create a new repository 16 | * The 'Gist It' feature now asks for confirmation by default. This can be changed in the preferences 17 | * GitX can now open any directory by dragging it on the icon 18 | * GitX now asks for confirmation before deleting a branch 19 | 20 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.6.3.txt: -------------------------------------------------------------------------------- 1 | v0.6.3 2 | === 3 | 4 | This is a maintenance release. The following bugs have been fixed: 5 | 6 | * Fixed a problem where GitX could not open some directories, for example those that include a . [Johannes Gilger] 7 | * Fixed a performance issue when staging or unstaging a lot of files 8 | * Various buildfixes (Benjamin Kramer, Arjen Laarhoven) 9 | 10 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.6.txt: -------------------------------------------------------------------------------- 1 | v0.6 2 | === 3 | 4 | This release has the following new features and enhancements: 5 | 6 | * The diff display now looks much nicer, using boxes to segment files 7 | * The toolbar can now me customized 8 | * Images that have been changed or added in a commit can now be viewed 9 | inline in GitX 10 | * GitX has gained a preference pane which allows you to specify a git path 11 | and disable the Gist and Gravatar integration 12 | * The commit interface is now more intuitive. Particularly, you can now 13 | select multiple files and use drag and drop to stage / unstage files 14 | * You can now drag and drop files out of the commit view 15 | * The files in the commit view have gained a context menu that allows you 16 | to revert changes / open the file / ignore the file 17 | * It is now possible to adjust the amount of context lines in the commit view. 18 | Using a smaller context size allows you to do more fine-grained commits 19 | * The branch menu is now organized in branches/remotes/tags 20 | * The view switch button now uses icons rather than words 21 | * The view shortcuts have changed to use command 1/2 for the history/commit 22 | view. The history's subviews can now be changed using command-option-1/2/3 23 | * Listing commits has become much faster 24 | * GitX no longer spawns zombie processes 25 | * GitX now shows a list of files that have been changed in a commit 26 | * GitX now uses libgit2 to store object id's, reducing it's memory footprint 27 | 28 | In addition many bugs were fixed, including the correct calculation of a 29 | gravatar MD5 hash. 30 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.7.1.txt: -------------------------------------------------------------------------------- 1 | v0.7.1 2 | === 3 | 4 | This is a maintenance release. The following bugs have been fixed: 5 | 6 | * The Tree View now tries to be smart about displaying binaries (Johannes) 7 | * GitX now correctly tries to require git v1.6.0 or higher (Pieter) 8 | * Amending commits if the author name has UTF-8 multi-byte characters now correctly works (Pieter) 9 | * GitX no longer stalls for large periods when refreshing in the commit view (Johannes, Pieter) 10 | * The history view tries to be less crashy when loading commits 11 | 12 | In addition, the Sparkle framework has been updated so that future updates will be signed 13 | -------------------------------------------------------------------------------- /Documentation/ReleaseNotes/v0.7.txt: -------------------------------------------------------------------------------- 1 | v0.7 2 | === 3 | 4 | As a GitX user, we would like you to help us focus our development by telling 5 | us your wishes. You can help us by filling in this 6 | [survey](http://www.survs.com/survey?id=DCJKLP2B&channel=UY6RRC3MXZ "GitX User survey")! 7 | 8 | This feature-release has the following new features and enhancements: 9 | 10 | * Line-wise staging by selecting lines from hunks (JD Smith) 11 | * Discarding hunks/changes to files (using git apply --reverse) (Johannes Gilger) 12 | * Show current HEAD in window-title (Johannes Gilger) 13 | * Show current branch in orange in history view (Steven Michalske) 14 | * Collapse commit-list/diff-view using Command-Shift-Up/Down (Johannes Gilger) 15 | * Sign-Off commits in commit view (Johannes Gilger, Nicolas Riley) 16 | * "Show in Finder" for files in commit view (Charles O'Rourke) 17 | * Commit hooks are executed when committing (Joe Fiorini, Pieter de Bie) 18 | * Branches can be deleted from the UI 19 | 20 | Small enhancements: 21 | 22 | * Option to disable the "Open" dialog on start (Stonewall Ballard) 23 | * Show committer name if it differs from authors name (Benjamin Kramer) 24 | * Columns in history view can be toggled (Pieter de Bie) 25 | * Reuse author-information when amending a commit (Pieter de Bie) 26 | * Commit interface is now faster (Pieter de Bie) 27 | * Use modal alerts where possible 28 | * Don't display content of binary-files in tree-view 29 | * The user manual has been updated for 0.7 (Johannes Gilger) 30 | * Make the Commit UI a bit more informative (Nicholas Riley) 31 | 32 | 33 | In addition a lot of bugs were fixed and numerous tiny features introduced. 34 | 35 | Credits go to: Pieter de Bie, Johannes Gilger, Benjamin Kramer, Nicholas Riley, JD Smith, Joe Fiorini, Dave Grijalva, Charles O'Rourke, Gerd Knops, dbr, Mike Czepiel, Benoit Cerrina, Steven Michalske and Stonewall Ballard 36 | -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | NSHumanReadableCopyright = "© Pieter de Bie, 2010"; -------------------------------------------------------------------------------- /GitX.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /GitX.xcodeproj/.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata/ 2 | *.xccheckout 3 | 4 | -------------------------------------------------------------------------------- /GitX.xcodeproj/project.xcworkspace/.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata/ 2 | -------------------------------------------------------------------------------- /GitX.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GitX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GitX_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | 3 | #ifdef __OBJC__ 4 | #import 5 | #import 6 | #endif 7 | 8 | #ifdef GITX_NO_DEPRECATE 9 | #define GITX_DEPRECATED 10 | #else 11 | #define GITX_DEPRECATED __attribute__ ((deprecated)) 12 | #endif 13 | -------------------------------------------------------------------------------- /Install.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Install.xcconfig 3 | // GitX 4 | // 5 | // Created by Andre Berg on 19.10.09. 6 | // Copyright 2009 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | // Global settings across build configurations for Install 21 | 22 | // The Install build config should just serve as a mere extension to the Release 23 | // config, e.g. please do not define settings here that could as well be defined 24 | // in Release.xcconfig. 25 | 26 | #include "Release.xcconfig" 27 | 28 | CUSTOM_INSTALL_DIR = $(DEVELOPER_DIR)/Applications/Utilities/Third-Party // used with the Install.sh script 29 | CLI_CUSTOM_INSTALL_DIR = /usr/local/bin // used with the Install.sh script 30 | -------------------------------------------------------------------------------- /Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Release.xcconfig 3 | // GitX 4 | // 5 | // Created by Andre Berg on 25.03.10. 6 | // Copyright 2010 Berg Media. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | 20 | #include "Common.xcconfig" 21 | 22 | DEBUG_INFORMATION_FORMAT = dwarf 23 | 24 | DEPLOYMENT_POSTPROCESSING = YES 25 | 26 | STRIP_INSTALLED_PRODUCT = YES 27 | -------------------------------------------------------------------------------- /Resources/Credits.html: -------------------------------------------------------------------------------- 1 | 8 |

By developers, for developers.

9 |

10 | http://rowanj.github.io/gitx/ 11 |

-------------------------------------------------------------------------------- /Resources/Images/AddBranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/AddBranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/AddLabelTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/AddLabelTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/AddRemoteTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/AddRemoteTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/BranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/BranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/CherryPickTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/CherryPickTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/DetailViewTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/DetailViewTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FetchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/FetchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FolderClosedTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/FolderClosedTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FolderTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/FolderTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/MergeTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/MergeTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/Preferences/Updates.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/Preferences/Updates.png -------------------------------------------------------------------------------- /Resources/Images/PullTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/PullTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/PushTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/PushTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RebaseTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/RebaseTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RemoteBranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/RemoteBranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RemoteTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/RemoteTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/StageTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/StageTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/TagTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/TagTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/TreeViewTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/TreeViewTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/deleted_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/deleted_file.pdf -------------------------------------------------------------------------------- /Resources/Images/empty_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/empty_file.pdf -------------------------------------------------------------------------------- /Resources/Images/gitx_icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/gitx_icon.psd -------------------------------------------------------------------------------- /Resources/Images/mainSplitterBar.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/mainSplitterBar.tiff -------------------------------------------------------------------------------- /Resources/Images/mainSplitterDimple.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/mainSplitterDimple.tiff -------------------------------------------------------------------------------- /Resources/Images/new_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/new_file.pdf -------------------------------------------------------------------------------- /Resources/Images/rewindImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/Images/rewindImage.pdf -------------------------------------------------------------------------------- /Resources/UpdateKey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIDOzCCAi0GByqGSM44BAEwggIgAoIBAQDLgrI0GgvtC1rRi6dRNW+N1hcieyZZ 3 | YFAjvnMpgUP6tsvc1j1V4wgK6pyuU1MCpbrMhSNccqO9D/Xx1ySpbUajn6WKeX8J 4 | FXDCi1mbq7D8jUbXhReDRcI1NbI6r2cw0Rv5wQU+RFKGwaBpyNZy434k0/zTEMlY 5 | 3PzhGe3jeNOutnqc71f3LTk2wrqlVXsI4y0dl7a2JcwZyXv+/5QniKlukZIFjR5b 6 | tiwhicOtI8AsabNM1dIAVlsady+P/DwpRsTfCRY+Mo//4RU0hSE+i8Z3y0pz71Wv 7 | L89yS1GONRQMeYbRDX1ZZcfIYlMmVEcsHh94i199pUmkgdw08iTyjnlrAhUA+VTd 8 | fA3w0Yptf3eWqSZPBGCayaUCggEAFhMtxRAWnHvZW3MZTfmeDs8IhhkbSfoBtD+r 9 | 2T+EUUCyYPiN4PvmF+4aNWMoWh2lsd6cpvtg5I2qo/qX1HGtQwOc2FHnMmLkUPJz 10 | kLz7nwpzgdFQ3EyZ3jzmzvNwtsYJ7y7LzkIR22jnLslSl8SiMI+gIwze/oSTEb1X 11 | o5xadOsFNiAANUSEa1/42xQEHbwfYWMJIEXTBx6GyKJDcep1bK4cFx0A+xnghIhm 12 | 4oah6kYG5ns7wDEcJ/+1FcZbogif5qcTjB2UFvL77jKuqRBcI8xiALVlnAPGkC3R 13 | rT033W13tnJolae7dLy4UA3taELH+CoaoSgOk6o20ZgjJUbd0wOCAQYAAoIBAQCA 14 | E4nDRoShNyE20aUxBC8uF5MhDJE0VomcOKPmyDd3Jl4DlEogzMGAwAZKrQKcBlkB 15 | CAYaWes7ULDDA0RNABWHSI9t/brrQcOPrvRMA6wgcuA5oQcm8zVziuwXJwb+NqwG 16 | so2ysvryjlUDtHPc2jJ5hUSqkp22NeQv2iK4RoQ9pDJp5/alzH7fYgqECB45AuhA 17 | 34BCKE7B2fakJ5YLQdXZOzG5O3r3azWAewqp4J34Npiqn5LSdl8FZIhMaxmi9mBa 18 | 65w0CNY4/VyyvOgPqCo5zPNxCJxypsvI0IUYRWeJFkEpQLmZ0K1bpmGT1iGnT4A5 19 | 5llf69yaJyoGJDoD/Rj6 20 | -----END PUBLIC KEY----- 21 | -------------------------------------------------------------------------------- /Resources/gitx.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/gitx.icns -------------------------------------------------------------------------------- /Resources/source.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Resources/source.css -------------------------------------------------------------------------------- /Site/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | -------------------------------------------------------------------------------- /Site/Rakefile: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | require 'erb' 3 | 4 | task :generate => [:generate_usermanual] do 5 | require 'rdiscount' 6 | require 'lib/release_notes' 7 | 8 | `rm -rf output` 9 | FileUtils.mkdir("output") 10 | `cat text/*.markdown > output/UserManual.markdown` 11 | `cp -r assets/* output` 12 | 13 | template = ERB.new(File.read("templates/site.html")) 14 | 15 | Dir.glob("text/*.markdown").each do |file| 16 | contents = File.read(file) 17 | @body = Markdown.new(ERB.new(contents).result(binding)).to_html 18 | @filename = File.basename(file).gsub(/markdown$/,"html") 19 | File.open("output/" + @filename, "w") do |f| 20 | f.puts template.result(binding) 21 | end 22 | end 23 | 24 | # Add the user manual 25 | FileUtils.mkdir("output/images/UserManual") 26 | `cp -r UserManual/output/images/* output/images/UserManual` 27 | @filename = 'user_manual.html' 28 | @body = File.read("UserManual/output/UserManual.html") 29 | @title = "User Manual" 30 | File.open("output/user_manual.html", "w") do |f| 31 | f.puts template.result(binding) 32 | end 33 | 34 | `open output/index.html` 35 | end 36 | 37 | task :generate_usermanual do 38 | require 'rdiscount' 39 | `rm -rf UserManual/output` 40 | FileUtils.mkdir("UserManual/output") 41 | `cat UserManual/text/*.markdown > output/UserManual.markdown` 42 | `cp -r UserManual/assets/images UserManual/output` 43 | 44 | source = Dir.glob("UserManual/text/**/*.markdown").map do |file| 45 | File.read(file) 46 | end.join("\n") 47 | body = Markdown.new(source).to_html 48 | File.open("UserManual/output/UserManual.html", "w") do |f| 49 | f.puts body 50 | end 51 | end 52 | 53 | task :generate_appcast do 54 | require 'lib/release_notes.rb' 55 | require 'rdiscount' 56 | FileUtils.mkdir_p("output/Downloads") 57 | template = ERB.new(File.read("templates/sparkle.xml")) 58 | 59 | filename = ENV["STABLE"] ? "appcast.xml" : "appcast_DEBUG.xml" 60 | File.open("output/Downloads/#{filename}", "w") do |f| 61 | f.puts template.result(binding) 62 | end 63 | end 64 | 65 | task :upload do 66 | `rsync -a output/ sydney:public_html/gitx/` 67 | end -------------------------------------------------------------------------------- /Site/UserManual/.gitignore: -------------------------------------------------------------------------------- 1 | output/ 2 | -------------------------------------------------------------------------------- /Site/UserManual/assets/images/branch-lanes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/branch-lanes.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/branchswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/branchswitcher.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/commitview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/commitview.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/detailswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/detailswitcher.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/display_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/display_diff.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/gistie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/gistie.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/gitx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/gitx.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/historyview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/historyview.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/left-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/left-right.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/menubar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/menubar.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/quicklook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/quicklook.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/viewswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/UserManual/assets/images/viewswitcher.png -------------------------------------------------------------------------------- /Site/UserManual/template.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | GitX Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | 21 |
22 | 23 |
24 |
25 |
26 | 27 |
28 | <%= body %> 29 |
30 | 31 |
32 |
33 |
34 |
35 |
36 | 37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Site/UserManual/text/01 - Introduction.markdown: -------------------------------------------------------------------------------- 1 | User Manual 2 | ----------- 3 | 4 | This is the GitX user's manual. This document tries to explain the most common used features and explains the concepts that might be confusing if you've never used a git GUI. 5 | 6 | ### Disclaimer 7 | 8 | GitX aims to be a graphical wrapper around the most-frequently used 9 | git-commands, enabling you to satisfy your daily git needs in one consistent 10 | program. GitX doesn't aspire to be a complete interface for the wide variety 11 | of git command-line programs with their ever-growing number of options. It's 12 | also no easy way to learn git. A sound understanding of how git stores data, 13 | how it works on that data and how to recover from (accidental) deletion of 14 | branches and commits will not only help you with git but will also enable you 15 | to learn GitX with greater confidence and speed. Since GitX is far from 16 | complete you'll probably still have to use it in conjunction with the 17 | command-line git for more complex tasks, such as merging or performing remote 18 | operations. -------------------------------------------------------------------------------- /Site/assets/css/usermanual.css: -------------------------------------------------------------------------------- 1 | pre 2 | { 3 | background: rgb(238, 238, 238) !important; 4 | display: block; 5 | width: 750px; 6 | padding: 5px; 7 | margin: 10px;; 8 | } 9 | 10 | code 11 | { 12 | font-family: 'andale mono'; 13 | } 14 | 15 | img 16 | { 17 | display: block; 18 | margin: 10px auto 10px auto; 19 | } 20 | 21 | img.floatleft 22 | { 23 | float: left; 24 | display: inline; 25 | margin: 10px; 26 | } 27 | 28 | img.floatright 29 | { 30 | float: right; 31 | display: inline; 32 | margin: 10px; 33 | } -------------------------------------------------------------------------------- /Site/assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/assets/images/bg.png -------------------------------------------------------------------------------- /Site/assets/images/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/assets/images/download.png -------------------------------------------------------------------------------- /Site/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/assets/images/favicon.png -------------------------------------------------------------------------------- /Site/assets/images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/assets/images/header.jpg -------------------------------------------------------------------------------- /Site/assets/images/qtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/Site/assets/images/qtime.png -------------------------------------------------------------------------------- /Site/lib/release_notes.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | RELEASE_NOTES_PATH = File.join(File.dirname(__FILE__), "..", "..", "Documentation", "ReleaseNotes") 4 | 5 | module ReleaseNotes 6 | 7 | VERSION_MATCH = /v([0-9.]*).txt$/ 8 | 9 | # Find all release not files 10 | def self.release_files 11 | notes = Dir.glob(File.join(RELEASE_NOTES_PATH, "v*.txt")) 12 | 13 | # Sort files by version number 14 | notes.sort do |x,y| 15 | x = x.match VERSION_MATCH 16 | y = y.match VERSION_MATCH 17 | # Puts nonmatching files at the bottom 18 | if !x && y 19 | 1 20 | elsif !y && x 21 | -1 22 | else 23 | # compare version strings, newest at the top 24 | y[1].split(".").map { |a| a.to_i } <=> x[1].split(".").map { |a| a.to_i } 25 | end 26 | end 27 | end 28 | 29 | # Aggregate all release notes in a string 30 | def self.aggregate_notes 31 | file = "" 32 | release_files.each do |x| 33 | file << File.read(x) 34 | file << "\n" 35 | end 36 | file 37 | end 38 | 39 | def self.last_version 40 | last_file = release_files.first 41 | if last_file =~ VERSION_MATCH 42 | return $1 43 | end 44 | nil 45 | end 46 | 47 | def self.last_notes 48 | File.read(release_files.first) 49 | end 50 | end -------------------------------------------------------------------------------- /Site/templates/site.html: -------------------------------------------------------------------------------- 1 | <% 2 | def create_link(name, description) 3 | "#{description}" 4 | end 5 | %> 6 | 7 | 8 | 9 | 10 | GitX - <%= @title %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 23 | 32 | 39 |
40 | <%= @body %> 41 |
42 | 45 |
46 | 50 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Site/templates/sparkle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GitX 5 | http://github.com/pieter/gitx/wikis 6 | A more native clone of Gitk for OS X 7 | 8 | 9 | 10 | GitX <%= ReleaseNotes::last_version %> 11 | Thu, 29 Jan 2009 23:54:01 GMT 12 | 13 | 14 | 16 | body { 17 | font-size: 70%; 18 | } 19 | h1 { 20 | font-size: 160%; 21 | } 22 | 23 | <%= Markdown.new(ReleaseNotes::last_notes).to_html %> 24 | ]]> 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Site/text/contact.markdown: -------------------------------------------------------------------------------- 1 | <% @title = "Contact" %> 2 | Contact 3 | ------- 4 | 5 | The GitX repository can be found on Github at [http://github.com/pieter/gitx](http://www.github.com/pieter/gitx/wikis). 6 | 7 | GitX has a mailing list at [gitx@googlegroups.com](mailto:gitx@googlegroups.com) to which you can email any questions or patches. 8 | 9 | GitX is actively maintained by Pieter de Bie. You can email him at [frimmirf@gmail.com](mailto:frimmirf+gitx@gmail.com) or on twitter @pdebie 10 | -------------------------------------------------------------------------------- /Site/text/contribute.markdown: -------------------------------------------------------------------------------- 1 | <% @title = "Contribute" %> 2 |

3 | Contribute 4 |

5 |

6 | GitX is an open source project. This means that you can help developing or even take the code and develop you own version. 7 | GitX is released under a GPL v2 license. 8 |

9 |

Develop

10 | 11 | If you want to contribute to GitX, you can just clone the repository and start working! The GitX repository can be cloned by using: 12 | 13 |
14 | 	git clone git://github.com/pieter/gitx.git
15 | 
16 | 17 | The preferred way of contributing is by sending patches to the [Mailinglist](mailto:gitx@googlegroups.com). 18 | 19 | If you're not sure what to do, you can take a look at the [TODO list on 20 | Github](http://github.com/pieter/gitx/wikis/TODO). If you want to work on the 21 | HTML side of GitX (such as the detailed view), you should take a look at the 22 | [Working on HTML](http://github.com/pieter/gitx/wikis/workingonhtml) page. 23 | 24 |

Bug Report

25 | 26 | If you find or want to fix bugs, you should take a look at our [Bug 27 | Tracker](http://gitx.lighthouseapp.com/projects/17830-gitx). If you can't 28 | reach Lighthouse or don't want to register for an account, you can also send the bugs to mailing list. 29 | 30 |

Donate

31 |

32 | If you don't want to or can't help with the code you can also support this project by making a donation using the button below. 33 |

34 |

35 | Click here to lend your support to: gitx and make a donation at www.pledgie.com ! 36 |

37 | 38 | -------------------------------------------------------------------------------- /Site/text/index.markdown: -------------------------------------------------------------------------------- 1 | <% @title = "Home" %> 2 | 9 | 10 |

GitX

11 |

12 | GitX is a git GUI made for Mac OS X. It currently 13 | features a history viewer much like gitk and a commit GUI like git gui. But 14 | then in silky smooth OS X style! 15 |

16 | 17 |

Features

18 |
    19 |
  • Detailed history viewer
  • 20 |
  • Nice commit GUI, allowing hunk- and line-wise staging
  • 21 |
  • Fast workflow
  • 22 |
  • Explore tree of any revision
  • 23 |
  • Nice Aqua interface
  • 24 |
  • Paste commits to gist.github.com
  • 25 |
  • QuickLook integration
  • 26 |
27 | 28 |

Requirements

29 |

30 | GitX runs on Mac OS X 10.5 Leopard and Mac OS X 10.6 Snow Leopard. Because it uses features like Garbage Collection, you can't compile it on earlier systems. GitX also requires a fairly recent Git -- version 1.6.0 and higher are all supported. 31 |

32 | 33 |

Download

34 |

35 | The newest version of GitX is <%= ReleaseNotes::last_version %>. This version can be downloaded from here. To see what has changed, read the Release History. 36 |

37 |

38 | After starting GitX, you can install the command-line tool through the menu (GitX->Enable Terminal Usage…). This will install a “gitx” binary in /usr/local/bin. 39 |

40 | -------------------------------------------------------------------------------- /Site/text/links.markdown: -------------------------------------------------------------------------------- 1 | <% @title = "Links" %> 2 |

3 | Links 4 |

5 | 6 | 14 | 15 |

Mailing list

16 | 17 | * [Google Groups](http://groups.google.com/group/gitx) 18 | * [Nabble archive](http://n2.nabble.com/GitX-f3079826.html) 19 | 20 |

Bug Reporting

21 | 24 | -------------------------------------------------------------------------------- /Site/text/release_history.markdown: -------------------------------------------------------------------------------- 1 | <% @title = "Release History" %> 2 |

3 | Release history 4 |

5 | 6 | <%= ReleaseNotes::aggregate_notes %> -------------------------------------------------------------------------------- /html/css/GitX.css: -------------------------------------------------------------------------------- 1 | @import url("diff.css"); 2 | @import url("notification.css"); 3 | 4 | body { 5 | margin: 0; 6 | margin-top: 5px; 7 | width: 100%; 8 | font-family: 'Lucida Grande', Arial; 9 | } 10 | 11 | .expanded:before { 12 | content: "\25be\0020"; 13 | } 14 | 15 | .collapsed:before { 16 | content: "\25b8\0020"; 17 | } 18 | 19 | .SHA { 20 | font-family: 'Monaco', monospace; 21 | text-decoration: none; 22 | } 23 | -------------------------------------------------------------------------------- /html/css/diff.css: -------------------------------------------------------------------------------- 1 | .diff .file { 2 | margin: 10px; 3 | padding: 10px; 4 | -webkit-border-radius: 10px; 5 | border: 1px solid #CCC; 6 | -webkit-box-shadow: 1px 1px 2px #DDD; 7 | } 8 | 9 | .diff .file .fileHeader { 10 | margin-top: -5px; 11 | padding-bottom: 1px; 12 | font-weight: bold; 13 | } 14 | 15 | .diff .file .diffContent { 16 | white-space: pre; 17 | font-family: Menlo, Monaco; 18 | } 19 | 20 | .diff .file .diffcontent .lineno { 21 | float: left; 22 | padding-left: 2px; 23 | padding-right: 2px; 24 | background-color: #ECECEC; 25 | color: #A9A9A9; 26 | border: 1px solid #DDDDDD; 27 | text-align: right; 28 | } 29 | 30 | .diff .file .diffContent .lines { 31 | overflow: auto; 32 | } 33 | 34 | .diff .file .diffContent .lines .hunkheader { 35 | background-color: #f7f7f7; 36 | color: #bbb; 37 | } 38 | 39 | 40 | .diff .file .diffcontent .lines .delline { 41 | background-color: #FEE; 42 | color: #B00; 43 | } 44 | 45 | .diff .file .diffcontent .lines .addline { 46 | background-color: #DFD; 47 | color: #080; 48 | } 49 | 50 | .diff .file .diffcontent .lines .whitespace { 51 | background-color: rgba(255,0,0,0.5); 52 | } 53 | .diff .file .diffcontent .lines del, 54 | .diff .file .diffcontent .lines ins { 55 | text-decoration: none; border-radius: 0.3em; 56 | } 57 | .diff .file .diffcontent .lines .delline del { 58 | background-color: #febfbf; 59 | color: #A00; 60 | } 61 | .diff .file .diffcontent .lines .addline ins { 62 | background-color: #b2ffaf; 63 | color: #070; 64 | } 65 | 66 | #CurrentHunk { 67 | border-left: 5px solid black; 68 | } -------------------------------------------------------------------------------- /html/css/notification.css: -------------------------------------------------------------------------------- 1 | #notification { 2 | margin: 5px; 3 | padding: 3px; 4 | clear: both; 5 | 6 | border: 1px solid black; 7 | background-color: #f3f3f3; 8 | 9 | text-align: center; 10 | font-size: 80%; 11 | 12 | -webkit-border-radius: 2px; 13 | } 14 | 15 | #notification.success { 16 | background-color: #CCFF99; 17 | border: 1px solid #99CC66; 18 | } 19 | 20 | #notification.fail { 21 | background-color: #ff9999; 22 | border: 1px solid #cc6666; 23 | } -------------------------------------------------------------------------------- /html/images/added.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /html/images/modified.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /html/images/removed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /html/images/renamed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /html/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/html/images/spinner.gif -------------------------------------------------------------------------------- /html/lib/GitX.js: -------------------------------------------------------------------------------- 1 | /* 2 | * GitX Javascript library 3 | * This library contains functions that can be shared across all 4 | * webviews in GitX. 5 | * It is written only for Safari 3 and higher. 6 | */ 7 | 8 | function $(element) { 9 | return document.getElementById(element); 10 | } 11 | 12 | String.prototype.escapeHTML = function() { 13 | return this.replace(/&/g,'&').replace(//g,'>'); 14 | }; 15 | 16 | String.prototype.unEscapeHTML = function() { 17 | return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); 18 | }; 19 | 20 | Element.prototype.toggleDisplay = function() { 21 | if (this.style.display != "") 22 | this.style.display = ""; 23 | else 24 | this.style.display = "none"; 25 | } 26 | 27 | Array.prototype.indexOf = function(item, i) { 28 | i || (i = 0); 29 | var length = this.length; 30 | if (i < 0) i = length + i; 31 | for (; i < length; i++) 32 | if (this[i] === item) return i; 33 | return -1; 34 | }; 35 | 36 | var notify = function(text, state) { 37 | var n = $("notification"); 38 | n.style.display = ""; 39 | $("notification_message").innerHTML = text; 40 | 41 | // Change color 42 | if (!state) { // Busy 43 | $("spinner").style.display = ""; 44 | n.setAttribute("class", ""); 45 | } 46 | else if (state == 1) { // Success 47 | $("spinner").style.display = "none"; 48 | n.setAttribute("class", "success"); 49 | } else if (state == -1) {// Fail 50 | $("spinner").style.display = "none"; 51 | n.setAttribute("class", "fail"); 52 | } 53 | } 54 | 55 | var hideNotification = function() { 56 | $("notification").style.display = "none"; 57 | } 58 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003, 2004 Jim Weirich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello SyntaxHighlighter 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Hello SyntaxHighlighter

15 |
16 | function helloSyntaxHighlighter()
17 | {
18 | 	return "hi!";
19 | }
20 | 
21 | 22 | 23 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file 26 | { regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file 27 | { regex: /^\s.*$/gm, css: 'color1' }, // unchanged 28 | { regex: /^@@.*@@.*$/gm, css: 'variable' }, // location 29 | { regex: /^\+.*$/gm, css: 'string' }, // additions 30 | { regex: /^\-.*$/gm, css: 'color3' } // deletions 31 | ]; 32 | }; 33 | 34 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 35 | Brush.aliases = ['diff', 'patch']; 36 | 37 | SyntaxHighlighter.brushes.Diff = Brush; 38 | 39 | // CommonJS 40 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 41 | })(); 42 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushErlang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jean-Lou Dupont 25 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 26 | 27 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 28 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 29 | 'case catch cond div end fun if let not of or orelse '+ 30 | 'query receive rem try when xor'+ 31 | // additional 32 | ' module export import define'; 33 | 34 | this.regexList = [ 35 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 36 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 37 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 38 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 39 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 42 | ]; 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['erl', 'erlang']; 47 | 48 | SyntaxHighlighter.brushes.Erlang = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | var keywords = 'break case catch class continue ' + 25 | 'default delete do else enum export extends false ' + 26 | 'for function if implements import in instanceof ' + 27 | 'interface let new null package private protected ' + 28 | 'static return super switch ' + 29 | 'this throw true try typeof var while with yield'; 30 | 31 | var r = SyntaxHighlighter.regexLib; 32 | 33 | this.regexList = [ 34 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 35 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 36 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 37 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 38 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 40 | ]; 41 | 42 | this.forHtmlScript(r.scriptScriptTags); 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['js', 'jscript', 'javascript', 'json']; 47 | 48 | SyntaxHighlighter.brushes.JScript = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushJava.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract assert boolean break byte case catch char class const ' + 25 | 'continue default do double else enum extends ' + 26 | 'false final finally float for goto if implements import ' + 27 | 'instanceof int interface long native new null ' + 28 | 'package private protected public return ' + 29 | 'short static strictfp super switch synchronized this throw throws true ' + 30 | 'transient try void volatile while'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multiline comments 35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword 42 | ]; 43 | 44 | this.forHtmlScript({ 45 | left : /(<|<)%[@!=]?/g, 46 | right : /%(>|>)/g 47 | }); 48 | }; 49 | 50 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 51 | Brush.aliases = ['java']; 52 | 53 | SyntaxHighlighter.brushes.Java = Brush; 54 | 55 | // CommonJS 56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 57 | })(); 58 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushScala.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | // Contributed by Yegor Jbanov and David Bernard. 25 | 26 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + 27 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' + 28 | 'else do if return protected private this package false'; 29 | 30 | var keyops = '[_:=><%#@]+'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 35 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings 36 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 40 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword 41 | ]; 42 | } 43 | 44 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 45 | Brush.aliases = ['scala']; 46 | 47 | SyntaxHighlighter.brushes.Scala = Brush; 48 | 49 | // CommonJS 50 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 51 | })(); 52 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushTAP.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | /** 18 | * SyntaxHighlighter 19 | * http://alexgorbatchev.com/SyntaxHighlighter 20 | * 21 | * @license 22 | * Dual licensed under the MIT and GPL licenses. 23 | */ 24 | ;(function() 25 | { 26 | // CommonJS 27 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 28 | 29 | function Brush() { 30 | // Contributed by Chad Granum 31 | this.regexList = [ 32 | // Plan 33 | { regex: new RegExp('^1..\\d+', 'gm'), css: 'plain bold italic' }, 34 | 35 | // Match ok, not ok, and with test numbers 36 | { regex: new RegExp('^ok( \\d+)?', 'gm'), css: 'keyword' }, 37 | { regex: new RegExp('^not ok( \\d+)?', 'gm'), css: 'color3 bold' }, 38 | 39 | // Directives 40 | { regex: new RegExp('(?!^\\s*)#.*$', 'gm'), css: 'variable bold' }, 41 | 42 | // Diagnostics 43 | { regex: new RegExp('^#.*$', 'gm'), css: 'comments bold' }, 44 | 45 | // comments 46 | { regex: new RegExp('^(?!(not )?ok)[^1].*$', 'gm'), css: 'comments' }, 47 | 48 | // Quoted items in messages 49 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 50 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 51 | ]; 52 | } 53 | 54 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 55 | Brush.aliases = ['tap', 'Tap', 'TAP']; 56 | 57 | SyntaxHighlighter.brushes.TAP = Brush; 58 | 59 | // CommonJS 60 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 61 | })(); 62 | 63 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushTypeScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | // Brush for the TypeScript language 18 | // Based on the JavaScript brush - shBrushJScript.js - with some minor alterations 19 | 20 | ; (function () 21 | { 22 | // CommonJS 23 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 24 | 25 | function Brush() 26 | { 27 | var keywords = 'break case catch class continue ' + 28 | 'default delete do else enum export extends false ' + 29 | 'for function if implements import in instanceof ' + 30 | 'interface let new null package private protected ' + 31 | 'static return super switch ' + 32 | 'this throw true try typeof var while with yield' + 33 | ' any bool declare get module number public set string'; // TypeScript-specific, everything above is common with JavaScript 34 | 35 | var r = SyntaxHighlighter.regexLib; 36 | 37 | this.regexList = [ 38 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 39 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 40 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 41 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 42 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 43 | ]; 44 | 45 | this.forHtmlScript(r.scriptScriptTags); 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['ts', 'typescript']; 50 | 51 | SyntaxHighlighter.brushes.TypeScript = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /html/lib/syntaxhighlighter/scripts/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (Fri, 07 Jun 2013 03:47:38 GMT) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2013 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); 21 | 22 | function Brush() 23 | { 24 | function process(match, regexInfo) 25 | { 26 | var constructor = SyntaxHighlighter.Match, 27 | code = match[0], 28 | tag = XRegExp.exec(code, XRegExp('(<|<)[\\s\\/\\?!]*(?[:\\w-\\.]+)', 'xg')), 29 | result = [] 30 | ; 31 | 32 | if (match.attributes != null) 33 | { 34 | var attributes, 35 | pos = 0, 36 | regex = XRegExp('(? [\\w:.-]+)' + 37 | '\\s*=\\s*' + 38 | '(? ".*?"|\'.*?\'|\\w+)', 39 | 'xg'); 40 | 41 | while ((attributes = XRegExp.exec(code, regex, pos)) != null) 42 | { 43 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 44 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 45 | pos = attributes.index + attributes[0].length; 46 | } 47 | } 48 | 49 | if (tag != null) 50 | result.push( 51 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 52 | ); 53 | 54 | return result; 55 | } 56 | 57 | this.regexList = [ 58 | { regex: XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 59 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // 60 | { regex: XRegExp('(<|<)[\\s\\/\\?!]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 61 | ]; 62 | }; 63 | 64 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 65 | Brush.aliases = ['xml', 'xhtml', 'xslt', 'html', 'plist']; 66 | 67 | SyntaxHighlighter.brushes.Xml = Brush; 68 | 69 | // CommonJS 70 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 71 | })(); 72 | -------------------------------------------------------------------------------- /html/views/blame/blame.css: -------------------------------------------------------------------------------- 1 | table { 2 | border-collapse: collapse !important; 3 | border-spacing: 0 !important; 4 | } 5 | 6 | body,th, td { 7 | margin: 0 !important; 8 | padding: 0 !important; 9 | border: 0 !important; 10 | outline: 0 !important; 11 | font-size: 100% !important; 12 | vertical-align: baseline !important; 13 | background: transparent !important; 14 | } 15 | 16 | p.summary { 17 | } 18 | 19 | p{ 20 | margin: 0 !important; 21 | padding: 0 !important; 22 | font-size: 11px; 23 | font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; 24 | white-space: nowrap; 25 | } 26 | 27 | pre{ 28 | font-size: 1em; 29 | font-family: Menlo, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; 30 | } 31 | 32 | tr.block.l3 p.summary, 33 | tr.block.l2 p.summary, 34 | tr.block.l1 p.summary{ 35 | display: none !important; 36 | } 37 | 38 | table.blocks td { 39 | vertical-align: top !important; 40 | } 41 | 42 | p.author { 43 | white-space: nowrap !important; 44 | } 45 | 46 | table.blocks { 47 | font: 11px "Menlo" !important !important; 48 | } 49 | 50 | table tr.block{ 51 | border-top: 1px solid #c9c9c9 !important; 52 | } 53 | table.blocks{ 54 | border-bottom: 1px solid #c9c9c9 !important; 55 | width: 100% !important; 56 | } 57 | 58 | table.blocks tr td:nth-of-type(1) { 59 | background-color: #ececec !important; 60 | border-right: 1px solid #c9c9c9 !important; 61 | } 62 | 63 | table.blocks tr td:nth-of-type(2) { 64 | width: 100% !important; 65 | padding-left: 1em !important; 66 | } 67 | 68 | table.blocks tr.block td:nth-of-type(1){ 69 | padding-right: 5px !important; 70 | padding-left: 5px !important; 71 | } -------------------------------------------------------------------------------- /html/views/blame/blame.js: -------------------------------------------------------------------------------- 1 | var showFile = function(txt) { 2 | $("txt").style.display = ""; 3 | $("txt").innerHTML="
"+txt+"
"; 4 | 5 | SyntaxHighlighter.defaults['toolbar'] = false; 6 | 7 | SyntaxHighlighter.highlight(); 8 | return; 9 | } 10 | 11 | var selectCommit = function(a) { 12 | Controller.selectCommit_(a); 13 | } -------------------------------------------------------------------------------- /html/views/blame/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
hola 13 | 14 | -------------------------------------------------------------------------------- /html/views/commit/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Diff for file 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

18 | 19 | Context: 20 | Nothing to commit 21 | 22 |

23 | 24 | 28 | 29 | 32 |
33 | Nothing to commit (working directory clean) 34 |
35 |
36 | 37 | -------------------------------------------------------------------------------- /html/views/commit/multipleSelection.js: -------------------------------------------------------------------------------- 1 | var showMultipleFilesSelection = function(files) 2 | { 3 | hideNotification(); 4 | setTitle(""); 5 | 6 | var div = $("diff"); 7 | 8 | var contents = '
' + 9 | '
Multiple Selection
'; 10 | 11 | contents += "
    "; 12 | 13 | for (var i = 0; i < files.length; ++i) 14 | { 15 | var file = files[i]; 16 | contents += "
  • " + file.path + "
  • "; 17 | } 18 | contents += "
"; 19 | 20 | div.innerHTML = contents; 21 | div.style.display = ""; 22 | } -------------------------------------------------------------------------------- /html/views/diff/diffWindow.css: -------------------------------------------------------------------------------- 1 | #message { 2 | margin-left: 20px; 3 | margin-right: 20px; 4 | margin-top: 40px; 5 | text-align: center; 6 | font-size: 200%; 7 | padding: 20px; 8 | width: auto; 9 | 10 | background-color: #B4D7FF; 11 | border: 2px solid #45A1FE; 12 | 13 | -webkit-border-radius: 10px; 14 | } -------------------------------------------------------------------------------- /html/views/diff/diffWindow.js: -------------------------------------------------------------------------------- 1 | // for diffs shown in the PBDiffWindow 2 | 3 | var setMessage = function(message) { 4 | $("message").style.display = ""; 5 | $("message").innerHTML = message.escapeHTML(); 6 | $("diff").style.display = "none"; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /html/views/diff/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Details for commit 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 | 22 | 25 |
26 | 27 | -------------------------------------------------------------------------------- /html/views/fileview/index_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | //
15 | //  AppController.h
16 | //  MGScopeBar
17 | //
18 | //  Created by Matt Gemmell on 16/03/2008.
19 | //
20 | 
21 | /* dhfas fldsa */
22 | 
23 | /*
24 | fjdsahf dsaf dlsaf jd;sa
25 | fdjksal; fjhdsa
26 | */
27 | 
28 | #import <Cocoa/Cocoa.h>
29 | #import "MGScopeBarDelegateProtocol.h"
30 | 
31 | 
32 | /* dhfas fldsa */
33 | 
34 | @interface AppController : NSObject  {
35 | 	IBOutlet NSTextField *labelField;
36 | 	IBOutlet MGScopeBar *scopeBar;
37 | 	IBOutlet NSView *accessoryView;
38 | 	NSMutableArray *groups;
39 | }
40 | 
41 | @property(retain) NSMutableArray *groups;
42 | 
43 | @end
44 | 
45 | 46 |
47 | 48 | -------------------------------------------------------------------------------- /html/views/fileview/source.css: -------------------------------------------------------------------------------- 1 | body, html, #source { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | -------------------------------------------------------------------------------- /html/views/log/format.html: -------------------------------------------------------------------------------- 1 |
2 |

%s

3 | 4 | 5 | 6 | 7 |
Author:%aN
Date:%ar
Commit:%H
8 |
9 | -------------------------------------------------------------------------------- /html/views/log/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Details for commit 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 |
20 | 21 | -------------------------------------------------------------------------------- /html/views/log/log.css: -------------------------------------------------------------------------------- 1 | .commit table tr td:nth-of-type(1){ 2 | text-align: right; 3 | color: gray; 4 | } 5 | 6 | .commit{ 7 | margin: 10px; 8 | padding: 10px; 9 | border-radius: 10px; 10 | border: 1px solid #CCC; 11 | -webkit-box-shadow: 1px 1px 2px #DDD; 12 | } -------------------------------------------------------------------------------- /html/views/log/log.js: -------------------------------------------------------------------------------- 1 | var selectCommit = function(a) { 2 | window.Controller.selectCommit_(a); 3 | return false; 4 | } 5 | 6 | var showFile = function(txt) { 7 | $("log").style.display = ""; 8 | $("log").innerHTML=txt; 9 | return; 10 | } 11 | -------------------------------------------------------------------------------- /html/views/source/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | -------------------------------------------------------------------------------- /html/views/source/source.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rowanj/gitx/ce17d079d2563baf5c54ed6c49d6dcc05deffad4/html/views/source/source.css -------------------------------------------------------------------------------- /html/views/source/source.js: -------------------------------------------------------------------------------- 1 | var showFile = function(txt) { 2 | $("source").style.display = ""; 3 | $("source").innerHTML="
"+txt+"
"; 4 | 5 | SyntaxHighlighter.defaults['toolbar'] = false; 6 | SyntaxHighlighter.highlight(); 7 | 8 | return; 9 | } 10 | -------------------------------------------------------------------------------- /package.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Original work by Rowan James 4 | # This is free and unencumbered software released into the public domain. 5 | # http://unlicense.org 6 | 7 | import argparse 8 | import subprocess 9 | import tempfile 10 | import shutil 11 | import os 12 | 13 | def package(app, bundle, name, verbose=False): 14 | appBase = os.path.dirname(app) 15 | appName = os.path.basename(app) 16 | tmp_dir = tempfile.mkdtemp(dir=appBase) 17 | movedApp = os.path.join(tmp_dir, appName) 18 | shutil.move(app, movedApp) 19 | 20 | if verbose: 21 | print('appBase: ' + appBase) 22 | print('appName: ' + appName) 23 | print('tmp_dir: ' + tmp_dir) 24 | 25 | hdiutil = ['hdiutil', 26 | 'create', bundle, 27 | '-srcfolder', tmp_dir, 28 | '-volname', name] 29 | 30 | subprocess.call(hdiutil) 31 | shutil.move(movedApp, app) 32 | shutil.rmtree(tmp_dir) 33 | 34 | if __name__ == "__main__": 35 | parser = argparse.ArgumentParser(description='Package an app into a redistributable DMG') 36 | parser.add_argument('--app', 37 | required=True, 38 | help='the app bundle to package') 39 | parser.add_argument('--output','-o', 40 | required=True, 41 | help='the destination file name') 42 | parser.add_argument('--name','-n', 43 | required=True, 44 | help='the name given to the volume') 45 | parser.add_argument('--verbose','-v', 46 | help='show details of signing process', 47 | action='count') 48 | 49 | args = parser.parse_args() 50 | 51 | package(args.app, args.output, args.name, args.verbose) 52 | 53 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | argcomplete==0.8.0 2 | argh==0.24.1 3 | -------------------------------------------------------------------------------- /updates/.gitignore: -------------------------------------------------------------------------------- 1 | *.key 2 | *.xml 3 | -------------------------------------------------------------------------------- /updates/GitX-dev.xml.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GitX-dev Changelog 5 | http://builds.phere.net/GitX/development/GitX-dev.xml 6 | Most recent changes with links to updates. 7 | en 8 | 9 | 10 | GitX-dev 0.15.$build_number 11 | http://builds.phere.net/GitX/development/GitX-dev-$build_number.html 12 | 10.8.0 13 | $pub_date 14 | 15 | 16 | 17 | GitX-dev 0.15.1949 18 | http://builds.phere.net/GitX/development/GitX-dev-1949.html 19 | 10.7.0 20 | Sun, 27 Jul 2014 06:50:09 -0000 21 | 22 | 23 | 24 | GitX-dev 0.14.81 25 | http://builds.phere.net/GitX/development/GitX-dev-81.html 26 | 10.6.0 27 | Sat, 08 Jun 2013 05:24:55 -0000 28 | 29 | 30 | 31 | 32 | --------------------------------------------------------------------------------