95 Commits

Author SHA1 Message Date
Romain Muller 3ada98c765 Use of stringWithFormat in this situation is overkill. 2011-05-19 18:09:01 +02:00
German Laullon f6e69682d1 better hide/show splitviews 2011-04-22 15:48:19 -07:00
apla 6d95d179ab reload commit history after commit 2011-03-30 00:56:35 +04:00
Nathan Kinsinger c545832108 Fix the Stage view's horizontal split view
It will now remember it's position and the divider will keep its position relative to the bottom when the window resizes.
2010-11-17 19:53:22 -07:00
Sebastian Staudt 21d1f3989f Added a dialog for failing commit hooks
This enables the user to force a commit (i.e. --no-verify) when either pre-commit or
commit-msg hook fails.
2010-09-13 20:25:42 +02:00
Nathan Kinsinger 53d92fb73e Cleanup the views when the repository window closes and stop memory leaks.
- make sure to remove themselves from KV and notification center observers
    - add the PBWebHistoryController to PBHistoryController so it can be told to close
    - replaced the -removeView methods with -closeView (-removeView was not being used)
    - clear any obj-c objects set in web scripting objects

This last item seems to be the reason that the web controllers and the current commit did not get collected which then held the repository document from being collected as well.
2010-07-04 09:46:22 -06:00
Nathan Kinsinger e4f6f960c7 Remove call to finalize 2010-07-04 09:45:22 -06:00
Nathan Kinsinger 1b41171d92 Add a bottom content border/toolbar to the repository window
- 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
2010-03-13 22:15:13 -07:00
Nathan Kinsinger 03dc7819b4 Disable Commit button when there are no staged files. 2010-02-19 22:54:55 -07:00
Pieter de Bie a2b3bf3d1e PBGitIndex: post notifications when index stuff fails
We use notifications so that we can make all these methods async later on
2009-09-13 16:55:40 +02:00
Pieter de Bie e17b454c39 CommitController: Make commit message editable after commit failed 2009-09-13 16:55:40 +02:00
Pieter de Bie 029b42c540 GitIndex: explicitly tell when stuff is updated 2009-09-13 16:55:40 +02:00
Pieter de Bie 9b1fcd7628 Remove cruft 2009-09-13 16:55:40 +02:00
Pieter de Bie 249233114d Show previous commit message when amending 2009-09-13 16:55:40 +02:00
Pieter de Bie 2b317eee5c CommitController: Empty commit title when commit is successful 2009-09-13 16:55:39 +02:00
Pieter de Bie 5323b91596 Add failed commit notifications 2009-09-13 16:55:39 +02:00
Pieter de Bie 4192d6a03f GitIndex: add commit notifications 2009-09-13 16:55:39 +02:00
Pieter de Bie c6d2b61020 CommitController: Add status messages for index operations 2009-09-13 16:55:39 +02:00
Pieter de Bie cdae809f41 CommitView: Migrate patch apply stuff to GitIndex 2009-09-13 16:55:39 +02:00
Pieter de Bie 87dfb47f4f CommitController: Replace commit method with the one from GitIndex 2009-09-13 16:55:39 +02:00
Pieter de Bie 03e1d3e882 WIP: Add GUI support for the new index 2009-09-13 16:55:38 +02:00
Johannes Gilger 0823ff859d Keep window-title up-to-date in commit view
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>
2009-08-31 12:17:17 +02:00
Pieter de Bie f9f6809c40 Also set blobMode / blobSha for unstaged changes.
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
2009-08-28 00:31:23 +02:00
Pieter de Bie 04db47d8e6 Merge commit 'origin/master'
* 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
2009-07-07 12:02:27 +01:00
Nicholas Riley f2a37df9f5 Set keyboard focus reasonably when switching between views.
When you switch to the commit view, the commit message gets focus;
when you switch to the history view, the commit list gets focus.
2009-07-07 11:56:40 +01:00
Nicholas Riley f25aad8ee2 Don't disturb editing state when inserting "Signed-off-by" line. 2009-07-07 11:56:40 +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 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 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
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
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
Pieter de Bie a14495052a PBGitCommitController: retain author information of previous commit 2009-06-11 18:57:34 +01: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
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 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 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
Pieter de Bie 33991ec190 GitCommitController: clean up index functions
This adds some comments in the right place and makes the code
somewhat easier to follow.
2009-05-28 16:28:52 +01:00
Pieter de Bie 785e7eda42 Merge branch 'stable'
* 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
2009-05-27 18:25:14 +01:00
Benjamin Kramer c12e8b9dd4 Get rid of some unnecessary casts 2009-05-27 18:09:29 +01:00
Joe Fiorini 40ba75045d Trigger commit-msg hook when committing
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.
2009-05-27 18:03:18 +01:00
Joe Fiorini 897c80f8a7 Write commit message to file
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.
2009-05-27 18:03:09 +01:00
Pieter de Bie df4a50aebe CommitController: Don't rewrap commit message when amending
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.
2009-05-27 17:51:23 +01:00
Pieter de Bie 7caf7d799a Merge branch 'stable'
* 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
2009-05-18 23:11:11 +01:00
Benjamin Kramer 6dcefe5bec Fix many gcc 4.2 compiler warnings 2009-05-18 23:08:51 +01:00
Pieter de Bie 4dfcc4d45d Trigger pre and post-commit hooks when committing
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
2009-05-18 23:06:50 +01:00