This class would use the location information provided by
regex(3) as range for for a substring. However, the information
regex(3) returns is a byte-based, while NSString works on characters.
This can cause a problem when there are UTF-8 characters in the string,
as the wrong subsstring will be returned.
This is fixed by taking the UTF bytesequence, and extracting a substring
from that, rather than using NSString's own substring method
Some people have had Serif-fonts in their interface where no specific
fonts for classes/ids were specified. This sets the default-font to
'Lucida Grande' in order to have a nice non-serif on any system.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This uses the same mechanisms as git to determine whether a file is
binary: By simply searching the first 8000 bytes for a 0-byte. This
gets rid of the call to "file" and is a much cleaner and shorter
implementation.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Git 1.6.0 was released over a year ago now, so it shouldn't be too hard
to get people to upgrade to that. We need 1.6.0 for the --children revlist
option.
Requiring Git 1.6.0 or higher means we can also revert
a94981f35 (RevList: Don't rely on the presence of %x00) sometime.
This patch prevents the plaintext display of files with binary content
in tree-view by connecting the content to the textContents attribute.
PBGitTree is extended with the method textContents, which returns the
textual representation of a PBGitTree-object. The methods first checks
the output of "git check-attr binary <file>" to see if the user
set/unset the binary attribute manually. Then it checks for common
binary file-extensions. If this method can't determine whether the file
is binary, the file-content is loaded and Unix "file" is run on the
first 100 bytes of the file to make a decision.
It also adds the -[PBGitTree fileSize] method to check the size
of the file before actually loading its contents.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Edited-by: Pieter de Bie <pdebie@ai.rug.nl>
* pu/jg/docs:
Update releasenotes, as autorefresh won't make it into 0.7
ReleaseNotes for v0.7 with author information
Site: W3C-Valid and CSS/HTML corrections
UserManual: Rewrite most parts for GitX 0.7
GitX 0.7 Release-Notes
UserManual: Add disclaimer as to what GitX is
Conflicts:
Site/UserManual/text/01 - Introduction.markdown
Include Dave's reload feature and author-information for the most
important parts. Also a list of contributors since v0.6.3 from the
shortlog.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
* Makes all the pages (except "See it") W3C Valid
* Adjusts a few texts here and there a little bit
* Makes the menubar span the whole div and display correct on FF/Linux
* Moves "GitX" in the header a few px down to center it
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This patch adds a CFBundleGitRevision key to Info.plist which is set to
the output of "git describe" when building.
The menu-entry for "About GitX" was reconnected to a custom method in
the AppController, which reads the CF-string from the .plist and also
indicates if the build is a DEBUG-build.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This rewrites most of the UserManual for GitX 0.7 and also updates the
screenshots to reflect the latest GitX-version.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Add a disclaimer about the intended use of GitX. A lot of people seem to
think GitX is a way to make using a complex system easy. Other think
that they can learn git by clicking their way around GitX.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This prepares the GitX 0.7 release-notes and also fixes two small bugs
in the previous notes.
It also fixes a CSS-bug which makes the gitx-website display the same
font with Firefox and Safari instead of using a serif with FF.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Add a disclaimer about the intended use of GitX. A lot of people seem to
think GitX is a way to make using a complex system easy. Other think
that they can learn git by clicking their way around GitX.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
When rewriting big parts of commit.js, JD forgot to use the new function
for the "Discard hunk" functionality as well. This fixes that.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This issues a simple reloadRefs when refreshing the commit-view, keeping
the current branchname up-to-date here as well.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
It shouldn't matter if a file has staged / unstaged changes, as long as the
file is tracked, the SHA and blob should be recorded.
This had really annoying complications because PBChangedFile used this
information to decide whether or not to delete a file from the index
when unstaging in PBGitIndexController
* 'js/selectable_hunk' of git://github.com/jdtsmith/gitx:
commit.js: Interface for selecting lines to (un-)stage.
commit.js: Refactor hunk retrieval.
diffHighlighter.js: Record the line index as attribute.
commit view: Ensure buttons display on top of text
When resizing the GitX-window to small widths the buttons for switching
the view-mode would eventually "disappear" behind the label for loaded
commits. This fixes that behaviour, so that the buttons always go in
front of it, and therefore remain usable.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This adds a method to programmatically collapse/uncollapse the two
subviews of our custom SplitView-class. It also implements a
keyDown-method so that the collapsing can be used with
Command-Shift-{Up,Down}.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This adds a subclass to PBNiceSplitView which has collapsible subviews
as well as an uncollapse-method. The initWithTopMin method is used to
set the minimum sizes for the subviews.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
* commit 'origin/master':
CommitController: Don't turn of off automatic rearranging
PBGitRepository: Clean up the readFromURL: method
PBGitRepository: Fix opening of large directories due to bug in NSFileWrapper.
PBGitIndexController: Renamed "Revert" to "Discard"
CommitController: Reject merges
HistoryController: Add "Open Files" menu item
WebHistoryView: Also use the tree context menu
HistoryController: Use a programatically created context menu
WebHistoryController: Refactor menu search to be recursive
HistoryController: Add some marks
PBGitHistory: Add "Show in Finder" to files
Display context menu in the history tree to show related commits
History fileview: select current item on rightclick
PBGitConfig: Add missing sentinel
Remove use of deprecated stringWithCString
HistoryView: only add parents if parents array exists
keyboardNavigation: Fix keys 'c' and 'v' from webView
Site: add link to Twitter
Conflicts:
PBGitHistoryView.xib
PBGitIndexController.m
Maps Return to OK and Escape/Command-Period to Cancel.
Renames OK to Create (a verb is better).
Fixes autoresizing masks so the layout doesn't break when you resize
the sheet.