* commit 'origin/jg/tree_context':
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
In a6b7c0c2a6 (GitCommitController: Also use dictionary lookup for untracked files),
we started using a dictionary when updating the index to avoid O(n^2) lookups
and make the code cleaner at the same time.
Before that change we temporarily stopped tracking the index, so that
the controller wasn't fired with hundreds of KVO notifications. in a6b7c0c2a6,
we removed the re-tracked, but accidentally kept the untracking portion, which
meant that some index changes would not propagate to the controllers.
* stable:
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:
Site/text/contact.markdown
This commit changes readFromFileWrapper:ofType:error: to readFromURL:ofType:error:.
The default implementation of readFromURL calls readFromFileWrapper, but a bug
in NSFileWrapper makes this fail with repositories with a large number of files
(not sure if the fact that those files were in subdirectories matter or not).
So instead we skip the whole FileWrapper thing, which we don't really use anyway,
and just use the URL.
In keeping consistent with the Discard-Hunk functionality we rename the
former "Revert changes" on file-level to "Discard changes". Along with
the menu-item all the functions and variables have been renamed
accordingly. Also get rid of an unnecessary force-function.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This allows us to differentiate between one or multiple files,
and will also come in use when we want to create a context menu
from the webview later on
We now use representedObjects to store the selected paths.
That should make it possible to reuse the menu's from somewhere else.
This adds the "Show in Finder" menu-entry and logic to files in the
tree-view of the history. Also the button "Show commits touching paths"
was renamed to "Show history of files".
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
We forgot to do this when changing the code in 963969af78
(CommitController: don't mutate array we enumerate when refreshing index).
This meant that some changes in the index would not be shown when refreshing,
for example newly added or changed files.
This used to break if a commit had no parents. This wasn't noticed
before because the breakage is only minor -- the only way you see it
is because the detail view didn't scroll up afterwards.
This adds a small method signOff which simply appends a SOB-line to the
current commit-message, using user.name and user.email.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Signed-off-by: Pieter de Bie <frimmirf+gitx@gmail.com>
There was a nasty bug in handling the finishing of the index change.
This code path was changed when I simplified the file tracking, but
as a result the code now mutated the files array, over which
we were also enumerating. This can cause all sorts of bad stuff, like
files that aren't really deleted from the view, to wrong files that
are deleted, to a crash of the system for wrong memory access.
* '5a88e3d' (early part):
keyboardNavigation: Fix keys 'c' and 'v' from webView
PBGitWindowController: Use beginSheetModalForWindow instead of runModal
It used to be displayed in bold, but this can be easily overlooked when
visualizing all branches. It's easier to see the HEAD when it has its own
colour.
We don't want to do this in the commit view, as that way you can't
commit whitespace differences. You'll never be able to have a clean
working tree, and you can't see why the files remain 'unstaged'. So, we do this
only for the history view :)
This fixes two small bugs:
1. The JavaScript-method is called "showDiff" instead of "showDiffs"
since cfbcfc1f38. That's why the 'v' button didn't work since then.
2. Commit f05d0188fc introduced an error when trying to access
"event" for key-presses from Cocoa, which resulted in an error and
therefore made the following if-statements unreachable.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This fixes two small bugs:
1. The JavaScript-method is called "showDiff" instead of "showDiffs"
since cfbcfc1f38. That's why the 'v' button didn't work since then.
2. Commit f05d0188fc introduced an error when trying to access
"event" for key-presses from Cocoa, which resulted in an error and
therefore made the following if-statements unreachable.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Introduce a new showMessageSheet/showErrorSheet-method for
PBGitWindowController which uses the beginSheetModalForWindow method of
NSAlert whereever possible. This has the advantage over runModal as it
doesn't block the other instances of GitX and is generally more
unobstrusive for simple status-messages.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This adds a removeBranch method similar to the addBranch method. It
calls these methods when a branch is created/deleted in the UI, avoiding
the cost of simply calling refresh afterwards.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This enables a "discard" button for unstaged hunks which simply gets rid of the
changes (by using "git apply --reverse").
To avoid repetition, the stageHunk method was split into a more generic
processHunk method. The "discard" functionality is called through
discardHunk.
The NSAlert shown when discarding can be bypassed by pressing "Alt"
while clicking the discard-button.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This fixes a simple error where a staged file was read and added with
its mode/sha exchanged, and therefore its index-info could not be used
by update-index.
The error was introduced in a6b7c0c2a6. This fixes ticket #159.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
* pu/pb/fix_refresh:
Rename 'CachedChanges" to "StagedChanges" for greater consistency
PBChangedFile: remove shouldBeDeleted boolean
GitCommitController: Also use dictionary lookup for untracked files
CommitController: Use a dictionary lookup when refreshing index
GitCommitController: clean up index functions
We fake the index entry for the untracked files, and then use
the same method as we used earlier for adding the files. This
allows us to delete untracked files without problem, and is
generally a nicer implementation.
This way, we can accurately change the status of all existing files,
and keep the same files.
Now, what is needed is a way to do the same for the 'other changes',
and then we can remove the shouldBeRemoved stuff