« August 2007 | Archives index | October 2007 »
September 30, 2007
Remove logging macros (WOPublic, 195c4be)
These macros have gone unused for a long, long time, effectively replaced by the WOLogManager class in WOCommon, so remove them.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:29 PM
Update header (WOPublic, 72fe401)
Replace WOCommon references with WOPublic.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:58 PM
September 28, 2007
Update build configuration names (WOPublic, bded1e4)
Replace outdated build configuration names (Development, Deployment) with new equivalents, Debug and Release.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:20 PM
Fix spelling error in Doxygen comment (WOPublic, 6d695d4)
"Named used" corrected to read "Named using" in two places.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:15 PM
Initial import of WODebugMacros.h from WOCommon (WOPublic, 4ab2a99)
Direct import of public portions from WOCommon.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 7:06 PM
Move subview initialization into WODiffView (gdiff, 1cc773c)
WODocument is a controller class which previously set up its own document window and all the subviews. Now all of the subview initialization has been moved into WODiffView.
This results in a much simpler controller implementation, and there is better locality now that all subview management is encapsulated in WODiffView (previously only the autoresizing code was there).
When the controller needs to access the subviews (for example to initiate scrolling) I will add the appropriate properties or action methods to the WODiffView class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:51 PM
Remove debugging log statement (gdiff, 1d0c023)
Fix another mistake in the botched history rewrite (see 4679d86 for more information); this is a debugging log statement that should have been removed but which was left in.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:29 PM
Allow horizontal scrollers when necessary (gdiff, 30abc8d)
Although we don't want our scroll views to have vertical scrollers we do want them to have horizontal ones if the displayed content is too wide.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:25 PM
Remove setHasVerticalScroller calls (gdiff, 5895b3a)
According to the documentation, programmatically created NSScrollViews have no scrollers, so remove the redundant calls to the setHasVerticalScroller: method.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:21 PM
Add second of two scroll views (gdiff, 429df2e)
Completing the work started in 390c5b3, the right hand side is now also located inside a scroll view with no vertical scroll bar. The NSScroller that was previously grouped along with the left file view and its gutter has now been move outside of the group (it makes no sense to have a scroller inside the document view of an NSScrollView).
This required some reworking of the WODiffView autoresizing code, and in the process I discovered that the incorporation of the "slack" in the glue view (introduced in commit 50b3dbc) was being thrown away during window resizes; so as part of the updates to the autoresizing code I now ensure that the slack is accommodated by the glue view during window resizing as well.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:18 PM
Let glue view pick up any pixel slack (gdiff, 50b3dbc)
Previously we used the right view to pick up the one-pixel slack caused by dividing the window in two when there were on odd number of pixels available. This was slightly ugly because it introduced an arbitrary difference between the left and right views and therefore incurred a slight maintenance penalty.
Now we use the glue view for picking up that slack when necessary. Seeing as there is only one glue view, it is in the center of the window, and its purpose is to draw curves rather than proportional characters it is the ideal candidate for this role.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:59 PM
Remove no-op NSView overrides (gdiff, dc7f887)
The default NSView subclass templates include no-op methods that can be overridden. Seeing as the WODiffView class is unlikely to ever need to override these methods, remove them and fall through to the super class implementations.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:48 PM
Add first of two scroll views (gdiff, 390c5b3)
Rather than replicate all the work done by NSScrollView (and behind the scenes NSClipView) I am going to try letting NSScrollView do as much as possible. This commit starts the migration, placing the content on the left-hand side inside a programmatically created scrollview.
The previously used NSView that was used for grouping purposes is still required seeing as an NSScrollView expects a single document view. The autoresizing machinery works without modification using the scrollview as a drop-in replacement for the NSView.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:44 PM
Add missing header import (gdiff, 4679d86)
Add back in a missing header import. This was actually in there before but I shot myself in the foot trying to amend the last commit (used git-reset when I should have used git-checkout; all I wanted to do was exclude a file from the commit that I really wanted to be in a separate, later commit). In reconstructing the history I missed out the header import. Rather than rewrite the history again I'll just chalk this up as a lesson learned and do this as a separate commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:39 PM
Read in sample files at launch (gdiff, d86a598)
As proof that commit 6c21acf really works, here we read the sample files in at launch time upon initializing the document controller. This is temporary code that will be used for prototyping purposes only.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:58 AM
Skip preambles before starting diff matching (gdiff, 6c21acf)
In setting up the test sample files I inadvertently included a sample file generated using "git-show COMMIT_ID", thus producing a commit description including the commit message and other preamble prior to the diff (in contrast to the "naked" output that you would get from "git-diff").
This commit modifies the state machine to skip over any such preamble prior to attempting to recognize the "meat" of the diff. This means that gdiff will be able to operate not only on the bare diff output of "git-diff" but also on that of "git-show" and potentially other sources as well (patch emails are a possibility, for example, although they may require some pre-processing if they are encoded using a transport encoding).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:55 AM
Add sample files (gdiff, 04b2636)
Add some sample files that will be used to scaffold development of the gdiff view code. These files are expected to be in the ~/tmp directory at runtime.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:53 AM
September 27, 2007
Replace nibs with xibs (gdiff, f9735df)
Use Interface Builder's new SCM-friendly file format.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:26 PM
Remove private API support code (WOTest, 2e0037d)
The signatureWithObjCTypes: method in NSMethodSignature is at last exposed in Leopard, so remove the all the support code that was previously used to (carefully) work with (or around) it and just use the now-official API.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 9:07 PM
Use new thread APIs (gdiff, 513091e)
Replace use of the NSThread detachNewThreadSelector:toTarget:withObject: API with the new NSObject performSelectorInBackground:withObject: API. This is a readability improvement which more clearly expresses the intention behind the creation of the new thread.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:28 PM
Add Doxygen target (gdiff, e0d0150)
This commit adds a Doxygen target for producing code-level documentation. At the moment, the latest Doxygen release (1.5.3) doesn't build on Leopard although a pre-built binary does run. Doxygen does not yet understand the property syntax of Objective-C 2.0.
Likewise, the latest version of Graphviz (2.8) (whose "dot" tool is invoked by Doxygen to depict inheritance hierarchies) doesn't yet build on Leopard, although I suspect an existing binary would work without problems.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:04 PM
Make installation window key (gdiff, 42890f6)
When bringing up the installation window don't just order it to the front; actually make it the key window as well. In this way the user can just hit the Return or Enter keys to initiate the default install.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:47 PM
Return success status from installer tool (gdiff, 5ecde66)
The installer tool wasn't indicating success status to the parent, only failure.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:44 PM
Add missing NULL in call to execve (gdiff, 3fd4457)
The execve call wasn't working because the envp array was empty rather than NULL terminated.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:41 PM
Use waitpid consistently in installer tool and parent application (gdiff, 6aa0212)
Make usage of waitpid consistent across the installer tool and the parent application (where it incorrectly used WNOHANG).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:33 PM
Yet another early return bug (gdiff, d1813b4)
Ensure that the exit status of installer tool is used to determine whether installation was considered to be successful.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:06 PM
Add another missing early return (gdiff, 9e92950)
During forced failure testing discovered another missing early return; when the installer tool was failure to communicate its process id back to the parent the main appliction wasn't aborting.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:04 PM
Factor out calls to AuthorizationFree (gdiff, 2552ca2)
This commit creates a new method that handles the call to AuthorizationFree and prints a diagnostic message as appropriate. This cleans up some repetition in the code (AuthorizationFree was previously called in three places) and enables for cleaner program flow around the call to AuthorizationExecuteWithPrivileges; specifically, we now handle one error as a special case (failure to execute the tool), then all other errors (general authorization failures) and finally the success case.
This commit also fixes a bug wherein the failure cases did not result in the early termination of the method.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:58 PM
Use shared support folder for executables (gdiff, 64aadbd)
Using the shared support folder rather than the localizable resources folder should be more secure as it reduces the number of possible sites in which an attacker could substitute a hostile binary.
As noted elsewhere in the source, these types of security measures are an unwinnable battle; basically any application that runs with elevated privileges should be considered vulnerable of other users have write access to any part of it. Despite this, a "defense in depth" strategy suggests that plugging these minor holes is still a worthwhile idea, especially when the effort of doing so is minimal.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:40 PM
Locate installer-tool as normal resource (gdiff, 5d40d99)
The pathForAuxiliaryExecutable: method works for Foundation tools (Objective-C executables linked against the Objective-C runtime) but not for pure C executables. So must use pathForResource:ofType: to locate the installer tool instead.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:28 PM
Add missing early return when authorization denied (gdiff, 3b273d0)
Abort early if authorization is denied.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:19 PM
Additional check in current-user installation method (gdiff, ddf9172)
Make sure that the gdiff helper tool really is where we expect it to be inside the main GUI app's bundle.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:14 PM
Catch exceptions during NSTask launch (gdiff, e8ceb3f)
Although ditto should be present on all Mac OS X systems (it is included in the base install) NSTask could conceivably throw an exception if the launch path is not accessible (for example if the user has manually removed ditto); catch those exceptions.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:56 PM
Build installer tool as pure C, nor Objective-C (gdiff, 1934124)
The installer tool doesn't (and shouldn't) use the Objective-C runtime, so compile it as pure C rather than Objective-C.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:42 PM
Provide installation back end (gdiff, 519e7e3)
First draft of installation back end added to main application controller.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:37 PM
September 26, 2007
Hook up user interface for tool installation (gdiff, 194c4f9)
Add a menu item to bring up the installer dialog, set up the bindings and connections for initiating installation in response to button clicks, show a progress indicator and disable the buttons when an install is in action.
This is only the user interface; the back end has not yet been put in place.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:40 PM
Add installer tool (gdiff, 7cf455b)
Due to shortcomings in Apple's AuthorizationExecuteWithPrivileges API (namely, the fact that it doesn't return the exit code or the process id of the executed process) it is necessary to interpose an intermediary wrapper process that explicitly communicates its process id back to the parent process prior to executing the real installer.
Hideously cumbersome approach but it's the way the Apple sample code does it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:59 PM
Synergy r406, 1 item changed
Annotations to WOControlButtons
Posted 4:22 AM
September 25, 2007
Add window for auto-installation of helper tool (gdiff, 242260e)
Add a prototype version of the installation dialog to the main menu nib.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:39 PM
Customize main menu (gdiff, 03991f3)
Replace generic references to the application in the default main menu nib with its actual name.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:23 PM
Add application controller (gdiff, bb5fad2)
Add a (currently blank) application controller to the main menu nib. This will later be used to manage any application-wide aspects such as preferences (if any) and installation of the command-line tool.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:21 PM
Update Info.plist to reflect new document class (gdiff, dd4f9e0)
The refactoring tools provided with Xcode don't actually handle all the places where renaming a class may require changes to be made. In this case the Info.plist file's NSDocumentClass key still had a stale value.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:14 PM
Remove redundant system header imports (gdiff, 4e63885)
The prefix header already covers the majority of system header imports throughout the code, so remove those unnecessary imports, saving a few lines in many different files.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:11 PM
Restore WODocument class (gdiff, e3818cb)
This class is the result of refactoring the original MyDocument class, but due to an oversight the renamed files weren't added to the repository.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:09 PM
Fix syntax error in tool (gdiff, a98814a)
A previous commit included a variable rename, but one instance of the old name was left behind.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:08 PM
Refactoring of path utilities for readability (gdiff, cadc4d8)
For better readability, break out two chunks of the path_for_tool function and place them in dedicated functions of their own: get_search_path_from_environment and get_search_path_from_sysctl. This makes the program flow a little more readable and also enables some neater handling of resource cleanup, seeing as now only one of the function explicitly mallocs memory.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 5:03 PM
Factor out path_for_tool function (gdiff, 86bf53c)
Move tool-locating code into a separate function where it can be used by both the command-line tool (to locate git-diff) and the GUI tool (to locate git-cat-file).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:45 PM
Teach tool new ways to get input (gdiff, 64de21c)
The tool now has three modes of operation:
(1) When supplied no arguments reads Git diff output from the standard input. This allows usages such as:
git-diff ARGUMENTS | gdiff cat PATCHFILES... | gdiff
(2) As a special case, when supplied a single argument, "--help", shows usage information.
(3) In all other cases tries to invoke git-diff, passing along the supplied arguments and capturing the input. That is:
gdiff foo bar
Will invoke:
git-diff foo bar
And capture the output.
The git-diff tool is searched for in the locations defined by the PATH environment variable, and if no PATH is set the search falls back to the locations specified by the user.cs_path sysctl setting.
At the moment the tool doesn't actually do anything with the input. A future commit will add the ability to locate the GUI application and pass the input to it for processing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:25 PM
Refactor: rename MyDocument.nib to Document.nib (gdiff, 7175fde)
Once again, override default name for the document nib, this time losing the unnecessary "My" prefix.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:34 PM
Refactor: rename MyDocument to WODocument (gdiff, 81b8aee)
Replace default NSDocument subclass name with something more specific.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:32 PM
Roll tool into Xcode project (gdiff, cc8b116)
Rather than having a tool subdirectory and a gui subdirectory the top-level directory now corresponds to a single Xcode project which contains two targets, one for the GUI and one for the command-line tool.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:11 PM
Split Ragel generation into two phases (gdiff, 3e94d7d)
In an effort to fix the spurious rebuilds mentioned in commit 828150d I split the Ragel generation into two phases, each with a separate build rule.
The first phase operates on ".rl" files, feeding them into ragel to produce XML files with a ".ragel" extension.
The second phase takes those ".ragel" files and uses rlgen-cd to produce the Objective-C source.
The generation of dot files was removed entirely to eliminate a potential source of complication in the dependency analysis (although it should work with any number of files).
Although the spurious rebuilds persist (curiously only in Release builds, not in Debug builds) I am going to keep this commit as I think the two phase approach is more robust. I can later add in dot-file generation as a separate target if desired.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:33 PM
Roll Ragel generation into Xcode build (gdiff, 828150d)
Migrate the WODiffMachine class to the GUI application build as well using a custom build rule to generate the Objective-C (.m) file from the Ragel (.rl) source.
Although this works there appears to be a problem in the Xcode dependency analysis wherein ragel is run on every single build even when no files have been changed; this in turn causes the built WODiffMachine Objective-C file to itself be rebuilt, and the project relinked. Hopefully will be able to isolate the cause of these unnecessary rebuilds and eliminate them.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:19 PM
Move model classes from tool into GUI app (gdiff, 90dff09)
Move WOChange, WODiff and WOFile into the GUI app; the tool will be modified to merely locate and call the GUI application.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:02 PM
Add scroller target methods (gdiff, 23421db)
Add skeletal methods called whenever the user interacts with the scroller. For the time being doesn't actually do anything, pending the addition of the model code.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:57 PM
Add pragma mark navigation aids to MyDocument (gdiff, 67739bc)
Use pragma mark directives to add headings and separators to groups of related methods in the MyDocument class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:33 PM
Replace prefix header with global header (gdiff, 25903a1)
Fall back to standard use of <Cocoa/Cocoa.h> as prefix header and create a separate target-specific global header for target-specific macros.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:28 PM
Set up default pbxuser settings (gdiff, 6120b07)
Add default.pbxuser in the Xcode project bundle.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:20 PM
Prototype view hierarchy (gdiff, 47bba3c)
Introduce the basic view hierarchy, using the MyDocument class as a controller which instantiates and configures a WODiffView and its subviews.
WODiffView is a simple container view that implements the auto-resizing logic, ensuring that when the parent window is resized the subviews are appropriately adjusted to match.
On the left we have an NSView which is used to group together a WOGutterView (for displaying line numbers) and a WOFileView (for displaying the contents of a blob). In the middle we have an WOGlueView which is used to draw shaded curves which visually link together changes made on one side (the "from" file) and those made on the other (the "to" file). Finally, on the right we have another NSView which is used to group together another WOFileView, another WOGutterView and an NSScroller.
When resizing the window all "columns" should remain fixed in width except for the two WOFileViews, which should grow and shrink as required to fill all of the available space. All columns resize vertically to fill all available space.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:18 PM
Prepare WOFile class for storing blob contents (gdiff, 92f1012)
Add properties for holding the contents of the "from" and "to" blobs.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:39 AM
Updates for Objective-C 2.0 (gdiff, 12b90fb)
Convert classes to use Objective-C 2.0 properties and use shorter-form initializations that become possible under Garbage Collection.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:35 AM
Use Wincent Buildtools for configuration (gdiff, b595070)
Clean up build settings by using standard configuration files from the Wincent Buildtools.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:38 AM
Xcode project bundle cleanup (gdiff, 30f9912)
Remove user-specific mode file that shouldn't have been in the repository.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:35 AM
Rename "English.lproj" to "en.lproj" (gdiff, 28c8b8c)
Rename resources folder to match Apple's recommendations.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:32 AM
Set up ignores for project bundle (gdiff, fcff560)
Ignore all "*.mode" and "*.pbxuser" files except for "default.pbxuser".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:31 AM
Initial import of GUI project (gdiff, 2c1f187)
This is just the freshly-created template for the GUI part of gdiff, with default content as provided by Xcode.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:29 AM
Move files into "tool" subdirectory (gdiff, 4b5689c)
Move all existing files into a "tool" subdirectory, to keep them isolated from the development of the GUI front-end (in the "gui" subdirectory).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:26 AM
Add 512x512 version of icon (Synergy, 0fc5a2f)
As noted elsewhere for Synergy Advance, the latest Leopard seed allows me to finally integrate the high-resolution version of the Synergy icon.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:19 AM
Add 512x512 version of icon (Synergy, 0fc5a2f)
As noted elsewhere for Synergy Advance, the latest Leopard seed allows me to finally integrate the high-resolution version of the Synergy icon.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:19 AM
Add 512x512 version of icon (Synergy Advance, 1b6f921)
Icon Composer has been fixed in the latest Leopard seed, allowing me to add the high-resolution version of the icon to the existing ".icns" file.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:16 AM
September 23, 2007
Report parse errors on failure (gdiff, 694ee81)
In addition to returning nil when a parse failure occurs, we now print a diagnostic message to the console containing line number information.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:59 PM
Replace atoi() with explicit conversion (gdiff, 5e549a8)
Ripping out the atoi() calls allows another great simplification to the state machine: instead of having to maintain multiple pointers to the starting characters of the desired substrings it is sufficient to have a simple accumulator variable and use a Ragel "all transitions" action ($) to perform an incremental ASCII-to-integer conversion.
This not only saves a few lines of code, it should also be faster due to the saved function calls.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:58 PM
Be encoding-agnostic with respect to paths (gdiff, cb1f777)
While thinking about how to handle possible different, platform-dependent text encodings in path names I realized that the best thing to do would be to be encoding-agnostic and do what Git goes: display the raw bytes of the path using escape sequences for non-ASCII and non-printable characters.
gdiff doesn't actually need the paths in order to show the file contents (it will ask Git for the blobs based on their hash identifiers) so the paths are for display purposes only. For display the non-ambiguous format using escape markers is actually much better. This simplifies the code greatly and makes it much more robust.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 8:44 PM
Capture blob ids (gdiff, 74a672c)
Update the state machine to capture blob ids and store them in the WOFile objects. This is a simple ASCII capture which requires a pointer to be set on seeing the start of the desired substring and then actually creating a new object based on the subtring upon reaching the end.
Note that these are abbreviated SHA-1 hashes, not full numeric hashes, so I store them as strings rather than numbers. I will later be passing these strings to other Git tools (such as git-show) so there is no point in using a numeric representation.
Given that this requires the addition of the ASCII capture machinery I also use it for capturing unquoted paths, seeing as it is simpler and faster.
At this point I did some experimentation and discovered that quoted paths and numeric escapes of the form "\ddd" are used whenever a path contains non-ASCII characters in it. This commit includes some proof-of-concept code for recognizing and recording these numeric escapes, although as noted in the comments to make it actually work I'll need to instead capture raw bytes one by one (most likely into an NSMutableData object) and finally converting the data to a string in one shot rather than working at the per-character level as I currently do.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:04 PM
September 21, 2007
Record filenames (gdiff, 52e4e48)
Updates to WOFile and WODiffMachine to record filenames during scanning. At this point the WOFile class is basically complete as all it has to do is track filenames and changes.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:38 PM
Show usage information when no arguments supplied (gdiff, cf8804a)
Add stub function for displaying usage information; will need to flesh out this information as options are added.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:27 PM
Flesh out model classes (gdiff, 10a143b)
Provide basic implementations of the model classes that are used to represent diffs, and modify the state machine implementation to make use of them. In its current form gdiff can now produce WODiff objects containing a list of WOFile objects which themselves contain a list of WOChange objects for the sample input files (basic diffs); support for special case diffs is still to be added.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 1:57 PM
Whitespace cleanup (gdiff, 1a26c37)
Fix unwanted trailing whitespace that crept in with the last commit.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:07 AM
Thin class wrapper for state machine (gdiff, d0d55ee)
This commit refactors the previous implementation, splitting it off into a thin objective wrapper with a separate main executable implementation. In addition the basic models which the state machine will use to build up a representation of the diff (diffs, files, changes) have been added.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:04 AM
September 20, 2007
Add Makefile (gdiff, dac88ba)
Simple Makefile for going from a Ragel input file to an executable (.rl to .xml, .xml to .m or .dot, .m to executable, .dot to .png).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:56 PM
Initial import of diff.rl file (gdiff, 2ab5e1c)
This is a skeletal implementation of a Ragel state machine for parsing the output of "git diff". At this stage it doesn't actually do anything other than recognize the diff and print logging statements along the way to show what input it is seeing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:55 PM
September 16, 2007
Update Gestalt-based APIs to match Apple's clipping behaviour (WOCommon, 6ce256c)
Apple's gestaltSystemVersion wraps in such a way that Mac OS X 10.4.10, for example, is represented as 0x00001049. This commit updates the WOMachine API to match this clipping behaviour exactly.
If more precise detection of the system version is required in the future there are two approaches which (reading the system version plist, and switching to newer parts of the Gestalt API) which can be implemented, but in the absence of any pressing need for such a shift there is no justification for making changes just yet ("do the simplest thing that could possibly work").
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:29 PM
Better performance in singleton pattern (WOCommon, 7a71a42)
Really just a micro-optimization for an infrequent case, this commit performs synchronization against "self" rather than a hard-coded class object. We save one message send on an infrequently-travelled code path and save a few keystrokes. This is safe in a context where the singleton classes themselves aren't subclassed, something which will never happen with these examples because they already constitute specialized "end points"; the Doxygen comments have been updated to warn against subclassing.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:55 PM
Solution for Exercise 1.20 (snippets, 01c89ee)
Add function that takes a list of lists and returns a list of their lengths.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:22 PM
Use wildcards where appropriate (snippets, 17cfb75)
Use the wildcard operator (_) in pattern matches for parameters which aren't actually used in the calculation. This makes it clearer at a glance which values we don't care about.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 4:22 PM
Set Garbage Collection to "required" (buildtools, 6df5a68)
Bump GC setting from "supported" to "required".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:20 PM
Clarify comments with respect to copying of singleton objects (WOCommon, 1d27e78)
Note that most singleton classes inherit from WOObject, which in turn inherits from NSObject, and that given that neither of these implement the NSCopying protocol "out of the box" then it isn't even necessary to provide a special implementation of copyWithZone: in the vast majority of cases.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Remove WOSingleton class and all references to it (WOCommon, 839cadd)
All singleton classes now use independent, non-abstracts implementations of the singleton pattern, so this commit removes the WOSingleton class itself, the accompanying unit tests, and updates the documentation to remove all references to WOSingleton as well explaining the rationale for its removal.
For several years I used a WOSingleton class as a means of encapsulating a rigorously enforced, fast, thread-safe, sub-classable singleton pattern. Thread-safety and speed were achieved by using a combination of synchronization, fast NSMapTable lookups, double-checked locking, and memory barriers.
With the advent of garbage collection I revisited my solution once again and decided to scrap it in favor of a simpler, non-abstract model wherein each singleton class implemented the minimal necessary code to provide an "advisory" singleton. That is, rather than trying to enforce the singleton pattern by overriding allocWithZone: and init, I instead provide a simple sharedInstance (or similar) method which is documented as the preferred means of creating and using an instance of the class. Callers are free to call alloc/init multiple times if they wish, thus creating multiple instances, but the consequences are undefined; this could potentially be useful for testing purposes. My only attempt at "enforcement" is to override copyWithZone:; this is done to prevent inadvertent creation of multiple instances. For speed the sharedInstance method employs a simple double-checked locking pattern with memory barriers (much simpler than the generalized solution that had to work with the not-thread-safe NSMapTable).
Although this approach requires a small amount of code per new singleton class, the result is faster, simpler and less likely to have unidentified bugs.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Update registration nib to reflect new class hierarchy (WOCommon, c08e31e)
The registration controller's inheritance hierarchy has changed so the nib must also be updated. In the process the nib was (non-optionally) upgraded to the new XML-based nib format.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Remove WOSingleton dependency from WORegistrationController (WOCommon, 515521f)
Although there should never be any need to have more than one instance of WORegistrationController active at any time, there is no real need to enforce singleton behaviour either. A single WORegistrationController instance is generally instantiated in a nib rather than programmatically so there should never be more than one instance at a time anyway; even if there were it would be completely harmless.
So this commit removes the dependency on WOSingleton as it is an unnecessary complication.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Remove dependency on WOSingleton from WOLoginManager (WOCommon, 4450945)
Give WOLoginManager its own local implementation of the singleton pattern rather than using the abstract one inherited from WOSingleton.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Modernize WOLoginManager header (WOCommon, 48ddb87)
Lose references to WOBase and modernize date formats.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Update NSString category documentation (WOCommon, 0b67683)
Update documentation to reflect new class hierarchy (inheritance directly from WOObject rather than WOSingleton).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:08 PM
Remove WOSingleton dependency from WOCDSAWrapper (WOCommon, 1cc4db9)
WOCDSAWrapper now uses its own local implementation of the singleton pattern rather than depending on WOSingleton.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Modernize WOCDSAWrapper header (WOCommon, 5f66c76)
Drop unnecessary references to WOBase.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Drop use of WOSingleton for WOBaseCore (WOCommon, 4c61ee1)
WOBaseCore is a lightweight wrapper class that contains only class methods and is never actually instantiated, so there is no need for it to be a singleton. If there ever does arise a need for it to have singleton behaviour then a straightforward local (non-abstract) implementation can be easily added rather than depending on WOSingleton.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Layout tweak for WOProcessManager (WOCommon, 34b61b0)
Readibility enhancement for WOProcessManager.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Migrate WOProcessManager from WOSingleton to local implementation (WOCommon, c37e6c9)
Dump the abstract enforced singleton pattern obtained from using WOSingleton as a superclass and instead use a lightweight local advisory implementation implemented using a double-checked locking pattern with memory barriers.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Garbage collection changes for WOProcessManager (WOCommon, 6ab78fb)
Lose retains and replace WO_RELEASE call with explicit use of CFRelease.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Cleanup headers for WOProcessManager (WOCommon, cf35f30)
Modernize dates and remove unnecessary frills from headers.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Add pragma mark separator in WOMachine.m (WOCommon, e297450)
Use pragma mark to provide a separator between the global variables section and the class implementation in WOMachine.m.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Drop volatile keyword from singleton initializers (WOCommon, 23a9a8a)
The use of the volatile keyword in the WOLogManager, WOMachine and WOSysctl singleton initializers is unnecessary, as correct ordering is already guaranteed by the use of memory barriers, so drop it.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Update memory barrier documentation (WOCommon, dfbe816)
Replace existing Doxygen comments with much clearer, more rigorous explanation of memory barriers and how they work, along with an example demonstrating the double-checked locking pattern for singletons.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Modernize Doxygen comments in WOSysctl (WOCommon, 08d144f)
Update Doxygen comments to use new format, as well as adding appropriate group start and end markers.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove WOSysctl dependency on WOSingleton (WOCommon, 6587b27)
Move from the abstract singleton implementation provided by WOSingleton to a local, "advisory" pattern provided within the WOSysctl wrapper class itself.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Make WOLogManager singleton pattern truly advisory (WOCommon, 545d56c)
Commit 343dc6b removed WOLogManager's dependency on WOSingleton but there was one place (in the init method) where the code still had an "enforcement" approach to the singleton pattern. This commit removes that code thus making the behaviour totally advisory.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Comment corrections in WOLogManager (WOCommon, a6a07ed)
Remove some out-of-date comments and clarify others.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Rename WOLogManager sharedInstance to sharedManager (WOCommon, 7975cf4)
Prefer the more descriptive name, sharedManager, to the generic, sharedInstance for the singleton instance of the WOLogManager class.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove WOLogManager dependency on WOSingleton (WOCommon, 343dc6b)
Make WOLogManager a WOObject subclass, removing the dependency on WOSingleton and instead implementing a local (non-abstract) "advisory" singleton pattern. Given that the initialization code is already thread-safe (done with double-checked locking and memory barriers) I also greatly simplify the load-time initialization code; in the unlikely event that it were called twice only one singleton instance would be instantiated anyway.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Clean-up WOMachine for Leopard (WOCommon, 3c97657)
This commit removes methods that were previously marked as deprecated and which are no longer of any use when running on Leopard, and cleans up some Doxygen comments for better accuracy.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Add unit tests for running on Leopard (WOCommon, afcac1f)
Add WOMachine tests to confirm that Leopard detection works properly.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove dependency of WOMachine on WOSingleton (WOCommon, 2f15f2d)
Implement a simple (non-abstract) advisory singleton pattern for WOMachine.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Revert "Remove methods which are no-ops under Garbage Collection" (WOCommon, 303c463)
This reverts commit ca1fae39ce738fc41d3da3d7c3749b2e3f77fe29. It turns out that evidently the runtime still does send those messages at times even though they are meaningless under Garbage Collection, thus causing some unit tests to fail. This reversion allows the singleton-related unit tests to pass again.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Fix indentation in WOSingleton.m (WOCommon, a66b2bc)
Missing space in one line of WOSingleton.m.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Cleanup WOSingleton header (WOCommon, a463e15)
Remove redundant method declarations in the header (stuff that is inherited from NSObject) and the accompanying Doxygen blocks (some of which had technical discrepancies anyway), convert remaining Doxygen blocks to use the currently preferred style (the one which gets along most nicely with Xcode's automatic indentation), eliminate some superfluous whitespace, and update the date format to match the standard.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove methods which are no-ops under Garbage Collection (WOCommon, ca1fae3)
Methods like retain, release and so forth were implemented as no-op operations for the WOSingleton class. Now, under Garbage Collection, not only are they no-ops but the compiler will never actually generate any message sends for those selectors. So this commit now removes the unneeded methods completely.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Dump pathForFolder:domain: test (WOCommon, 06a34ee)
Comment out this test as it most likely won't work on clean installs of the OS (where the tested directory doesn't even exist yet).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove all HOM from WOCommon (WOCommon, ab9f927)
The latest preview seed of Leopard mysteriously breaks much of the HOM code that worked on Tiger and on previous Leopard seeds. Rather than trying to graft an idea that's seen in Ruby, Smalltalk, Haskell and such onto Objective-C, simply go with the flow and accept that the extremely low-level runtime wrangling that is necessary to get this working amounts to chasing a moving target; it's just too brittle to justify the time investment in this, especially when it is effectively swimming against the current, trying to get Objective-C to do something it wasn't designed to do, and generating unorthodox code that will be hard for other Objective-C programmers to digest.
So this commit either modifies or outright removes about 90 files from the source tree; somewhat painful to throw away so much work, but it seems the pragmatic thing to do.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Update Xcode project for latest version of Xcode (WOCommon, 9b40995)
The latest version of Xcode upgrades the object version format.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:07 PM
Remove use of HOM methods (Synergy Advance, 04831bb)
Given that some of the HOM code is broken on Leopard and the time before Leopard ships is rapidly dimishing, replace uses of HOM methods with conventional program flow. The number of sites where the technique is used in the Synergy Advance code base is still quite small so this is only a minor change; once Leopard ships I can always consider going back and investigating the cause of the breakage, but for now I will be removing the HOM stuff from the WOCommon unit tests (in a separate commit to the WOCommon repository).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Update project file for new version of Xcode (Synergy Advance, f35a1f1)
The latest version of Xcode updates the object version used when saving project files.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Merge branch 'master' of git.wincent.com:[filtered]/Synergy (Synergy, 7bc11aa)
<unknown>
Posted 3:05 PM
Additional Leopard-related project changes (Synergy, f2d4f39)
The change to GCC 4.0 from commit da40c00 wasn't really complete because it did not include changes to the "build rules", although they were in my local working copy. I then accidentally threw away those changes by doing a "git checkout -f master" (was puzzled as to why merely "git checkout master" didn't work; was bailing with "not uptodate. Cannot merge."; I had forgotten that my local fix_deprecation_warnings branch was actually forked from my leopard_conversion branch and not from master; in fact, I'd forgotten that there even was a leopard_conversion branch!; this will teach me to use "git branch" and "git show-branch" more often to remind me where I actually am).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Fix deprecation warnings (Synergy, 3fc1880)
Compiling under Leopard and GCC 4.0 yields various warnings about deprecated APIs and some questionable C constructs. This commit replaces all calls to deprecated APIs with calls to new APIs, and makes other changes to eliminate C-related warnings.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Update project settings for Leopard (Synergy, da40c00)
This commit makes a number of changes to the project bundle to bring it in line with conventions already in use for other projects targetting Xcode 3.0 and Leopard.
This includes use of the 10.5 SDK, the removal of legacy build settings, use of GCC 4.0 across the board, and the renaming of the Development/Deployment build configurations to Debug/Release.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Set up ignores for Xcode project bundle (Synergy, 0f03841)
Ignore all ".mode1*" and ".pbxuser" files except for default.pbxuser.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
Bump version numbers for Leopard series (Synergy, 3a2e8ff)
The 3.5 series will be for Leopard only, while the 3.1.x series will continue to support legacy systems (currently as far back as Jaguar).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:05 PM
September 13, 2007
Merge branch 'master' of git.wincent.com:[filtered]/Synergy (Synergy, 7bc11aa)
<unknown>
Posted 4:02 PM
Additional Leopard-related project changes (Synergy, f2d4f39)
The change to GCC 4.0 from commit da40c00 wasn't really complete because it did not include changes to the "build rules", although they were in my local working copy. I then accidentally threw away those changes by doing a "git checkout -f master" (was puzzled as to why merely "git checkout master" didn't work; was bailing with "not uptodate. Cannot merge."; I had forgotten that my local fix_deprecation_warnings branch was actually forked from my leopard_conversion branch and not from master; in fact, I'd forgotten that there even was a leopard_conversion branch!; this will teach me to use "git branch" and "git show-branch" more often to remind me where I actually am).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:23 PM
Fix deprecation warnings (Synergy, 3fc1880)
Compiling under Leopard and GCC 4.0 yields various warnings about deprecated APIs and some questionable C constructs. This commit replaces all calls to deprecated APIs with calls to new APIs, and makes other changes to eliminate C-related warnings.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:11 PM
Update project settings for Leopard (Synergy, da40c00)
This commit makes a number of changes to the project bundle to bring it in line with conventions already in use for other projects targetting Xcode 3.0 and Leopard.
This includes use of the 10.5 SDK, the removal of legacy build settings, use of GCC 4.0 across the board, and the renaming of the Development/Deployment build configurations to Debug/Release.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:28 PM
Set up ignores for Xcode project bundle (Synergy, 0f03841)
Ignore all ".mode1*" and ".pbxuser" files except for default.pbxuser.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:20 PM
Bump version numbers for Leopard series (Synergy, 3a2e8ff)
The 3.5 series will be for Leopard only, while the 3.1.x series will continue to support legacy systems (currently as far back as Jaguar).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 2:18 PM
September 11, 2007
Solution for Exercise 1.17 (snippets, 3b62460)
Add prefix function from text and substring function which returns True if the first passed String is a substring of the second String.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 11:11 PM
Generalized max function (snippets, 6c31925)
Based on understandings gained in Exercise 1.15, add a new "max''" function that works for any type in the Ord class, not just for Int types.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:55 PM
Add solution for Exercise 1.15 (snippets, e370df9)
Add function for sorting a list of Strings in alphabetical order. Also adds a generic supporting function for removing the first found instance of an item in a list, and another for determining the "minimum" in a list of Strings.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 10:48 PM
Merge branch 'master' of git.wincent.com:[filtered]/snippets (snippets, 5b6eb07)
<unknown>
Posted 12:59 PM
Chapter 1 exercises from Haskell text (snippets, 2e48772)
Initial exercise solutions from Chapter 1 of "The Haskell road to logic, math and programming".
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 12:59 PM
September 6, 2007
REnamer r57, 2 items changed
New 512x512 icon for Leopard, kindly provided by Adam "Elroy" Mazzitelli (<http://www.elroyonline.net/>).
Posted 3:49 PM
Add 512x512 version of icon (Synergy, df70d19)
In preparation for Leopard, add a new, ultra-hi-resolution version of the application icon to the repository (not yet integrated into the build process). The update to the icon was kindly prepared by Adam "Elroy" Mazzitelli (<http://www.elroyonline.net/>).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:47 PM
Add 512x512 version of icon (Synergy, df70d19)
In preparation for Leopard, add a new, ultra-hi-resolution version of the application icon to the repository (not yet integrated into the build process). The update to the icon was kindly prepared by Adam "Elroy" Mazzitelli (<http://www.elroyonline.net/>).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 3:47 PM
September 5, 2007
Add 512x512 version of icon to repository (Synergy Advance, b07475c)
Add the new, ultra-hi-res version of the icon to the repository in preparation for Leopard. The icon was kindly prepared by Adam "Elroy" Mazzitelli (<http://www.elroyonline.net/>).
Signed-off-by: Wincent Colaiuta <win@wincent.com>
Posted 6:45 PM


