Commit Graph

677 Commits

Author SHA1 Message Date
JD Smith bcc652bacf commit view: Ensure buttons display on top of text
... but beneath title line.
2009-06-21 02:26:32 +01:00
Pieter de Bie 64182ea911 Merge commit 'origin/jg/tree_context'
* 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
2009-06-20 22:28:19 +01:00
Pieter de Bie a03401dd51 CommitController: Don't turn of off automatic rearranging
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.
2009-06-20 21:58:34 +01:00
Pieter de Bie 6fd339756e Merge branch 'stable'
* 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
2009-06-20 21:34:49 +01:00
Pieter de Bie fa6ff44d0b PBGitRepository: Clean up the readFromURL: method
We used a BOOL value which was returned afterwards,
but we might as well just return early and simplify everything
2009-06-20 21:33:22 +01:00
Benoit Cerrina fa6182e2a4 PBGitRepository: Fix opening of large directories due to bug in NSFileWrapper.
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.
2009-06-20 21:33:22 +01:00
Johannes Gilger 34f72ba27a PBGitIndexController: Renamed "Revert" to "Discard"
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>
2009-06-20 21:19:26 +01:00
Pieter de Bie d6ccf34881 CommitController: Reject merges
We don't support this in any way yet, so let's just
issue a warning rather than failing silently
2009-06-20 21:10:54 +01:00
Pieter de Bie 7427cbe05d HistoryController: Add "Open Files" menu item 2009-06-16 19:41:57 +01:00
Pieter de Bie a002e3316c WebHistoryView: Also use the tree context menu 2009-06-16 19:41:57 +01:00
Pieter de Bie 1199c56e93 HistoryController: Use a programatically created context menu
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.
2009-06-16 19:41:52 +01:00
Pieter de Bie c9609f22b6 WebHistoryController: Refactor menu search to be recursive
This way it doesn't matter where in an element you click, as
long as one of its parents has the required attributes, you
get the menu
2009-06-16 19:30:12 +01:00
Pieter de Bie 47e182a910 HistoryController: Add some marks 2009-06-16 19:30:12 +01:00
Johannes Gilger dc234cfdc9 PBGitHistory: Add "Show in Finder" to files
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>
2009-06-16 19:30:11 +01:00
Pieter de Bie d973dc5ba7 Display context menu in the history tree to show related commits
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-06-16 19:30:11 +01:00
Pieter de Bie d04362ba82 History fileview: select current item on rightclick 2009-06-16 19:30:11 +01:00
Pieter de Bie ad2213ce2f CommitController: Notify observers when adding files
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.
2009-06-16 19:06:57 +01:00
Pieter de Bie 69759e7464 PBGitConfig: Add missing sentinel 2009-06-15 23:09:29 +01:00
Pieter de Bie 46740dc3f3 Remove use of deprecated stringWithCString 2009-06-15 23:09:09 +01:00
Pieter de Bie 4391c458d0 Merge commit 'dd0822d5cd52dd8a2e1ac1ee318f8fa685c2e420'
* commit 'dd0822d5cd52dd8a2e1ac1ee318f8fa685c2e420':
  PBGitCommitController: Don't allow duplicate Sign-Offs
2009-06-15 14:21:46 +01:00
Pieter de Bie 83a1453971 Site: update links to reflect move to mailing list 2009-06-15 14:21:35 +01:00
Johannes Gilger dd0822d5cd PBGitCommitController: Don't allow duplicate Sign-Offs
This prevents signing off a commit-message twice by the same person,
just like git-gui does.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-06-13 14:13:33 +02:00
Pieter de Bie 5f97caabd1 HistoryView: only add parents if parents array exists
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.
2009-06-12 00:15:00 +01:00
Johannes Gilger 93124387c4 PBGitCommit: Add "Sign-Off" button/method
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>
2009-06-11 23:39:08 +01:00
Pieter de Bie 963969af78 CommitController: don't mutate array we enumerate when refreshing index
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.
2009-06-11 23:37:41 +01:00
Pieter de Bie 5090d4f159 Merge branch '5a88e3d' (early part)
* '5a88e3d' (early part):
  keyboardNavigation: Fix keys 'c' and 'v' from webView
  PBGitWindowController: Use beginSheetModalForWindow instead of runModal
