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 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>
Just before releasing 0.6, I cleaned up some old code.
In c6895105e2 (Remove old code in Commit/Diff views),
I removed some pre and code tags, causing new files
in the commit view to be displayed without line breaks
This adds a slider in the commit view with
which the user can change the context size.
This is useful for example if the hunks are too
big; by changing the context size, a hunk can be
split and then the changes can be committed.
Previously, the diff hilighter was a bit odd in that it would
just search for elements with a diff and highlight those. While
useful in theory, this wasn't used at all. We change it to
receive the diff to hilight, which makes the code somewhat simpler.
This merges functionality that was previously stored in the
combination of PBGitCommitController / PBChangedFile to a
dedicated controller, PBGitIndexController.
This adds a div in the webview to display the current commit
state. It allows us to notify the user of new commits by
showing something in the webview, rather than a modal
dialog.
This changes the HTML part of GitX to be more consistent -- we
now use a "views" directory where every web view has it's own
directory.
Furthermore, GitX-wide Javascript is added in the "lib" directory.
The same is true for CSS in the "css" directory. Every view can
have its own custom CSS and JS, and those are put in the views
directory (without JS or CSS prefix directories).