├── .gitattributes ├── .gitignore ├── .gitmodules ├── COPYING ├── Cartfile ├── Cartfile.resolved ├── Classes ├── Controllers │ ├── ApplicationController.h │ ├── ApplicationController.m │ ├── OpenRecentController.h │ ├── OpenRecentController.m │ ├── PBDiffWindowController.h │ ├── PBDiffWindowController.m │ ├── PBGitCommitController.h │ ├── PBGitCommitController.m │ ├── PBGitHistoryController.h │ ├── PBGitHistoryController.m │ ├── PBGitRepositoryDocument.h │ ├── PBGitRepositoryDocument.m │ ├── PBGitSidebarController.h │ ├── PBGitSidebarController.m │ ├── PBGitWindowController.h │ ├── PBGitWindowController.m │ ├── PBHistorySearchController.h │ ├── PBHistorySearchController.m │ ├── PBHistorySearchMode.h │ ├── PBHistorySearchMode.m │ ├── PBOpenShallowRepositoryErrorRecoveryAttempter.h │ ├── PBOpenShallowRepositoryErrorRecoveryAttempter.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 ├── NSSplitView+GitX.h ├── NSSplitView+GitX.m ├── PBChangedFile.h ├── PBChangedFile.m ├── PBCommitList.h ├── PBCommitList.m ├── PBGraphCellInfo.h ├── PBGraphCellInfo.m ├── PBMacros.h ├── PBMacros.m ├── PBNSURLPathUserDefaultsTransfomer.h ├── PBNSURLPathUserDefaultsTransfomer.m ├── PBRefContextDelegate.h ├── PBUnsortableTableHeader.h ├── PBUnsortableTableHeader.m ├── Terminal.h ├── Util │ ├── GitXCommitCopier.h │ ├── GitXCommitCopier.m │ ├── NSApplication+GitXScripting.h │ ├── NSApplication+GitXScripting.m │ ├── NSFileHandleExt.h │ ├── NSFileHandleExt.m │ ├── NSOutlineViewExt.h │ ├── NSOutlineViewExt.m │ ├── NSString_Truncate.h │ ├── NSString_Truncate.m │ ├── ObjectiveGit+PBCategories.h │ ├── ObjectiveGit+PBCategories.m │ ├── PBEasyFS.h │ ├── PBEasyFS.m │ ├── PBEasyPipe.h │ ├── PBEasyPipe.m │ ├── PBError.h │ ├── PBError.m │ ├── PBTask.h │ ├── PBTask.m │ ├── PBTerminalUtil.h │ ├── PBTerminalUtil.m │ ├── RJModalRepoSheet.h │ └── RJModalRepoSheet.m ├── Views │ ├── GLFileView.h │ ├── GLFileView.m │ ├── GitXTextFieldCell.h │ ├── GitXTextFieldCell.m │ ├── GitXTextView.h │ ├── GitXTextView.m │ ├── PBAddRemoteSheet.h │ ├── PBAddRemoteSheet.m │ ├── PBCloneRepositoryPanel.h │ ├── PBCloneRepositoryPanel.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 │ ├── 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.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 │ ├── PBGitRepository_PBGitBinarySupport.h │ ├── PBGitRepository_PBGitBinarySupport.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 │ ├── PBGitSVStashItem.h │ ├── PBGitSVStashItem.m │ ├── PBGitSVSubmoduleItem.h │ ├── PBGitSVSubmoduleItem.m │ ├── PBGitSVTagItem.h │ ├── PBGitSVTagItem.m │ ├── PBGitStash.h │ ├── PBGitStash.m │ ├── PBGitTree.h │ ├── PBGitTree.m │ ├── PBGitXProtocol.h │ ├── PBGitXProtocol.m │ ├── PBRepositoryFinder.h │ └── PBRepositoryFinder.m ├── gitx.m ├── gitx_askpasswd_main.m └── main.m ├── Documentation ├── CallingFromWebKit.txt ├── GraphingAPI.txt ├── README └── Screenshot.png ├── GitX.xcodeproj ├── .gitignore ├── project.pbxproj ├── project.xcworkspace │ ├── .gitignore │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ └── GitX.xcscheme ├── README.markdown ├── Resources ├── Base.lproj │ ├── MainMenu.xib │ ├── PBAddRemoteSheet.xib │ ├── PBCloneRepositoryPanel.xib │ ├── PBCreateBranchSheet.xib │ ├── PBCreateTagSheet.xib │ ├── PBRemoteProgressSheet.xib │ └── RepositoryWindow.xib ├── English.lproj │ └── InfoPlist.strings ├── GitX.entitlements ├── GitX.h ├── GitX.sdef ├── GitX_Prefix.pch ├── Images.xcassets │ ├── AppIcon-gitx.appiconset │ │ ├── Contents.json │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ └── icon_512x512@2x.png │ └── Contents.json ├── 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 │ ├── PullTemplate.pdf │ ├── PushTemplate.pdf │ ├── RebaseTemplate.pdf │ ├── RemoteBranchTemplate.pdf │ ├── RemoteTemplate.pdf │ ├── StageTemplate.pdf │ ├── TagTemplate.pdf │ ├── TreeViewTemplate.pdf │ ├── deleted_file.pdf │ ├── empty_file.pdf │ ├── gitx-16.svg │ ├── gitx-32.svg │ ├── gitx.html │ ├── mainSplitterBar.tiff │ ├── mainSplitterDimple.tiff │ ├── new_file.pdf │ └── rewindImage.pdf ├── Info-gitx.plist ├── Info.plist ├── UpdateKey.pem ├── XIBs │ ├── OpenRecentPopup.xib │ ├── PBCommitHookFailedSheet.xib │ ├── PBDiffWindow.xib │ ├── PBGitCommitView.xib │ ├── PBGitHistoryView.xib │ ├── PBGitSidebarView.xib │ └── PBGitXMessageSheet.xib ├── html │ ├── convert.playground │ │ ├── Contents.swift │ │ ├── contents.xcplayground │ │ └── playground.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── 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 │ │ ├── index.html │ │ ├── log.css │ │ ├── log.js │ │ └── test.html │ │ └── source │ │ ├── index.html │ │ ├── source.css │ │ └── source.js └── source.css ├── Scripts ├── appcast.py ├── build.py ├── package.py └── sign.py ├── 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 └── 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 | DerivedData/ 4 | /release/ 5 | .DS_Store 6 | __pycache__/ 7 | *.pyc 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "SyntaxHighlighter"] 2 | path = External/SyntaxHighlighter 3 | url = https://github.com/alexgorbatchev/SyntaxHighlighter.git 4 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "libgit2/objective-git" # still 0.x releases :( 2 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "libgit2/objective-git" "0.14.1" 2 | -------------------------------------------------------------------------------- /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)showAboutPanel:(id)sender; 24 | 25 | - (IBAction)showHelp:(id)sender; 26 | - (IBAction)showChangeLog:(id)sender; 27 | - (IBAction)reportAProblem:(id)sender; 28 | 29 | - (IBAction)showCloneRepository:(id)sender; 30 | @end 31 | -------------------------------------------------------------------------------- /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 | 15 | + (void)showDiff:(NSString *)diff; 16 | + (void)showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit; 17 | - (instancetype)initWithDiff:(NSString *)diff; 18 | 19 | @property (readonly) NSString *diff; 20 | @end 21 | -------------------------------------------------------------------------------- /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 | 17 | + (void)showDiff:(NSString *)diff 18 | { 19 | PBDiffWindowController *diffController = [[self alloc] initWithDiff:diff]; 20 | [diffController showWindow:self]; 21 | } 22 | 23 | + (void)showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit 24 | { 25 | NSParameterAssert(startCommit != nil); 26 | NSString *diff = [startCommit.repository performDiff:startCommit against:diffCommit forFiles:filePaths]; 27 | 28 | [PBDiffWindowController showDiff:[diff copy]]; 29 | } 30 | 31 | - (id)initWithDiff:(NSString *)aDiff 32 | { 33 | self = [super initWithWindowNibName:@"PBDiffWindow"]; 34 | if (!self) return nil; 35 | 36 | _diff = aDiff; 37 | 38 | return self; 39 | } 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /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 PBGitIndex; 13 | 14 | @interface PBGitCommitController : PBViewController 15 | 16 | - (IBAction) refresh:(id) sender; 17 | - (IBAction) commit:(id) sender; 18 | - (IBAction) forceCommit:(id) sender; 19 | - (IBAction) signOff:(id)sender; 20 | 21 | - (PBGitIndex *) index; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/Controllers/PBGitRepositoryDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRepositoryDocument.h 3 | // GitX 4 | // 5 | // Created by Etienne on 31/07/2014. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | @class PBGitRevSpecifier; 13 | @class PBGitWindowController; 14 | 15 | extern NSString *PBGitRepositoryDocumentType; 16 | 17 | @interface PBGitRepositoryDocument : NSDocument 18 | 19 | @property (nonatomic, strong, readonly) PBGitRepository *repository; 20 | 21 | 22 | // Scripting Bridge 23 | - (void)findInModeScriptCommand:(NSScriptCommand *)command; 24 | 25 | - (IBAction)showCommitView:(id)sender; 26 | - (IBAction)showHistoryView:(id)sender; 27 | 28 | - (void)selectRevisionSpecifier:(PBGitRevSpecifier *)specifier; 29 | 30 | - (PBGitWindowController *)windowController; 31 | 32 | - (void)handleGitXScriptingArguments:(NSArray *)arguments; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /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 | #import "PBHistorySearchMode.h" 12 | 13 | @class PBSourceViewItem; 14 | @class PBGitHistoryController; 15 | @class PBGitCommitController; 16 | 17 | @interface PBGitSidebarController : PBViewController { 18 | __weak IBOutlet NSWindow *window; 19 | __weak IBOutlet NSOutlineView *sourceView; 20 | __weak IBOutlet NSView *sourceListControlsView; 21 | __weak IBOutlet NSPopUpButton *actionButton; 22 | __weak IBOutlet NSSegmentedControl *remoteControls; 23 | 24 | NSMutableArray *items; 25 | 26 | /* Specific things */ 27 | PBSourceViewItem *stage; 28 | 29 | PBSourceViewItem *branches, *remotes, *tags, *others, *submodules, *stashes; 30 | } 31 | 32 | - (void) selectStage; 33 | - (void) selectCurrentBranch; 34 | 35 | - (NSMenu *) menuForRow:(NSInteger)row; 36 | - (void) menuNeedsUpdate:(NSMenu *)menu; 37 | 38 | - (IBAction) fetchPullPushAction:(id)sender; 39 | 40 | @property(readonly) NSMutableArray *items; 41 | @property(readonly) PBSourceViewItem *remotes; 42 | @property(readonly) NSOutlineView *sourceView; 43 | @property(readonly) NSView *sourceListControlsView; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /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 | #import "PBHistorySearchMode.h" 11 | 12 | @class PBGitHistoryController; 13 | @class PBTask; 14 | 15 | @interface PBHistorySearchController : NSObject { 16 | PBHistorySearchMode searchMode; 17 | NSIndexSet *results; 18 | NSTimer *searchTimer; 19 | PBTask *backgroundSearchTask; 20 | NSPanel *rewindPanel; 21 | } 22 | 23 | @property (weak) IBOutlet PBGitHistoryController *historyController; 24 | @property (weak) IBOutlet NSArrayController *commitController; 25 | 26 | @property (weak) IBOutlet NSSearchField *searchField; 27 | @property (weak) IBOutlet NSSegmentedControl *stepper; 28 | @property (weak) IBOutlet NSTextField *numberOfMatchesField; 29 | @property (weak) IBOutlet NSProgressIndicator *progressIndicator; 30 | 31 | @property PBHistorySearchMode searchMode; 32 | 33 | 34 | - (BOOL)isRowInSearchResults:(NSInteger)rowIndex; 35 | - (BOOL)hasSearchResults; 36 | 37 | - (void)selectSearchMode:(id)sender; 38 | 39 | - (void)selectNextResult; 40 | - (void)selectPreviousResult; 41 | - (IBAction)stepperPressed:(id)sender; 42 | 43 | - (void)clearSearch; 44 | - (IBAction)updateSearch:(id)sender; 45 | 46 | - (void)setHistorySearch:(NSString *)searchString mode:(PBHistorySearchMode)mode; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Classes/Controllers/PBHistorySearchMode.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBHistorySearchMode.h 3 | // GitX 4 | // 5 | // Created by Sven-S. Porst on 2016-12-14 6 | // 7 | 8 | #import 9 | 10 | #ifndef PBHistorySearchMode_h 11 | #define PBHistorySearchMode_h 12 | 13 | 14 | typedef NS_ENUM(NSInteger, PBHistorySearchMode) { 15 | PBHistorySearchModeBasic = 1, 16 | PBHistorySearchModePickaxe, 17 | PBHistorySearchModeRegex, 18 | PBHistorySearchModePath, 19 | PBHistorySearchModeMax // always keep this item last 20 | } ; 21 | 22 | 23 | PBHistorySearchMode PBSearchModeForInteger(NSInteger modeInteger); 24 | 25 | 26 | #endif /* PBHistorySearchMode_h */ 27 | -------------------------------------------------------------------------------- /Classes/Controllers/PBHistorySearchMode.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBHistorySearchMode.m 3 | // GitX 4 | // 5 | // Created by Sven-S. Porst on 2016-12-14. 6 | // 7 | 8 | #import "PBHistorySearchMode.h" 9 | 10 | PBHistorySearchMode PBSearchModeForInteger(NSInteger modeInteger) { 11 | if (modeInteger >= PBHistorySearchModeBasic && modeInteger < PBHistorySearchModeMax) { 12 | return (PBHistorySearchMode)modeInteger; 13 | } 14 | return PBHistorySearchModeBasic; 15 | } 16 | -------------------------------------------------------------------------------- /Classes/Controllers/PBOpenShallowRepositoryErrorRecoveryAttempter.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBOpenShallowRepositoryErrorRecoveryAttempter.h 3 | // GitX 4 | // 5 | // Created by Sven on 07.08.16. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface PBOpenShallowRepositoryErrorRecoveryAttempter : NSObject 12 | 13 | - (instancetype) initWithURL:(NSURL *)url; 14 | 15 | + (NSArray*) errorDialogButtonNames; 16 | 17 | @end -------------------------------------------------------------------------------- /Classes/Controllers/PBOpenShallowRepositoryErrorRecoveryAttempter.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBOpenShallowRepositoryErrorRecoveryAttempter.m 3 | // GitX 4 | // 5 | // Created by Sven on 07.08.16. 6 | // 7 | 8 | #import "PBOpenShallowRepositoryErrorRecoveryAttempter.h" 9 | #import "PBTerminalUtil.h" 10 | 11 | 12 | @implementation PBOpenShallowRepositoryErrorRecoveryAttempter 13 | 14 | NSURL * workingDirectory; 15 | 16 | - (instancetype) initWithURL:(NSURL *)url { 17 | if (self != nil) { 18 | workingDirectory = url; 19 | } 20 | return self; 21 | } 22 | 23 | - (BOOL)attemptRecoveryFromError:(NSError *)error 24 | optionIndex:(NSUInteger)recoveryOptionIndex { 25 | 26 | if (recoveryOptionIndex == 1) { 27 | NSString * unshallowCommand = @"echo 'Please re-open the repository in GitX once unshallowing has finished.'; git fetch --unshallow"; 28 | [PBTerminalUtil runCommand:unshallowCommand inDirectory:workingDirectory]; 29 | return NO; 30 | } 31 | return NO; 32 | } 33 | 34 | + (NSArray*) errorDialogButtonNames { 35 | return @[ 36 | NSLocalizedString(@"OK", @"OK"), 37 | NSLocalizedString(@"Run command in Terminal", @"Button to run unshallow command in Terminal")]; 38 | } 39 | 40 | @end -------------------------------------------------------------------------------- /Classes/Controllers/PBRefController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRefController.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 "PBRefContextDelegate.h" 11 | 12 | @class PBGitHistoryController, PBCommitList; 13 | 14 | @interface PBRefController : NSObject { 15 | __weak IBOutlet PBGitHistoryController *historyController; 16 | __weak IBOutlet NSArrayController *commitController; 17 | __weak IBOutlet PBCommitList *commitList; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /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 | @end 13 | -------------------------------------------------------------------------------- /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 "PBGitRepositoryDocument.h" 11 | #import "PBGitRevList.h" 12 | #import "PBGitBinary.h" 13 | 14 | #import 15 | 16 | @implementation PBRepositoryDocumentController 17 | // This method is overridden to configure the open panel to only allow 18 | // selection of directories 19 | - (void)beginOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)inTypes completionHandler:(void (^)(NSInteger))completionHandler { 20 | [openPanel setCanChooseFiles:YES]; 21 | [openPanel setCanChooseDirectories:YES]; 22 | [openPanel setAllowedFileTypes:[NSArray arrayWithObject:@"git"]]; 23 | 24 | NSModalResponse response = [openPanel runModal]; 25 | 26 | completionHandler(response); 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:NSLocalizedString(@"Initialize a repository here:", @"Message at the top of the repository initialisation file selection dialogue box")]; 36 | [op setTitle:NSLocalizedString(@"New Repository", @"Title of the repository initialisation file selection dialogue box")]; 37 | if ([op runModal] != NSFileHandlingPanelOKButton) { 38 | if (outError) { 39 | *outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]; 40 | } 41 | return nil; 42 | } 43 | 44 | GTRepository *repo = [GTRepository initializeEmptyRepositoryAtFileURL:[op URL] options:nil error:outError]; 45 | if (!repo) 46 | return nil; // Repo creation failed 47 | 48 | return [[PBGitRepositoryDocument 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 YES; 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 | - (void)completeSha:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /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 "PBGitRepositoryDocument.h" 11 | #import "PBGitRepository.h" 12 | #import "PBGitRepository_PBGitBinarySupport.h" 13 | 14 | @implementation PBServicesController 15 | 16 | - (NSString *)completeSHA1For:(NSString *)sha error:(NSString **)error 17 | { 18 | NSArray *documents = [[NSApplication sharedApplication] orderedDocuments]; 19 | for (PBGitRepositoryDocument *doc in documents) 20 | { 21 | NSError *error = nil; 22 | NSString *s = [doc.repository outputOfTaskWithArguments:@[@"log", @"-1", @"--pretty=format:%h (%s)", sha] error:&error]; 23 | if (s) { 24 | return s; 25 | } 26 | } 27 | 28 | if (error) *error = @"Unable to resolve SHA in opened repositories"; 29 | return nil; 30 | } 31 | 32 | - (NSString *)runNameRevFor:(NSString *)s error:(NSString **)errorStr 33 | { 34 | NSArray *repositories = [[NSApplication sharedApplication] orderedDocuments]; 35 | if ([repositories count] == 0) 36 | return s; 37 | PBGitRepositoryDocument *doc = [repositories objectAtIndex:0]; 38 | 39 | NSError *error = nil; 40 | PBTask *task = [doc.repository taskWithArguments:@[]]; 41 | task.standardInputData = [s dataUsingEncoding:NSUTF8StringEncoding]; 42 | BOOL success = [task launchTask:&error]; 43 | 44 | if (success) { 45 | return task.standardOutputString; 46 | } else { 47 | PBLogError(error); 48 | } 49 | 50 | if (errorStr) *errorStr = @"Unable to resolve SHA in opened repositories"; 51 | return nil; 52 | } 53 | 54 | - (void)completeSha:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error 55 | { 56 | NSArray *types = [pboard types]; 57 | if (![types containsObject:NSStringPboardType]) 58 | { 59 | *error = @"Could not get data"; 60 | return; 61 | } 62 | 63 | NSString *s = [pboard stringForType:NSStringPboardType]; 64 | if ([s rangeOfString:@" "].location == NSNotFound) 65 | s = [self completeSHA1For:s error:error]; 66 | else 67 | s = [self runNameRevFor:s error:error]; 68 | 69 | if (!s) return; 70 | 71 | [pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 72 | [pboard setString:s forType:NSStringPboardType]; 73 | } 74 | @end 75 | -------------------------------------------------------------------------------- /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 | 11 | #import "PBGitRepository.h" 12 | #import "PBGitWindowController.h" 13 | 14 | @interface PBViewController : NSViewController { 15 | // FIXME: these ivars must go, but most controller out there access it directly, so, not today 16 | PBGitRepository *repository; 17 | __weak PBGitWindowController *superController; 18 | } 19 | 20 | @property (nonatomic, strong, readonly) PBGitRepository *repository; 21 | @property (weak, readonly) PBGitWindowController *windowController; 22 | @property (copy) NSString *status; 23 | @property (assign) BOOL isBusy; 24 | 25 | - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; 26 | 27 | /* closeView is called when the repository window will be closed */ 28 | - (void)closeView; 29 | 30 | /* Updateview is called every time it is loaded into the main view */ 31 | - (void) updateView; 32 | 33 | - (NSResponder *)firstResponder; 34 | - (IBAction) refresh:(id)sender; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /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 | @interface PBViewController () { 12 | BOOL _hasViewLoaded; 13 | } 14 | @end 15 | 16 | @implementation PBViewController 17 | 18 | @synthesize repository=repository; 19 | @synthesize windowController=superController; 20 | 21 | - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller 22 | { 23 | NSString *nibName = [[[self class] description] stringByReplacingOccurrencesOfString:@"Controller" 24 | withString:@"View"]; 25 | self = [self initWithNibName:nibName bundle:nil]; 26 | if (!self) return nil; 27 | 28 | repository = theRepository; 29 | superController = controller; 30 | 31 | return self; 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 | @end 61 | -------------------------------------------------------------------------------- /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 *stagedFilesController; 19 | __weak 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 | NSString *startFile; 14 | BOOL finishedLoading; 15 | 16 | // For async git reading 17 | NSMapTable *callbacks; 18 | 19 | // For the repository access 20 | __weak IBOutlet id repository; 21 | } 22 | 23 | @property (weak) IBOutlet WebView *view; 24 | @property NSString *startFile; 25 | @property (weak) 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 = self.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 | __weak IBOutlet PBGitHistoryController* historyController; 22 | __weak IBOutlet id contextMenuDelegate; 23 | 24 | GTOID *currentOID; 25 | NSString* diff; 26 | } 27 | 28 | - (void) sendKey: (NSString*) key; 29 | 30 | @property (readonly) NSString* diff; 31 | 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 @"com.codebasesaga.macOS.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/NSSplitView+GitX.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSSplitView+GitX.h 3 | // GitX 4 | // 5 | // Created by Kent Sutherland on 4/25/17. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSSplitView (GitX) 12 | 13 | - (void)pb_restoreAutosavedPositions; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/NSSplitView+GitX.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSSplitView+GitX.m 3 | // GitX 4 | // 5 | // Created by Kent Sutherland on 4/25/17. 6 | // 7 | // 8 | 9 | #import "NSSplitView+GitX.h" 10 | 11 | @implementation NSSplitView (GitX) 12 | 13 | // Taken from http://stackoverflow.com/questions/16587058/nssplitview-auto-saving-divider-positions-doesnt-work-with-auto-layout-enable 14 | // Without this split views don't automatically restore for windows that aren't reopened by state restoration 15 | - (void)pb_restoreAutosavedPositions 16 | { 17 | NSString *key = [NSString stringWithFormat:@"NSSplitView Subview Frames %@", self.autosaveName]; 18 | NSArray *subviewFrames = [[NSUserDefaults standardUserDefaults] objectForKey:key]; 19 | 20 | // the last frame is skipped because I have one less divider than I have frames 21 | for (NSInteger i = 0; i < subviewFrames.count; i++) { 22 | if (i < self.subviews.count) { // safety-check (in case number of views have been removed while dev) 23 | // this is the saved frame data - it's an NSString 24 | NSString *frameString = subviewFrames[i]; 25 | NSArray *components = [frameString componentsSeparatedByString:@", "]; 26 | 27 | // Manage the 'hidden state' per view 28 | BOOL hidden = [components[4] boolValue]; 29 | NSView *subview = [self subviews][i]; 30 | 31 | [subview setHidden:hidden]; 32 | 33 | // Set height (horizontal) or width (vertical) 34 | if(![self isVertical]) { 35 | CGFloat height = [components[3] floatValue]; 36 | 37 | [subview setFrameSize:NSMakeSize(subview.frame.size.width, height)]; 38 | } else { 39 | CGFloat width = [components[2] floatValue]; 40 | 41 | [subview setFrameSize:NSMakeSize(width, subview.frame.size.height)]; 42 | } 43 | } 44 | } 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /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 | 11 | @implementation PBChangedFile 12 | 13 | @synthesize path, status, hasStagedChanges, hasUnstagedChanges, commitBlobSHA, commitBlobMode; 14 | 15 | - (id) initWithPath:(NSString *)p 16 | { 17 | self = [super init]; 18 | 19 | if (self) { 20 | path = p; 21 | } 22 | return self; 23 | } 24 | 25 | - (NSString *)indexInfo 26 | { 27 | NSAssert(status == NEW || self.commitBlobSHA, @"File is not new, but doesn't have an index entry!"); 28 | if (!self.commitBlobSHA) 29 | return [NSString stringWithFormat:@"0 0000000000000000000000000000000000000000\t%@\0", self.path]; 30 | else 31 | return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path]; 32 | } 33 | 34 | - (NSImage *) icon 35 | { 36 | NSString *filename; 37 | switch (status) { 38 | case NEW: 39 | filename = @"new_file"; 40 | break; 41 | case DELETED: 42 | filename = @"deleted_file"; 43 | break; 44 | default: 45 | filename = @"empty_file"; 46 | break; 47 | } 48 | return [NSImage imageNamed:filename]; 49 | } 50 | 51 | + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector 52 | { 53 | return NO; 54 | } 55 | 56 | + (BOOL)isKeyExcludedFromWebScript:(const char *)name { 57 | return NO; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /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 | __weak IBOutlet WebView* webView; 20 | __weak IBOutlet PBWebHistoryController *webController; 21 | __weak IBOutlet PBGitHistoryController *controller; 22 | __weak 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 | 32 | @end 33 | -------------------------------------------------------------------------------- /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 | struct PBGitGraphLine *lines; 15 | long nLines; 16 | long position; 17 | long numColumns; 18 | char sign; 19 | } 20 | 21 | @property struct PBGitGraphLine *lines; 22 | @property(assign) long nLines; 23 | @property(assign) long position; 24 | @property(assign) long numColumns; 25 | @property(assign) char sign; 26 | 27 | 28 | - (id)initWithPosition:(long)p andLines:(struct PBGitGraphLine *)l; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /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 nLines, position, numColumns, sign; 14 | 15 | - (id)initWithPosition:(long)p andLines:(struct PBGitGraphLine *)l 16 | { 17 | position = p; 18 | lines = l; 19 | 20 | return self; 21 | } 22 | 23 | - (struct PBGitGraphLine*)lines 24 | { 25 | return lines; 26 | } 27 | 28 | - (void)setLines:(struct PBGitGraphLine *)l 29 | { 30 | free(lines); 31 | lines = l; 32 | } 33 | 34 | - (NSString *)description { return [self debugDescription]; } 35 | 36 | - (NSString *)debugDescription 37 | { 38 | NSMutableString *desc = [NSMutableString stringWithFormat:@"<%@: %p position: %ld numColumns: %ld nLines: %ld sign: '%c'>", 39 | NSStringFromClass([self class]), self, position, numColumns, nLines, sign]; 40 | for (int lineIndex = 0; lineIndex < nLines; lineIndex++) { 41 | struct PBGitGraphLine line = lines[lineIndex]; 42 | [desc appendString:[NSString stringWithFormat:@"\n\t", 43 | line.upper, line.from, line.to, line.colorIndex]]; 44 | } 45 | return desc; 46 | } 47 | 48 | -(void) dealloc 49 | { 50 | free(lines); 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Classes/PBMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBMacros.h 3 | // GitX 4 | // 5 | // Created by Etienne on 17/02/2017. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #define GITX_DEPRECATED __attribute__ ((deprecated)) 12 | #define GITX_DEPRECATED_MSG(x) __attribute__ ((deprecated(x))) 13 | 14 | #define PBLogFunction(x, ...) PBLogFunctionImpl(__FUNCTION__, x, ## __VA_ARGS__) 15 | #define PBLogError(x) PBLogErrorImpl(__FUNCTION__, x) 16 | 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | void PBLogFunctionImpl(const char *function, NSString *format, ...); 23 | 24 | void PBLogErrorImpl(const char *function, NSError *error); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /Classes/PBMacros.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBMacros.m 3 | // GitX 4 | // 5 | // Created by Etienne on 17/02/2017. 6 | // 7 | // 8 | 9 | #import "PBMacros.h" 10 | 11 | #include 12 | 13 | void PBLogFunctionImpl(const char *function, NSString *format, ...) { 14 | va_list arg; 15 | 16 | if (!format) { 17 | NSLog(@"%s", function); 18 | return; 19 | } 20 | 21 | va_start(arg, format); 22 | 23 | NSString *log = [[NSString alloc] initWithFormat:format arguments:arg]; 24 | 25 | va_end(arg); 26 | 27 | NSLog(@"%s: %@", function, log); 28 | } 29 | 30 | void PBLogErrorImpl(const char *function, NSError *error) { 31 | if (!error) return; 32 | NSLog(@"%s: %@", function, error); 33 | } 34 | -------------------------------------------------------------------------------- /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.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 | 10 | @class PBGitRef; 11 | @class PBGitCommit; 12 | 13 | 14 | @protocol PBRefContextDelegate 15 | - (NSArray *) menuItemsForRef:(PBGitRef *)ref; 16 | - (NSArray *) menuItemsForCommits:(NSArray *)commits; 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 | NSInteger 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 | NSInteger 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/Util/GitXCommitCopier.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitXCommitCopier.h 3 | // GitX 4 | // 5 | // Created by Sven-S. Porst on 20.12.15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @class PBGitCommit; 12 | 13 | 14 | @interface GitXCommitCopier : NSValueTransformer 15 | 16 | + (NSString * _Nonnull) toFullSHA:(NSArray * _Nonnull)commits; 17 | + (NSString * _Nonnull) toShortName:(NSArray * _Nonnull)commits; 18 | + (NSString * _Nonnull) toSHAAndHeadingString:(NSArray * _Nonnull)commits; 19 | + (NSString * _Nonnull) toPatch:(NSArray * _Nonnull)commits; 20 | 21 | + (void) putStringToPasteboard:(NSString * _Nullable)string; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/Util/GitXCommitCopier.m: -------------------------------------------------------------------------------- 1 | // 2 | // GitXCommitCopier.m 3 | // GitX 4 | // 5 | // Created by Sven-S. Porst on 20.12.15. 6 | // 7 | // 8 | 9 | #import "GitXCommitCopier.h" 10 | 11 | #import "PBGitCommit.h" 12 | 13 | @implementation GitXCommitCopier 14 | 15 | 16 | 17 | #pragma mark Readymade conversions 18 | 19 | + (NSString *) toFullSHA:(NSArray *)commits { 20 | NSArray *commitStrings = [self transformCommits:commits with:^(PBGitCommit * commit) { 21 | return commit.SHA; 22 | }]; 23 | 24 | return [commitStrings componentsJoinedByString:@"\n"]; 25 | } 26 | 27 | + (NSString *) toShortName:(NSArray *)commits { 28 | NSArray *commitStrings = [self transformCommits:commits with:^(PBGitCommit * commit) { 29 | return commit.shortName; 30 | }]; 31 | 32 | return [commitStrings componentsJoinedByString:@" "]; 33 | } 34 | 35 | + (NSString *) toSHAAndHeadingString:(NSArray *)commits { 36 | NSArray *commitStrings = [self transformCommits:commits with:^(PBGitCommit * commit) { 37 | return [NSString stringWithFormat:@"%@ (%@)", [commit.SHA substringToIndex:10], commit.subject]; 38 | }]; 39 | 40 | return [commitStrings componentsJoinedByString:@"\n"]; 41 | } 42 | 43 | + (NSString *) toPatch:(NSArray *)commits { 44 | NSArray *commitStrings = [self transformCommits:commits with:^(PBGitCommit * commit) { 45 | return commit.patch; 46 | }]; 47 | 48 | return [commitStrings componentsJoinedByString:@"\n\n\n"]; 49 | } 50 | 51 | 52 | 53 | # pragma mark Helpers 54 | 55 | + (NSArray *) transformCommits:(NSArray *)commits with:(NSString *(^)(PBGitCommit * commit))transformer { 56 | 57 | NSMutableArray *strings = [NSMutableArray arrayWithCapacity:commits.count]; 58 | [commits enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(PBGitCommit * _Nonnull commit, NSUInteger idx, BOOL * _Nonnull stop) { 59 | [strings addObject:transformer(commit)]; 60 | }]; 61 | 62 | return strings; 63 | } 64 | 65 | 66 | + (void) putStringToPasteboard:(NSString *)string { 67 | if (string.length > 0) { 68 | NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; 69 | [pasteboard declareTypes:@[NSStringPboardType] owner:self]; 70 | [pasteboard setString:string forType:NSStringPboardType]; 71 | } 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /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; 33 | long n = 0; 34 | 35 | while (1) { 36 | n = read(fd, buffer + bytesReceived, 1); 37 | 38 | if (n == 0) 39 | break; 40 | 41 | if (n < 0) { 42 | if (errno == EINTR) 43 | continue; 44 | 45 | free(buffer); 46 | NSString *reason = [NSString stringWithFormat:@"%s:%d: read() error: %s", __PRETTY_FUNCTION__, __LINE__, strerror(errno)]; 47 | [[NSException exceptionWithName:@"Socket error" reason:reason userInfo:nil] raise]; 48 | } 49 | 50 | bytesReceived++; 51 | 52 | if (bytesReceived >= bufferSize) { 53 | // Make buffer bigger 54 | bufferSize += BUFFER_SIZE; 55 | buffer = (char *)reallocf(buffer, bufferSize + 1); 56 | if (buffer == NULL) 57 | [[NSException exceptionWithName:@"No memory left" reason:@"No more memory for allocating buffer" userInfo:nil] raise]; 58 | } 59 | 60 | char receivedByte = buffer[bytesReceived-1]; 61 | if (receivedByte == '\n') { 62 | bytesReceived--; 63 | break; 64 | } 65 | 66 | if (receivedByte == '\r') 67 | bytesReceived--; 68 | } 69 | 70 | buffer[bytesReceived] = '\0'; 71 | NSString *retVal = [NSString stringWithCString: buffer encoding: NSUTF8StringEncoding]; 72 | if ([retVal length] == 0) 73 | retVal = [NSString stringWithCString: buffer encoding: NSISOLatin1StringEncoding]; 74 | 75 | free(buffer); 76 | return retVal; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /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_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/ObjectiveGit+PBCategories.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectiveGit+PBCategories.h 3 | // GitX 4 | // 5 | // Created by Etienne on 28/02/2017. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface GTCommit (PBCategories) 12 | - (NSArray *)parentOIDs; 13 | @end 14 | 15 | @interface GTEnumerator (PBCategories) 16 | - (BOOL)pushReferenceName:(NSString *)refName error:(NSError **)error; 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Util/ObjectiveGit+PBCategories.m: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectiveGit+PBCategories.h 3 | // GitX 4 | // 5 | // Created by Etienne on 28/02/2017. 6 | // 7 | // 8 | 9 | #import "ObjectiveGit+PBCategories.h" 10 | 11 | 12 | @implementation GTCommit (PBCategories) 13 | 14 | // This is an optimisation for the grapher. 15 | // We're only interested in OIDs, and we don't need objects 16 | - (NSArray *)parentOIDs { 17 | unsigned numberOfParents = git_commit_parentcount(self.git_commit); 18 | NSMutableArray *parents = [NSMutableArray arrayWithCapacity:numberOfParents]; 19 | 20 | for (unsigned i = 0; i < numberOfParents; i++) { 21 | const git_oid *parent = git_commit_parent_id(self.git_commit, i); 22 | 23 | [parents addObject:[GTOID oidWithGitOid:parent]]; 24 | } 25 | 26 | return parents; 27 | 28 | } 29 | 30 | @end 31 | 32 | @interface GTEnumerator (Private) 33 | @property (nonatomic, assign, readonly) git_revwalk *walk; 34 | @end 35 | -------------------------------------------------------------------------------- /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 | 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*) tmpDirWithPrefix: (NSString*) path 15 | { 16 | NSString* newName = [NSString stringWithFormat: @"%@%@.XXXXXX", NSTemporaryDirectory(), path]; 17 | char *template = (char*) [newName fileSystemRepresentation]; 18 | template = mkdtemp(template); 19 | return [NSString stringWithUTF8String:template]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /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 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface PBEasyPipe: NSObject 14 | 15 | /* The following methods are kept for backward-compatibility. 16 | * Newly-written code should use the block-based methods above. 17 | */ 18 | + (NSTask *)taskForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir GITX_DEPRECATED; 19 | + (NSString *)outputForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args GITX_DEPRECATED; 20 | + (NSString *)outputForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir GITX_DEPRECATED; 21 | + (NSString *)outputForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir retValue:(nullable int *)ret GITX_DEPRECATED; 22 | + (NSString *)outputForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir inputString:(nullable NSString *)input retValue:(nullable int *)ret GITX_DEPRECATED; 23 | + (NSString *)outputForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir byExtendingEnvironment:(nullable NSDictionary *)dict inputString:(nullable NSString *)input retValue:(nullable int *)ret GITX_DEPRECATED; 24 | 25 | /* 26 | * The following methods are deprecated because they're inherently racy: 27 | * They are launched at the end of the method, but you might not be able to 28 | * register for the NSFileHandle notification before they are done running. 29 | */ 30 | + (NSFileHandle *)handleForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args GITX_DEPRECATED; 31 | + (NSFileHandle *)handleForCommand:(NSString *)cmd withArgs:(nullable NSArray *)args inDir:(nullable NSString *)dir GITX_DEPRECATED; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Classes/Util/PBTerminalUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBTerminalUtil.h 3 | // GitX 4 | // 5 | // Created by Sven on 07.08.16. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface PBTerminalUtil : NSObject 12 | 13 | /* 14 | * Runs the given command in OS X’s Terminal.app 15 | * at the given directory. 16 | */ 17 | + (void) runCommand:(NSString *)command inDirectory:(NSURL *)directory; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/Util/PBTerminalUtil.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBTerminalUtil.m 3 | // GitX 4 | // 5 | // Created by Sven on 07.08.16. 6 | // 7 | 8 | #import "PBTerminalUtil.h" 9 | #import "Terminal.h" 10 | 11 | @implementation PBTerminalUtil 12 | 13 | + (NSString *) initialCommand:(NSURL *)workingDirectory { 14 | return [NSString stringWithFormat:@"cd \"%@\"; clear; echo '# Opened by GitX'; ", 15 | workingDirectory.path]; 16 | } 17 | 18 | + (void) runCommand:(NSString *)command inDirectory:(NSURL *)directory { 19 | NSString * initialCommand = [self initialCommand:directory]; 20 | NSString * fullCommand = [initialCommand stringByAppendingString:command]; 21 | 22 | TerminalApplication *term = [SBApplication applicationWithBundleIdentifier: @"com.apple.Terminal"]; 23 | [term doScript:fullCommand in: nil]; 24 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 25 | [term activate]; 26 | }); 27 | } 28 | 29 | @end -------------------------------------------------------------------------------- /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 | @class PBGitRepositoryDocument; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface RJModalRepoSheet : NSWindowController 18 | 19 | @property (nonnull, strong) PBGitWindowController *windowController; 20 | @property (nonnull, assign) PBGitRepositoryDocument *document; 21 | @property (nonnull, readonly) PBGitRepository *repository; 22 | 23 | - (instancetype)initWithWindowNibName:(NSString *)windowNibName windowController:(PBGitWindowController *)windowController; 24 | - (instancetype)initWithWindowNibName:(NSString *)windowNibName; 25 | 26 | - (instancetype)init NS_UNAVAILABLE; 27 | 28 | typedef void(^RJSheetCompletionHandler)(id sheet, NSModalResponse returnCode); 29 | 30 | - (void)beginSheetWithCompletionHandler:(nullable RJSheetCompletionHandler)handler; 31 | 32 | /** 33 | * Temporarily hide the sheet. 34 | * 35 | * You must call -show afterward, or the initial completion handler will not be called. 36 | */ 37 | - (void)hide; 38 | 39 | /** 40 | * Dismiss the sheet. 41 | * 42 | * This will cause the handler to be called with an NSModalResponseAbort code. 43 | */ 44 | - (void)dismiss; 45 | 46 | /** 47 | * Redisplay a hidden sheet. 48 | */ 49 | - (void)show; 50 | 51 | - (IBAction)acceptSheet:(nullable id)sender; 52 | - (IBAction)cancelSheet:(nullable id)sender; 53 | 54 | @end 55 | 56 | NS_ASSUME_NONNULL_END 57 | -------------------------------------------------------------------------------- /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 "PBWebController.h" 11 | 12 | @class PBGitHistoryController; 13 | 14 | @interface GLFileView : PBWebController { 15 | __weak IBOutlet PBGitHistoryController* historyController; 16 | __weak IBOutlet NSView *accessoryView; 17 | __weak IBOutlet NSSplitView *fileListSplitView; 18 | } 19 | 20 | - (void)showFile; 21 | - (void)didLoad; 22 | - (NSString *)parseBlame:(NSString *)txt; 23 | - (NSString *)escapeHTML:(NSString *)txt; 24 | 25 | @property NSMutableArray *groups; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /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/GitXTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GitXTextView.h 3 | // GitX 4 | // 5 | // Created by NanoTech on 2016-12-14. 6 | // 7 | 8 | #import 9 | 10 | /** A text view that remembers text substitution preferences. */ 11 | @interface GitXTextView : NSTextView 12 | @end 13 | -------------------------------------------------------------------------------- /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 | 13 | @class PBGitWindowController; 14 | 15 | @interface PBAddRemoteSheet : RJModalRepoSheet 16 | 17 | + (void)beginSheetWithWindowController:(PBGitWindowController *)windowController completionHandler:(RJSheetCompletionHandler)handler; 18 | 19 | - (IBAction) browseFolders:(id)sender; 20 | - (IBAction) addRemote:(id)sender; 21 | - (IBAction) showHideHiddenFiles:(id)sender; 22 | - (IBAction) cancelOperation:(id)sender; 23 | 24 | @property (readwrite, weak) IBOutlet NSTextField *remoteName; 25 | @property (readwrite, weak) IBOutlet NSTextField *remoteURL; 26 | @property (readwrite, weak) IBOutlet NSTextField *errorMessage; 27 | 28 | @property (readwrite, strong) NSOpenPanel *browseSheet; 29 | @property (readwrite, strong) IBOutlet NSView *browseAccessoryView; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /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/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 | + (void)beginWithMessageText:(NSString *)message 18 | infoText:(NSString *)info 19 | commitController:(PBGitCommitController *)controller 20 | completionHandler:(RJSheetCompletionHandler)handler; 21 | 22 | - (IBAction)forceCommit:(id)sender; 23 | 24 | @property (nonatomic, strong) PBGitCommitController* commitController; 25 | 26 | @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 | completionHandler:(RJSheetCompletionHandler)handler; 25 | { 26 | PBCommitHookFailedSheet* sheet = [[self alloc] initWithWindowNibName:@"PBCommitHookFailedSheet" 27 | andController:controller]; 28 | [sheet beginMessageSheetWithMessageText:message 29 | infoText:info 30 | completionHandler:handler]; 31 | } 32 | 33 | - (id)initWithWindowNibName:(NSString*)windowNibName 34 | andController:(PBGitCommitController*)controller; 35 | { 36 | self = [self initWithWindowNibName:windowNibName windowController:controller.windowController]; 37 | if (!self) 38 | return nil; 39 | 40 | self.commitController = controller; 41 | 42 | return self; 43 | } 44 | 45 | - (IBAction)forceCommit:(id)sender 46 | { 47 | [self acceptSheet:sender]; 48 | } 49 | 50 | - (IBAction)closeMessageSheet:(id)sender 51 | { 52 | [self cancelSheet:sender]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /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 "GitXTextView.h" 10 | 11 | @class PBGitRepository; 12 | 13 | @interface PBCommitMessageView : GitXTextView 14 | 15 | @property (nonatomic, weak) 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 | 11 | #import "RJModalRepoSheet.h" 12 | 13 | @protocol PBGitRefish; 14 | @class PBGitRef; 15 | @class PBGitRepositoryDocument; 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface PBCreateBranchSheet : RJModalRepoSheet 20 | 21 | + (void)beginSheetWithRefish:(id )ref windowController:(PBGitWindowController *)windowController completionHandler:(nullable RJSheetCompletionHandler)handler; 22 | 23 | - (IBAction) createBranch:(nullable id)sender; 24 | - (IBAction) closeCreateBranchSheet:(nullable id)sender; 25 | 26 | @property (nonatomic, strong) id startRefish; 27 | @property (nonatomic, strong) PBGitRef *selectedRef; 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 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /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 | + (void) beginSheetWithRefish:(id )refish windowController:(PBGitWindowController *)windowController completionHandler:(RJSheetCompletionHandler)handler; 20 | 21 | - (IBAction) createTag:(id)sender; 22 | - (IBAction) closeCreateTagSheet:(id)sender; 23 | 24 | @property (nonatomic, strong) id targetRefish; 25 | 26 | @property (nonatomic, weak) IBOutlet NSTextField *tagNameField; 27 | @property (nonatomic, strong) IBOutlet NSTextView *tagMessageText; 28 | @property (nonatomic, weak) IBOutlet NSTextField *errorMessageField; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /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 "PBGitRepositoryDocument.h" 15 | #import "PBGitRevSpecifier.h" 16 | 17 | @implementation PBCreateTagSheet 18 | 19 | #pragma mark - 20 | #pragma mark PBCreateTagSheet 21 | 22 | + (void) beginSheetWithRefish:(id )refish windowController:(PBGitWindowController *)windowController completionHandler:(RJSheetCompletionHandler)handler 23 | { 24 | PBCreateTagSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateTagSheet" windowController:windowController]; 25 | [sheet beginCreateTagSheetAtRefish:refish completionHandler:handler]; 26 | } 27 | 28 | 29 | - (void) beginCreateTagSheetAtRefish:(id )refish completionHandler:(RJSheetCompletionHandler)handler 30 | { 31 | self.targetRefish = refish; 32 | 33 | [self window]; 34 | [self.errorMessageField setStringValue:@""]; 35 | 36 | [self beginSheetWithCompletionHandler:handler]; 37 | } 38 | 39 | 40 | 41 | #pragma mark IBActions 42 | 43 | - (IBAction) createTag:(id)sender 44 | { 45 | NSString *tagName = [self.tagNameField stringValue]; 46 | [self.errorMessageField setHidden:YES]; 47 | 48 | NSString *refName = [@"refs/tags/" stringByAppendingString:tagName]; 49 | if (![self.repository checkRefFormat:refName]) { 50 | [self.errorMessageField setStringValue:NSLocalizedString(@"Invalid name", @"Error message for create tag command when the entered name cannot be used as a tag name")]; 51 | [self.errorMessageField setHidden:NO]; 52 | return; 53 | } 54 | 55 | for (PBGitRevSpecifier *rev in self.repository.branches) { 56 | NSString *name = [[rev ref] tagName]; 57 | if ([tagName isEqualToString:name]) { 58 | [self.errorMessageField setStringValue:NSLocalizedString(@"Tag already exists", @"Error message for create tag command when the entered tag name already exists")]; 59 | [self.errorMessageField setHidden:NO]; 60 | return; 61 | } 62 | } 63 | [self acceptSheet:sender]; 64 | } 65 | 66 | 67 | - (IBAction) closeCreateTagSheet:(id)sender 68 | { 69 | [self cancelSheet:sender]; 70 | } 71 | 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /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 | @end 14 | -------------------------------------------------------------------------------- /Classes/Views/PBFileChangesTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBFileChangesTableView.m 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 "PBFileChangesTableView.h" 10 | #import "PBGitCommitController.h" 11 | 12 | @implementation PBFileChangesTableView 13 | 14 | #pragma mark NSTableView overrides 15 | 16 | - (NSMenu *)menuForEvent:(NSEvent *)theEvent 17 | { 18 | if ([self delegate]) { 19 | NSPoint eventLocation = [self convertPoint:[theEvent locationInWindow] fromView: nil]; 20 | NSInteger rowIndex = [self rowAtPoint:eventLocation]; 21 | [self selectRowIndexes:[NSIndexSet indexSetWithIndex:rowIndex] byExtendingSelection:YES]; 22 | return [super menuForEvent:theEvent]; 23 | } 24 | 25 | return nil; 26 | } 27 | 28 | - (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context 29 | { 30 | return NSDragOperationEvery; 31 | } 32 | 33 | #pragma mark NSView overrides 34 | 35 | -(BOOL)acceptsFirstResponder 36 | { 37 | return [self numberOfRows] > 0; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /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 | __weak IBOutlet PBGitHistoryController *controller; 20 | __weak IBOutlet id contextMenuDelegate; 21 | } 22 | 23 | - (int) indexAtX:(CGFloat)x; 24 | - (NSRect) rectAtIndex:(int)index; 25 | - (void) drawLabelAtIndex:(int)index inRect:(NSRect)rect; 26 | 27 | @property (copy) 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)beginSheetWithMessage:(NSString *)message 22 | info:(NSString *)info 23 | windowController:(PBGitWindowController *)windowController; 24 | 25 | + (void)beginSheetWithError:(NSError *)error 26 | windowController:(PBGitWindowController *)windowController; 27 | 28 | + (void)beginSheetWithMessage:(NSString *)message 29 | info:(NSString *)info 30 | windowController:(PBGitWindowController *)windowController 31 | completionHandler:(RJSheetCompletionHandler)handler; 32 | 33 | + (void)beginSheetWithError:(NSError *)error 34 | windowController:(PBGitWindowController *)windowController 35 | completionHandler:(RJSheetCompletionHandler)handler; 36 | 37 | - (void)beginMessageSheetWithMessageText:(NSString *)message 38 | infoText:(NSString *)info 39 | completionHandler:(RJSheetCompletionHandler)handler; 40 | 41 | - (IBAction)closeMessageSheet:(id)sender; 42 | 43 | 44 | @property IBOutlet NSImageView *iconView; 45 | @property IBOutlet NSTextField *messageField; 46 | @property IBOutlet NSTextView *infoView; 47 | @property IBOutlet NSScrollView *scrollView; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /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/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 | __weak 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 | __weak 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 NSMenuItem (PBRefMenuItem) 14 | 15 | + (NSArray *)pb_defaultMenuItemsForRef:(PBGitRef *)refs inRepository:(PBGitRepository *)repo; 16 | + (NSArray *)pb_defaultMenuItemsForCommits:(NSArray *)commits; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /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 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class PBGitWindowController; 16 | 17 | typedef NSError * _Nullable (^PBProgressSheetExecutionHandler)(void); 18 | 19 | @interface PBRemoteProgressSheet : RJModalRepoSheet 20 | 21 | + (instancetype)progressSheetWithTitle:(NSString *)title description:(NSString *)description windowController:(PBGitWindowController *)windowController; 22 | + (instancetype)progressSheetWithTitle:(NSString *)title description:(NSString *)description; 23 | 24 | - (void)beginProgressSheetForBlock:(PBProgressSheetExecutionHandler)executionBlock completionHandler:(void (^)(NSError *))completionHandler; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /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.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 | + (NSString *) path; 16 | + (NSString *) version; 17 | + (NSArray *) searchLocations; 18 | + (NSString *) notFoundError; 19 | @end 20 | -------------------------------------------------------------------------------- /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) GTCommit *gtCommit; 25 | @property (nonatomic, strong, readonly) GTOID *OID; 26 | 27 | @property (nonatomic, strong, readonly) NSDate *date; 28 | @property (nonatomic, strong, readonly) NSString *subject; 29 | @property (nonatomic, strong, readonly) NSString *message; 30 | @property (nonatomic, strong, readonly) NSString *author; 31 | @property (nonatomic, strong, readonly) NSString *authorEmail; 32 | @property (nonatomic, strong, readonly) NSString *authorDate; 33 | @property (nonatomic, strong, readonly) NSString *committer; 34 | @property (nonatomic, strong, readonly) NSString *committerEmail; 35 | @property (nonatomic, strong, readonly) NSString *committerDate; 36 | @property (nonatomic, strong, readonly) NSString *details; 37 | @property (nonatomic, strong, readonly) NSString *patch; 38 | @property (nonatomic, strong, readonly) NSString *SHA; 39 | @property (nonatomic, strong, readonly) NSString *SVNRevision; 40 | 41 | @property (nonatomic, copy, readonly) NSArray *parents; 42 | @property NSMutableArray* refs; 43 | 44 | @property (nonatomic, strong) PBGraphCellInfo *lineInfo; 45 | 46 | @property (nonatomic, readonly) PBGitTree* tree; 47 | @property (readonly) NSArray* treeContents; 48 | 49 | 50 | - (id)initWithRepository:(PBGitRepository *)repo andCommit:(GTCommit *)gtCommit; 51 | 52 | - (void) addRef:(PBGitRef *)ref; 53 | - (void) removeRef:(id)ref; 54 | - (BOOL) hasRef:(PBGitRef *)ref; 55 | 56 | - (NSString *)SHA; 57 | - (BOOL) isOnSameBranchAs:(PBGitCommit *)other; 58 | - (BOOL) isOnHeadBranch; 59 | 60 | // 61 | - (NSString *) refishName; 62 | - (NSString *) shortName; 63 | - (NSString *) refishType; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /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 | 10 | #define kDialogAcceptDroppedRef @"Accept Dropped Ref" 11 | #define kDialogConfirmPush @"Confirm Push" 12 | #define kDialogDeleteRef @"Delete Ref" 13 | 14 | @interface PBGitDefaults : NSObject 15 | { 16 | 17 | } 18 | 19 | + (NSInteger) commitMessageViewVerticalLineLength; 20 | + (NSInteger) commitMessageViewVerticalBodyLineLength; 21 | + (BOOL) commitMessageViewHasVerticalLine; 22 | + (BOOL) isGistEnabled; 23 | + (BOOL) isGravatarEnabled; 24 | + (BOOL) confirmPublicGists; 25 | + (BOOL) isGistPublic; 26 | + (BOOL)showWhitespaceDifferences; 27 | + (BOOL) shouldCheckoutBranch; 28 | + (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; 29 | + (NSString *) recentCloneDestination; 30 | + (void) setRecentCloneDestination:(NSString *)path; 31 | + (BOOL) showStageView; 32 | + (void) setShowStageView:(BOOL)suppress; 33 | + (NSInteger) branchFilter; 34 | + (void) setBranchFilter:(NSInteger)state; 35 | + (NSInteger)historySearchMode; 36 | + (void)setHistorySearchMode:(NSInteger)mode; 37 | + (BOOL)useRepositoryWatcher; 38 | 39 | 40 | // Suppressed Dialog Warnings 41 | + (void)suppressDialogWarningForDialog:(NSString *)dialog; 42 | + (BOOL)isDialogWarningSuppressedForDialog:(NSString *)dialog; 43 | + (void)resetAllDialogWarnings; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /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 | __weak id delegate; 21 | NSOperationQueue *currentQueue; 22 | 23 | NSMutableSet *searchOIDs; 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 *lastOID; 26 | NSSet *lastRefOIDs; 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/PBGitIndex.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitIndex.h 3 | // GitX 4 | // 5 | // Created by Pieter de Bie on 9/12/09. 6 | // Copyright 2009 Pieter de Bie. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class PBGitRepository; 12 | @class PBChangedFile; 13 | 14 | /* 15 | * Notifications this class will send 16 | */ 17 | 18 | // Refreshing index 19 | extern NSString *PBGitIndexIndexRefreshStatus; 20 | extern NSString *PBGitIndexIndexRefreshFailed; 21 | extern NSString *PBGitIndexFinishedIndexRefresh; 22 | 23 | // The "indexChanges" array has changed 24 | extern NSString *PBGitIndexIndexUpdated; 25 | 26 | // Committing files 27 | extern NSString *PBGitIndexCommitStatus; 28 | extern NSString *PBGitIndexCommitFailed; 29 | extern NSString *PBGitIndexCommitHookFailed; 30 | extern NSString *PBGitIndexFinishedCommit; 31 | 32 | // Changing to amend 33 | extern NSString *PBGitIndexAmendMessageAvailable; 34 | 35 | // This is for general operations, like applying a patch 36 | extern NSString *PBGitIndexOperationFailed; 37 | 38 | 39 | 40 | // Represents a git index for a given work tree. 41 | // As a single git repository can have multiple trees, 42 | // the tree has to be given explicitly, even though 43 | // multiple trees is not yet supported in GitX 44 | @interface PBGitIndex : NSObject 45 | 46 | // Whether we want the changes for amending, 47 | // or for making a new commit. 48 | @property (assign, getter=isAmend) BOOL amend; 49 | @property (weak, readonly) PBGitRepository *repository; 50 | 51 | - (id)initWithRepository:(PBGitRepository *)repository; 52 | 53 | // A list of PBChangedFile's with differences between the work tree and the index 54 | // This method is KVO-aware, so changes when any of the index-modifying methods are called 55 | // (including -refresh) 56 | - (NSArray *)indexChanges; 57 | 58 | // Refresh the index 59 | - (void)refresh; 60 | 61 | - (void)commitWithMessage:(NSString *)commitMessage andVerify:(BOOL) doVerify; 62 | 63 | // Inter-file changes: 64 | - (BOOL)stageFiles:(NSArray *)stageFiles; 65 | - (BOOL)unstageFiles:(NSArray *)unstageFiles; 66 | - (void)discardChangesForFiles:(NSArray *)discardFiles; 67 | 68 | // Intra-file changes 69 | - (BOOL)applyPatch:(NSString *)hunk stage:(BOOL)stage reverse:(BOOL)reverse; 70 | - (NSString *)diffForFile:(PBChangedFile *)file staged:(BOOL)staged contextLines:(NSUInteger)context; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /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 | extern NSString * const kGitXStashType; 17 | 18 | extern NSString * const kGitXTagRefPrefix; 19 | extern NSString * const kGitXBranchRefPrefix; 20 | extern NSString * const kGitXRemoteRefPrefix; 21 | extern NSString * const kGitXStashRefPrefix; 22 | 23 | 24 | @interface PBGitRef : NSObject 25 | 26 | // 27 | - (NSString *) refishName; 28 | - (NSString *) shortName; 29 | - (NSString *) refishType; 30 | 31 | - (NSString *) tagName; 32 | - (NSString *) branchName; 33 | - (NSString *) remoteName; 34 | - (NSString *) remoteBranchName; 35 | 36 | - (NSString *) type; 37 | - (BOOL) isBranch; 38 | - (BOOL) isTag; 39 | - (BOOL) isRemote; 40 | - (BOOL) isRemoteBranch; 41 | - (BOOL) isStash; 42 | 43 | - (PBGitRef *) remoteRef; 44 | 45 | - (BOOL) isEqualToRef:(PBGitRef *)otherRef; 46 | 47 | + (PBGitRef*) refFromString: (NSString*) s; 48 | - (PBGitRef*) initWithString: (NSString*) s; 49 | 50 | @property(nonatomic, strong, readonly) NSString* ref; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /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 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @class PBGitRepository; 16 | 17 | typedef NS_ENUM(NSUInteger, PBGitRepositoryWatcherEventType) { 18 | PBGitRepositoryWatcherEventTypeNone = (1 << 0), 19 | PBGitRepositoryWatcherEventTypeGitDirectory = (1 << 1), 20 | PBGitRepositoryWatcherEventTypeWorkingDirectory = (1 << 2), 21 | PBGitRepositoryWatcherEventTypeIndex = (1 << 3), 22 | }; 23 | 24 | extern NSString *PBGitRepositoryEventNotification; 25 | extern NSString *kPBGitRepositoryEventTypeUserInfoKey; 26 | extern NSString *kPBGitRepositoryEventPathsUserInfoKey; 27 | 28 | @interface PBGitRepositoryWatcher : NSObject 29 | 30 | @property (readonly, weak) PBGitRepository *repository; 31 | 32 | - (instancetype) initWithRepository:(PBGitRepository *)repository; 33 | - (void) start; 34 | - (void) stop; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /Classes/git/PBGitRepository_PBGitBinarySupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitRepository_PBGitBinarySupport.h 3 | // GitX 4 | // 5 | // Created by Etienne on 22/02/2017. 6 | // 7 | // 8 | 9 | #import 10 | #import "PBGitRepository.h" 11 | #import "PBTask.h" // Imported so our includers don't have to add it 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface PBGitRepository (PBGitBinarySupport) 16 | - (PBTask *)taskWithArguments:(nullable NSArray *)arguments; 17 | - (BOOL)launchTaskWithArguments:(nullable NSArray *)arguments error:(NSError **)error; 18 | - (nullable NSString *)outputOfTaskWithArguments:(nullable NSArray *)arguments error:(NSError **)error; 19 | @end 20 | 21 | #undef GITX_DEPRECATED 22 | #define GITX_DEPRECATED 23 | 24 | @interface PBGitRepository (PBGitBinarySupportDeprecated) 25 | - (NSFileHandle*) handleForArguments:(NSArray*) args GITX_DEPRECATED; 26 | - (NSString*) outputForCommand:(NSString*) cmd GITX_DEPRECATED; 27 | - (NSString *)outputForCommand:(NSString *)str retValue:(int *)ret GITX_DEPRECATED; 28 | - (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret GITX_DEPRECATED; 29 | - (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input byExtendingEnvironment:(NSDictionary *)dict retValue:(int *)ret GITX_DEPRECATED; 30 | 31 | 32 | - (NSString*) outputForArguments:(NSArray*) args GITX_DEPRECATED; 33 | - (NSString*) outputForArguments:(NSArray*) args retValue:(int *)ret GITX_DEPRECATED; 34 | - (NSString *)outputInWorkdirForArguments:(NSArray*) arguments GITX_DEPRECATED; 35 | - (NSString *)outputInWorkdirForArguments:(NSArray*) arguments retValue:(int *)ret GITX_DEPRECATED; 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /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 | @class PBGitCommit; 14 | 15 | @interface PBGitRevList : NSObject 16 | 17 | @property (nonatomic, assign, getter=isParsing, readonly) BOOL parsing; 18 | @property (nonatomic, strong) NSMutableArray *commits; 19 | 20 | - (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph; 21 | - (void)loadRevisonsWithCompletionBlock:(void(^)(void))completionBlock; 22 | - (void)cancel; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /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/PBGitSVStashItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewStash.h 3 | // GitX 4 | // 5 | // Created by Mathias Leppich on 8/1/13. 6 | // 7 | // 8 | 9 | #import 10 | #import "PBSourceViewItem.h" 11 | #import "PBGitStash.h" 12 | 13 | @interface PBGitSVStashItem : PBSourceViewItem 14 | 15 | + (id) itemWithStash:(PBGitStash*)stash; 16 | 17 | @property (nonatomic, strong) PBGitStash* stash; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/git/PBGitSVStashItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBSourceViewStash.m 3 | // GitX 4 | // 5 | // Created by Mathias Leppich on 8/1/13. 6 | // 7 | // 8 | 9 | #import "PBGitSVStashItem.h" 10 | #import "PBGitRevSpecifier.h" 11 | 12 | 13 | @implementation PBGitSVStashItem 14 | 15 | + (id)itemWithStash:(PBGitStash *)stash 16 | { 17 | NSString * title = [NSString stringWithFormat:@"@{%zd}: %@", stash.index, stash.message]; 18 | PBGitSVStashItem * item = [self itemWithTitle:title]; 19 | item.stash = stash; 20 | item.revSpecifier = [[PBGitRevSpecifier alloc] initWithRef:stash.ref]; 21 | return item; 22 | } 23 | 24 | -(PBGitRef *)ref { 25 | return self.stash.ref; 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/PBGitStash.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitStash.h 3 | // GitX 4 | // 5 | // Created by Mathias Leppich on 8/1/13. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class PBGitCommit; 13 | @class PBGitRef; 14 | @class PBGitRepository; 15 | 16 | @interface PBGitStash : NSObject 17 | @property (nonatomic, readonly) NSInteger index; 18 | @property (nonatomic, readonly) PBGitCommit *commit; 19 | @property (nonatomic, readonly) NSString *message; 20 | @property (nonatomic, readonly) PBGitRef *ref; 21 | 22 | @property (nonatomic, readonly) PBGitCommit *indexCommit; 23 | @property (nonatomic, readonly) PBGitCommit *ancestorCommit; 24 | 25 | - (id)initWithRepository:(PBGitRepository *)repo stashOID:(GTOID *)stashOID index:(NSInteger)index message:(NSString *)message; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/git/PBGitStash.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBGitStash.m 3 | // GitX 4 | // 5 | // Created by Mathias Leppich on 8/1/13. 6 | // 7 | // 8 | 9 | #import "PBGitStash.h" 10 | #import "PBGitRef.h" 11 | #import "PBGitCommit.h" 12 | #import "PBGitRepository.h" 13 | 14 | @implementation PBGitStash 15 | 16 | -(id)initWithRepository:(PBGitRepository *)repo stashOID:(GTOID *)stashOID index:(NSInteger)index message:(NSString *)message 17 | { 18 | self = [self init]; 19 | if (!self) return nil; 20 | 21 | _index = index; 22 | _message = message; 23 | 24 | GTRepository * gtRepo = repo.gtRepo; 25 | NSError * error = nil; 26 | GTCommit * gtCommit = (GTCommit *)[gtRepo lookUpObjectByOID:stashOID objectType:GTObjectTypeCommit error:&error]; 27 | NSArray * parents = [gtCommit parents]; 28 | GTCommit * gtIndexCommit = [parents objectAtIndex:1]; 29 | GTCommit * gtAncestorCommit = [parents objectAtIndex:0]; 30 | 31 | _commit = [[PBGitCommit alloc] initWithRepository:repo andCommit:gtCommit]; 32 | _indexCommit = [[PBGitCommit alloc] initWithRepository:repo andCommit:gtIndexCommit]; 33 | _ancestorCommit = [[PBGitCommit alloc] initWithRepository:repo andCommit:gtAncestorCommit]; 34 | 35 | return self; 36 | } 37 | 38 | - (NSString *)description 39 | { 40 | return [NSString stringWithFormat:@"stash@{%zd}: %@", _index, _message]; 41 | } 42 | 43 | - (PBGitRef *)ref 44 | { 45 | NSString * refStr = [NSString stringWithFormat:@"refs/stash@{%zd}", _index]; 46 | return [[PBGitRef alloc] initWithString:refStr]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /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/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 | @end 14 | 15 | @interface NSURLRequest (PBGitXProtocol) 16 | @property (nonatomic, strong) PBGitRepository *repository; 17 | @end 18 | 19 | @interface NSMutableURLRequest (PBGitXProtocol) 20 | @property (nonatomic, strong) PBGitRepository *repository; 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /Classes/git/PBRepositoryFinder.h: -------------------------------------------------------------------------------- 1 | // 2 | // PBRepositoryFinder.h 3 | // GitX 4 | // 5 | // Created by Rowan James on 13/11/2012. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface PBRepositoryFinder : NSObject 12 | 13 | + (NSURL *)fileURLForURL:(NSURL *)inputURL; 14 | + (NSURL*)workDirForURL:(NSURL*)fileURL; 15 | + (NSURL*)gitDirForURL:(NSURL*)fileURL; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/git/PBRepositoryFinder.m: -------------------------------------------------------------------------------- 1 | // 2 | // PBRepositoryFinder.m 3 | // GitX 4 | // 5 | // Created by Rowan James on 13/11/2012. 6 | // 7 | // 8 | 9 | #import "PBRepositoryFinder.h" 10 | 11 | @implementation PBRepositoryFinder 12 | 13 | + (NSURL *)workDirForURL:(NSURL *)fileURL; 14 | { 15 | if (!fileURL.isFileURL) { 16 | return nil; 17 | } 18 | 19 | git_repository *repo = NULL; 20 | git_repository_open_ext(&repo, fileURL.path.UTF8String, GIT_REPOSITORY_OPEN_CROSS_FS, NULL); 21 | if (!repo) { 22 | return NULL; 23 | } 24 | 25 | const char *workdir = git_repository_workdir(repo); 26 | NSURL *result = nil; 27 | if (workdir) { 28 | result = [NSURL fileURLWithPath:[NSString stringWithUTF8String:workdir]]; 29 | } 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 | + (NSURL *)fileURLForURL:(NSURL *)inputURL 69 | { 70 | NSURL* gitDir = [self gitDirForURL:inputURL]; 71 | if (!gitDir) { 72 | return nil; // not a Git directory at all 73 | } 74 | 75 | NSURL *workDir = [self workDirForURL:inputURL]; 76 | if (workDir) { 77 | return workDir; // root of this working copy or deepest submodule 78 | } 79 | 80 | return gitDir; // bare repo 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Documentation/Screenshot.png -------------------------------------------------------------------------------- /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/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GitX.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Latest 7 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Codebase GitX 2 | 3 | Vertical split, minimized UI, curated layout. **Dark theme only** 4 | 5 | [Binary downloads here](https://github.com/codebasesaga/gitx/releases). 6 | 7 | ![Screenshot](Documentation/Screenshot.png) 8 | 9 | ## Installing the Terminal tool 10 | 11 | UI removed. Make a symlink, or you won’t get updates: 12 | 13 | ln -s /Applications/GitX.app/Contents/Resources/gitx /usr/local/bin 14 | 15 | Or maybe just a bash-alias. 16 | 17 | ## How to Build & Install: 18 | 19 | See [the wiki page](https://github.com/gitx/gitx/wiki/Build-instructions) 20 | for build instructions. 21 | -------------------------------------------------------------------------------- /Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | NSHumanReadableCopyright = "© Pieter de Bie, 2010\n© Codebase LLC, 2018"; 4 | -------------------------------------------------------------------------------- /Resources/GitX.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Resources/GitX_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | 3 | #ifdef __OBJC__ 4 | #import 5 | #import 6 | #import "PBMacros.h" 7 | #endif 8 | -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "icon_16x16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "icon_16x16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "icon_32x32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "icon_32x32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "icon_128x128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "icon_128x128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "icon_256x256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "icon_256x256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "icon_512x512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "icon_512x512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images.xcassets/AppIcon-gitx.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /Resources/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Resources/Images/AddBranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/AddBranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/AddLabelTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/AddLabelTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/AddRemoteTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/AddRemoteTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/BranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/BranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/CherryPickTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/CherryPickTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/DetailViewTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/DetailViewTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FetchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/FetchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FolderClosedTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/FolderClosedTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/FolderTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/FolderTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/MergeTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/MergeTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/PullTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/PullTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/PushTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/PushTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RebaseTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/RebaseTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RemoteBranchTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/RemoteBranchTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/RemoteTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/RemoteTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/StageTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/StageTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/TagTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/TagTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/TreeViewTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/TreeViewTemplate.pdf -------------------------------------------------------------------------------- /Resources/Images/deleted_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/deleted_file.pdf -------------------------------------------------------------------------------- /Resources/Images/empty_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/empty_file.pdf -------------------------------------------------------------------------------- /Resources/Images/mainSplitterBar.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/mainSplitterBar.tiff -------------------------------------------------------------------------------- /Resources/Images/mainSplitterDimple.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/mainSplitterDimple.tiff -------------------------------------------------------------------------------- /Resources/Images/new_file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/new_file.pdf -------------------------------------------------------------------------------- /Resources/Images/rewindImage.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/Images/rewindImage.pdf -------------------------------------------------------------------------------- /Resources/Info-gitx.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | ${CURRENT_PROJECT_VERSION} 19 | CFBundleVersion 20 | ${CURRENT_PROJECT_VERSION} 21 | 22 | 23 | -------------------------------------------------------------------------------- /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/html/convert.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | //#!/usr/bin/swift 2 | 3 | import Foundation 4 | 5 | ////////////////////////////////// library 6 | 7 | extension String { 8 | var isDirectory: Bool { 9 | var isDir: ObjCBool = false 10 | return FileManager.default.fileExists(atPath: self, isDirectory: &isDir) && isDir.boolValue 11 | } 12 | } 13 | 14 | func /(lhs: String, rhs: String) -> String { 15 | return (lhs as NSString).appendingPathComponent(rhs) 16 | } 17 | 18 | func invert(c: Character) -> Character { 19 | let value = Int(String(c), radix: 16)! 20 | let inverted = 15 - value 21 | let cc = String.init(inverted, radix: 16, uppercase: true) 22 | return cc.first! 23 | } 24 | 25 | func mangle(path: String) throws { 26 | print(path) 27 | var html = try String(contentsOfFile: path) 28 | let regex = try NSRegularExpression(pattern: "#[a-fA-F0-9]+") 29 | let matches = regex.matches(in: html, options: [], range: NSRange(location: 0, length: html.count)) 30 | for match in matches { 31 | guard (4...7).contains(match.range.length) else { continue } 32 | let range = Range(match.range, in: html)! 33 | let color = html[range].dropFirst() 34 | let inverted = String(color.map(invert)) 35 | html.replaceSubrange(range, with: "#\(inverted)") 36 | print(color, inverted) 37 | } 38 | html.replacingOccurrences(of: "color: white", with: "color: black") 39 | html.replacingOccurrences(of: "background-color: white", with: "background-color: black") 40 | try html.write(toFile: path, atomically: true, encoding: .utf8) 41 | } 42 | 43 | 44 | ////////////////////////////////// main 45 | let fm = FileManager.default 46 | let path = fm.currentDirectoryPath == "/" ? "/Users/mxcl/src/GitX/Resources/html" : "." 47 | let enumerator = fm.enumerator(atPath: path)! 48 | 49 | while let node = enumerator.nextObject() as? String { 50 | guard node.hasSuffix(".css") else { continue } 51 | try mangle(path: path/node) 52 | } 53 | -------------------------------------------------------------------------------- /Resources/html/convert.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Resources/html/convert.playground/playground.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/html/convert.playground/playground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Resources/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: -apple-system, 'Helvetica Neue', 'Lucida Grande', sans-serif; 9 | font-size: 12px; 10 | } 11 | 12 | table { 13 | font-size: 12px; 14 | } 15 | 16 | .fileHeader a:before { 17 | margin-left: 0.3em; 18 | width: 1em; 19 | display: inline-block; 20 | } 21 | 22 | .expanded a:before { 23 | content: "\25be\0020"; 24 | } 25 | 26 | .collapsed a:before { 27 | content: "\25b8\0020"; 28 | } 29 | 30 | .SHA { 31 | font-family: "SF Mono", "Menlo", Monaco, monospace; 32 | text-decoration: none; 33 | } 34 | 35 | .hidden { 36 | display: none; 37 | } 38 | 39 | html { 40 | background: black; 41 | color: white; 42 | } 43 | -------------------------------------------------------------------------------- /Resources/html/css/diff.css: -------------------------------------------------------------------------------- 1 | .diff .file { 2 | margin: 11px; 3 | border: 1px solid #333; 4 | } 5 | 6 | .diff .file .fileHeader { 7 | margin: 5px; 8 | font-weight: bold; 9 | } 10 | 11 | .diff .file .fileHeader a { 12 | color: #FFF; 13 | text-decoration: none; 14 | } 15 | 16 | .diff .file .diffContent { 17 | white-space: pre; 18 | font-family: "SF Mono", "Menlo", Monaco, monospace; 19 | } 20 | 21 | .diff .file .diffcontent .lineno { 22 | float: left; 23 | padding-left: 3px; 24 | padding-right: 3px; 25 | background-color: #131313; 26 | color: #565656; 27 | border-right: 1px solid #222222; 28 | text-align: right; 29 | } 30 | 31 | .diff .file .diffContent .lines { 32 | overflow: auto; 33 | } 34 | 35 | .diff .file .diffContent .lines .hunkheader { 36 | background-color: #080808; 37 | color: #444; 38 | } 39 | 40 | .diff .file .diffContent .lines > div { 41 | padding-left: 2px; 42 | } 43 | 44 | .diff .file .diffcontent .lines .delline { 45 | background-color: #011; 46 | color: #4FF; 47 | } 48 | 49 | .diff .file .diffcontent .lines .addline { 50 | background-color: #202; 51 | color: #F7F; 52 | } 53 | 54 | .diff .file .diffcontent .lines .markerline { 55 | display:none; 56 | } 57 | 58 | .diff .file .diffcontent .lines .nonewline:after { 59 | content: " \20e0\23ce"; 60 | font-family: -apple-system, "Helvetica Neue", sans-serif; 61 | } 62 | .diff .file .diffcontent .lines .whitespace { 63 | background-color: rgba(0,255,255,0.5); 64 | } 65 | .diff .file .diffcontent .lines del, 66 | .diff .file .diffcontent .lines ins { 67 | text-decoration: none; border-radius: 0.2em; 68 | } 69 | .diff .file .diffcontent .lines .delline del { 70 | background-color: #014040; 71 | color: #5FF; 72 | } 73 | .diff .file .diffcontent .lines .addline ins { 74 | background-color: #4D0050; 75 | color: #F8F; 76 | } 77 | 78 | #CurrentHunk { 79 | border-left: 5px solid black; 80 | } 81 | -------------------------------------------------------------------------------- /Resources/html/css/notification.css: -------------------------------------------------------------------------------- 1 | #notification { 2 | margin: 5px; 3 | padding: 3px; 4 | clear: both; 5 | 6 | border: 1px solid black; 7 | background-color: #0C0C0C; 8 | 9 | text-align: center; 10 | font-size: 80%; 11 | 12 | -webkit-border-radius: 2px; 13 | } 14 | 15 | #notification.success { 16 | background-color: #330066; 17 | border: 1px solid #663399; 18 | } 19 | 20 | #notification.fail { 21 | background-color: #006666; 22 | border: 1px solid #339999; 23 | } -------------------------------------------------------------------------------- /Resources/html/images/added.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Resources/html/images/modified.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Resources/html/images/removed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Resources/html/images/renamed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Resources/html/images/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/html/images/spinner.gif -------------------------------------------------------------------------------- /Resources/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 | var div = document.createElement("div"); 14 | return function() { 15 | div.textContent = this; 16 | return div.innerHTML; 17 | }; 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(html, state) { 37 | var n = $("notification"); 38 | n.classList.remove("hidden"); 39 | $("notification_message").innerHTML = html; 40 | 41 | // Change color 42 | if (!state) { // Busy 43 | $("spinner").classList.remove("hidden"); 44 | n.classList.remove("success"); 45 | n.classList.remove("fail"); 46 | } 47 | else if (state == 1) { // Success 48 | $("spinner").classList.add("hidden"); 49 | n.classList.add("success"); 50 | } else if (state == -1) {// Fail 51 | $("spinner").classList.add("hidden"); 52 | n.classList.add("fail"); 53 | } 54 | } 55 | 56 | var hideNotification = function() { 57 | $("notification").classList.add("hidden"); 58 | } 59 | 60 | var bindCommitSelectionLinks = function(el) { 61 | var links = el.getElementsByClassName("commit-link"); 62 | for (var i = 0, n = links.length; i < n; ++i) { 63 | links[i].addEventListener("click", function(e) { 64 | e.preventDefault(); 65 | selectCommit(this.dataset.commitId || this.innerHTML); 66 | }, false); 67 | } 68 | }; 69 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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 | -------------------------------------------------------------------------------- /Resources/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: "SF Mono", "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: "SF Mono", "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 #363636 !important; 52 | } 53 | table.blocks{ 54 | border-bottom: 1px solid #363636 !important; 55 | width: 100% !important; 56 | } 57 | 58 | table.blocks tr td:nth-of-type(1) { 59 | background-color: #131313 !important; 60 | border-right: 1px solid #363636 !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 | } 72 | -------------------------------------------------------------------------------- /Resources/html/views/blame/blame.js: -------------------------------------------------------------------------------- 1 | var showFile = function(html) { 2 | var el = $("txt"); 3 | el.style.display = ""; 4 | el.innerHTML = "
" + html + "
"; 5 | bindCommitSelectionLinks(el); 6 | 7 | SyntaxHighlighter.defaults['toolbar'] = false; 8 | 9 | SyntaxHighlighter.highlight(); 10 | return; 11 | } 12 | 13 | var selectCommit = function(a) { 14 | Controller.selectCommit_(a); 15 | } 16 | -------------------------------------------------------------------------------- /Resources/html/views/blame/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
hola 15 | 16 | 17 | -------------------------------------------------------------------------------- /Resources/html/views/commit/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Diff for file 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |

20 | 21 | Context: 22 | Nothing to commit 23 | 24 |

25 | 26 | 30 | 31 | 34 |
35 | Nothing to commit (working directory clean) 36 |
37 |
38 | 39 | -------------------------------------------------------------------------------- /Resources/html/views/commit/multipleSelection.js: -------------------------------------------------------------------------------- 1 | var showMultipleFilesSelection = function(files) 2 | { 3 | hideNotification(); 4 | setTitle(""); 5 | 6 | var div = $("diff"); 7 | div.style.display = ""; 8 | div.innerHTML = '
' + 9 | '
Multiple Selection
' + 10 | '
    ' + 11 | '
    '; 12 | 13 | var ul = div.getElementsByTagName("ul")[0]; 14 | for (var i = 0; i < files.length; ++i) 15 | { 16 | var file = files[i]; 17 | var li = document.createElement("li"); 18 | li.textContent = file.path; 19 | ul.appendChild(li); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Resources/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: #4B2800; 11 | border: 2px solid #BA5E01; 12 | 13 | -webkit-border-radius: 10px; 14 | } -------------------------------------------------------------------------------- /Resources/html/views/diff/diffWindow.js: -------------------------------------------------------------------------------- 1 | // for diffs shown in the PBDiffWindow 2 | 3 | var showDiff = function(diff) { 4 | highlightDiff(diff, $("diff")); 5 | }; 6 | 7 | var setMessage = function(message) { 8 | $("message").classList.remove("hidden"); 9 | $("message").textContent = message; 10 | $("diff").style.display = "none"; 11 | }; 12 | -------------------------------------------------------------------------------- /Resources/html/views/diff/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Details for commit 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 |
    22 | 23 | -------------------------------------------------------------------------------- /Resources/html/views/fileview/index_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 |
    17 | //
    18 | //  AppController.h
    19 | //  MGScopeBar
    20 | //
    21 | //  Created by Matt Gemmell on 16/03/2008.
    22 | //
    23 | 
    24 | /* dhfas fldsa */
    25 | 
    26 | /*
    27 | fjdsahf dsaf dlsaf jd;sa
    28 | fdjksal; fjhdsa
    29 | */
    30 | 
    31 | #import <Cocoa/Cocoa.h>
    32 | #import "MGScopeBarDelegateProtocol.h"
    33 | 
    34 | 
    35 | /* dhfas fldsa */
    36 | 
    37 | @interface AppController : NSObject  {
    38 | 	IBOutlet NSTextField *labelField;
    39 | 	IBOutlet MGScopeBar *scopeBar;
    40 | 	IBOutlet NSView *accessoryView;
    41 | 	NSMutableArray *groups;
    42 | }
    43 | 
    44 | @property(retain) NSMutableArray *groups;
    45 | 
    46 | @end
    47 | 
    48 | 49 |
    50 | 51 | 52 | -------------------------------------------------------------------------------- /Resources/html/views/fileview/source.css: -------------------------------------------------------------------------------- 1 | body, html, #source { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | -------------------------------------------------------------------------------- /Resources/html/views/log/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Details for commit 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
    21 | 22 | -------------------------------------------------------------------------------- /Resources/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 #333; 11 | -webkit-box-shadow: 1px 1px 2px #222; 12 | } -------------------------------------------------------------------------------- /Resources/html/views/log/log.js: -------------------------------------------------------------------------------- 1 | var selectCommit = function(a) { 2 | window.Controller.selectCommit_(a); 3 | return false; 4 | } 5 | 6 | var showFile = function(html) { 7 | var el = $("log"); 8 | el.classList.remove("hidden"); 9 | el.innerHTML = html; 10 | bindCommitSelectionLinks(el); 11 | return; 12 | } 13 | -------------------------------------------------------------------------------- /Resources/html/views/source/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 | 17 | 18 | -------------------------------------------------------------------------------- /Resources/html/views/source/source.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/html/views/source/source.css -------------------------------------------------------------------------------- /Resources/html/views/source/source.js: -------------------------------------------------------------------------------- 1 | var showFile = function(html) { 2 | $("source").style.display = ""; 3 | $("source").innerHTML="
    "+html+"
    "; 4 | 5 | SyntaxHighlighter.defaults['toolbar'] = false; 6 | SyntaxHighlighter.highlight(); 7 | 8 | return; 9 | } 10 | -------------------------------------------------------------------------------- /Resources/source.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Resources/source.css -------------------------------------------------------------------------------- /Scripts/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 | -------------------------------------------------------------------------------- /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/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/branch-lanes.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/branchswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/branchswitcher.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/commitview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/commitview.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/detailswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/detailswitcher.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/display_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/display_diff.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/gistie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/gistie.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/gitx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/gitx.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/historyview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/historyview.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/left-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/left-right.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/menubar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/menubar.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/quicklook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/UserManual/assets/images/quicklook.png -------------------------------------------------------------------------------- /Site/UserManual/assets/images/viewswitcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/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/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/assets/images/bg.png -------------------------------------------------------------------------------- /Site/assets/images/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/assets/images/download.png -------------------------------------------------------------------------------- /Site/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/assets/images/favicon.png -------------------------------------------------------------------------------- /Site/assets/images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/Site/assets/images/header.jpg -------------------------------------------------------------------------------- /Site/assets/images/qtime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codebasesaga/gitx/7fb83bad7d8535fa8951c394dde4f52f375c5fc4/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 %> -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------