- add an action menu for the selected ref in the source view
- add Add Remote, Fetch, Pull and Push buttons to the bottom bar
- Add Remote icon by Nathan Kinsinger
- Fetch, Pull and Push icons are modified versions of André Berg's icons (from 4396081c07) made a bit smaller to fit in the UI better.
- move the status message for both the history view and the commit/stage view
- all PBViewControllers now have status and isBusy properties and can use those to put a message in the bottom bar when they are the active content controller of the window
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
* 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
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.
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 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
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 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
* stable:
When selecting a folder in tree-view, display the
PBGitRepository: Correctly indicate bare/non-bare repos
Get rid of some unnecessary casts
CommitController: Don't rewrap commit message when amending
Release notes for 0.6.3
PBGitCommit: Call git show with --no-color to be safe
Info.plist: Fix handling of directories
PBGitIndexController: fix uninitialized value
Conflicts:
PBGitCommitController.m
A failure of the commit-msg hook (similar to the
pre-commit hook) will cause the commit to abort.
Commit-msg requires an argument containing the
filename holding the commit, in this case
.git/COMMIT_EDITMSG.
Typically, git-commit writes the commit message
to .git/COMMIT_EDITMSG. This writes the commit
message to that file manually to assist in
hooks such as commit-msg and
prepare-commit-msg which expect this file as the
first argument.
We used to use git log with a custom pretty command to reread the commit message,
but this rewraps the subject line, and also adds extra newlines. We fix this
by reading in the raw commit from git-cat-file, and then searching for the
double newline.
* stable:
Fix many gcc 4.2 compiler warnings
GitX.xcodeproj: Quote paths in custom shell scripts
Fix compilation with GCC 4.2
IndexController: Temporarily stop tracking when (un)staging
IndexController: Add methods to stop tracking the Index
ChangesTableView: Remove warning by casting to correct class
Conflicts:
PBGitCommitController.m
Based on a patch by Faustino Osuna <enrique.osuna@gmail.com>
A failure of the pre-commit hook (a non-zero
result from the hook) will cause the commit to
abort. A failure of the post-commit hook has no
effect of the rest of the operation, however, it
is noted in the user interface.
This fixes Lighthouse#50
When unstaging the last cached hunk of a file, the file remained in the
"Staged Changes" column, with the notice "This file has no more changes"
and the "Unstage"-button remaining in the diff-view.
This fixes this behaviour by correctly distinguishing files in the
files-array not only by filename but also by unstaged/cached status,
s.t. for a file with unstaged and cached changes, there are two entries
in the files-array.
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
We used to change the PBFile status every time we found a
similarly named file. Because the unstagedFilesController
had a filter and sort predicate for these, the array was
rearranged every time an existing file was found. This quickly
leads to stalling.
We fix it by temporarily disabling the automatic rearranging
and then reenabling it when we're finished.
The message that the commit was succesful used to disappear
because after the commit, the index would refresh and another
file would be shown. We fix this by never requiring a file to be
selected.
We used to read in a completely new array when refreshing
the index. The problem with this is that the selection
changes when reading in the new array. We avoid this
by changing the current array, rather than loading in
a completely new one.