2009-06-11 23:22:36 +01:00
Steven Michalske 58ac6ed1ff HistoryView: Change the way the HEAD is displayed
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.
2009-06-11 19:50:45 +01:00
Pieter de Bie c00f736053 Add preference to ignore whitespace differences in history view
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 :)
2009-06-11 19:40:08 +01:00
Pieter de Bie e45c088099 Preferences: Resize views
This makes them all have the same width
2009-06-11 19:02:34 +01:00
Pieter de Bie a14495052a PBGitCommitController: retain author information of previous commit 2009-06-11 18:57:34 +01:00
Pieter de Bie e79c11b9a1 NSSTring_RegEx: Add support for regular expressions to NSString
This is an extension found via Cocoadev, created by John R Chang. Thanks!
2009-06-11 18:57:34 +01:00
Pieter de Bie aa43e18d61 PBGitRepository: Add support for changing the environment when executing commands 2009-06-11 18:57:34 +01:00
Pieter de Bie b382b34118 PBGitRepository: Specify environment when calling hooks 2009-06-11 18:56:24 +01:00
Pieter de Bie 57168e1ab0 PBEasyPipe: Add method that allows you to specify the environment stuff 2009-06-11 18:56:19 +01:00
Johannes Gilger 60908fd143 keyboardNavigation: Fix keys 'c' and 'v' from webView
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>
2009-06-11 13:06:09 +01:00
Pieter de Bie ce3d8ae34c Site: add link to Twitter 2009-06-11 13:05:44 +01:00
Pieter de Bie 78eeab4bef Merge branch 'stable'
* stable:
  HistoryView: Resize the detail webview
  Remove a .DS_Store
2009-06-10 18:28:53 +01:00
Pieter de Bie 6ccaf8ff8b HistoryView: Resize the detail webview
This view was one pixel too big, causing weird scrolling behaviour when
selecting text.

This fixes #128: Automatic scrolling when highlighting any text
2009-06-10 18:26:28 +01:00
Johannes Gilger ab870c66a8 keyboardNavigation: Fix keys 'c' and 'v' from webView
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>
2009-06-10 16:46:59 +02:00
Johannes Gilger 13746a5a6b 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>
2009-06-09 18:33:02 +02:00
Benjamin Kramer 70e5eaeb84 Remove a .DS_Store 2009-06-06 17:30:53 +01:00
Johannes Gilger 64b977e9c8 PBGitRepository: Add method to remove branch
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>
2009-06-06 17:23:51 +01:00
Johannes Gilger 7b6393570f PBWebChanges: Allow discarding of hunks
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>
2009-06-06 17:20:30 +01:00
Johannes Gilger 76f1469f52 PBGitCommitController: Fix unstaging of files
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>
2009-06-06 14:24:30 +01:00
Pieter de Bie a780ad9438 Add an example of how drag-selection for staging lines could work. 2009-05-28 23:26:05 +01:00
Pieter de Bie 85f2c72d69 Merge branch 'pu/pb/fix_refresh'
* 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
2009-05-28 17:41:33 +01:00
Pieter de Bie 0d8ba8c263 Rename 'CachedChanges" to "StagedChanges" for greater consistency 2009-05-28 17:40:17 +01:00
Pieter de Bie f9ff15cc6b PBChangedFile: remove shouldBeDeleted boolean
We don't need this anymore
2009-05-28 17:36:40 +01:00
Pieter de Bie a6b7c0c2a6 GitCommitController: Also use dictionary lookup for untracked files
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.
2009-05-28 17:36:24 +01:00
Pieter de Bie cf80a6aa09 CommitController: Use a dictionary lookup when refreshing index
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
2009-05-28 16:58:20 +01:00