Commit Graph

639 Commits

Author SHA1 Message Date
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
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
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 1c80701b14 GitRevList: Use std::map.find() rather than count() 2009-05-28 16:04:03 +01:00
Pieter de Bie d63f2b1124 GitRevList: cache the values of string encodings 2009-05-28 15:19:05 +01:00
Pieter de Bie 38198a9e27 Merge branch 'stable'
* stable:
  GitRevList -- Try to read the encoding of the commit message
  GitRevList: fix crash when loading 0 commits
  Tickets #151 and #155: check for illegal branch names before creating.
2009-05-28 15:12:16 +01:00
Pieter de Bie b7c46c16b8 GitRevList -- Try to read the encoding of the commit message
This tries to read the encoding of the commit message, if it's specified by
git (using i18n.commitEncoding at the time of committing). It uses an ugly
hack to try to convert the encoding string to an NSStringEncoding, and then
uses that for the subject and committer name.

I'm not sure how expensive this is. If it's too expensive, we might need to
cache this value.
2009-05-28 15:10:46 +01:00
Pieter de Bie 1626606579 GitRevList: fix crash when loading 0 commits
When there were no commits to load, 'git log' would output something like:

    Final output: 0 done

After that, GitX would try to read the sha after the input, which would
cause illegal string access and the throwing of a c++ exception. we fix
this by just stopping with revision loading if the input isn't at least
40 characters -- the minimum for a sha.
2009-05-28 14:12:43 +01:00
Johannes Gilger fe54a464f7 history.js: Fix display of mode-change and rename
Pieter rewrote history.js in cfbcfc1f38, avoiding the use of
.innerHTML for performance reasons. This broke the HTML-arrows when
dealing with renames / mode-changes because createTextNode quotes them.
This is a simple work-around.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-28 14:02:16 +01:00
Charles O'Rourke 353d1053b0 Tickets #151 and #155: check for illegal branch names before creating. 2009-05-28 13:46:12 +01:00
Charles O'Rourke 3b6c2a3048 Ticket #142: Add Show in Finder to Unstaged and Staged table views. 2009-05-28 13:42:35 +01:00
Pieter de Bie 4e4ffcc653 HistoryView: Autosave column information
This allows columns to save their information, such as
whether or not they are hidden.
2009-05-28 12:05:23 +01:00
Pieter de Bie 8273aecb98 Allow a user to select which columns to display 2009-05-28 12:05:23 +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
dbr 2d0bbecf55 When selecting a folder in tree-view, display the
path rather than the <PBGitTree: 0x...> object.

For example:

"This is a tree with path <PBGitTree: 0x1313000>"

..instead of:

"This is a tree with path Documentation/ReleaseNotes"
2009-05-27 18:11:02 +01:00
Johannes Gilger 5040bdc1c2 PBGitRepository: Correctly indicate bare/non-bare repos
This addresses an issue with non-bare repos which had no core.bare
variable in the config. The isBareRepository-function would work
on the full fileURL (pointing to the .git subdir), which in turn would
indicate a bare repo (this is what git rev-parse --is-bare-repository
returns in .git, and the opposite is true for the superdir).

We work around by using the working-dir for a repo (and directly
indicating a bare repo if there is no workdir). The only issue remaining
is the case of a bare repo manually set to "core.bare = false".

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-27 18:10:17 +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 a93740a3a7 Enable arguments to be passed to executeHook.
Some hooks, such as commit-msg and
prepare-commit-msg require at least one argument.
This allows executeHook to take an array of
arguments to be passed on to the hook.
2009-05-27 18:03:15 +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 b5dac080ff Release notes for 0.6.3 v0.6.3 2009-05-19 18:28:52 +01:00
Johannes Gilger 0d2fa4f5ea PBGitCommit: Call git show with --no-color to be safe
This fixes ticket #132, where setting color.ui = always in the gitconfig
caused GitX to received colorized output for "git show", thereby
destroying the diff-output.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-19 18:20:26 +01:00
Johannes Gilger 85e75255cd Info.plist: Fix handling of directories
Resulting from the last change to Info.plist in 3e21d041ef we were no
longer able to open directories called <foo>.<bar> wheren bar != git.
Using this code allows us to open all directories again and also to
drag-and-drop to the dock.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-19 18:20:26 +01:00
Johannes Gilger e9d45261bd PBGitRepository: Display branch-name in window title
This returns not only the name of the git-dir but also the current
branch (or detached HEAD if no local branch is checked out).

When reloading the refs (which also happens when checking-out using
GitX), the displayName-method is called, updating the window-title.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-18 23:18:59 +01:00
Johannes Gilger 6912add00e PBGitCommit: Call git show with --no-color to be safe
This fixes ticket #132, where setting color.ui = always in the gitconfig
caused GitX to received colorized output for "git show", thereby
destroying the diff-output.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-18 23:18:25 +01:00
Johannes Gilger 16244df346 Info.plist: Fix handling of directories
Resulting from the last change to Info.plist in 3e21d041ef we were no
longer able to open directories called <foo>.<bar> wheren bar != git.
Using this code allows us to open all directories again and also to
drag-and-drop to the dock.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-18 23:18:16 +01:00
Johannes Gilger 85df0f0675 GitX: Make toolbar in history and commit view equal height
This fixes ticket #123, it restricts the branch-selector in history-view
to a maximum-height of 25pixels, which is the height of the button to
select history/commit-mode.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-05-18 23:17:51 +01:00
Benjamin Kramer 4a4b551822 PBGitIndexController: fix uninitialized value
The encoding used to write a new .gitignore was based on an
uninitialized value. Fix this by using UTF-8 as the default.

Found by the clang static analyzer.
2009-05-18 23:14:11 +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
Pieter de Bie b896ac0d56 Allow executing of hooks 2009-05-18 23:05:08 +01:00
Mike Czepiel 7e74efba0d Added very basic tag info menu item and alert.
Simply renders the tag message when activated.
This would also make sense being available in
the web view somewhere.
2009-05-18 22:55:27 +01:00
Arjen Laarhoven c6fbcccc02 GitX.xcodeproj: Quote paths in custom shell scripts
Properly quote the TARGET_BUILD_DIR variable in the script to prevent
failure when the project path contains spaces.
2009-05-18 22:53:38 +01:00
Pieter de Bie cfbcfc1f38 HistoryView: speed up diff display
This speeds up the diff display by using DOM manipulation instead
of .innerHTML. Apparently incremental .innerHTML is really expensive
compared to DOM manipulation (which is expensive compared to a single .innerHTML=).

For example, the v0.2.1 commit, which introduces Sparkle, now loads in 70ms
rather than 230.
2009-05-14 17:05:40 +01:00
Pieter de Bie 7ef15f9154 Update diffHighlighter test 2009-05-14 17:05:40 +01:00
Benjamin Kramer 7bf3043cd4 Don't compile plain ObjC files as ObjC++
They contain no C++ so we don't need to use the C++ compiler for them.
This should speed up the build process a little.
2009-04-29 12:30:57 +01:00
Benjamin Kramer 988b105455 Fix compilation with GCC 4.2
Also compiles fine with LLVM-GCC.
2009-04-29 12:30:29 +01:00
Pieter de Bie aeb5c4d8e1 IndexController: Temporarily stop tracking when (un)staging
This uses the new way to stop tracking the index when
adding files. This can be noticed when staging more than
one file, as the tables might have to refresh dozens
of times.
2009-04-28 16:39:27 +01:00