Commit Graph

142 Commits

Author SHA1 Message Date
Pieter de Bie 1854fc0bd0 Merge branch 'pu/pb/index_refactor'
* pu/pb/index_refactor: (24 commits)
  PBGitIndex: post notifications when index stuff fails
  GitIndexController: reorder methods a bit, remove unnecessary stuff
  PBGitIndex: Migrate discardChanges to the GitIndex
  CommitController: Make commit message editable after commit failed
  GitIndex: Fix a few comments
  GitIndex: explicitly tell when stuff is updated
  Remove cruft
  Show previous commit message when amending
  CommitController: Empty commit title when commit is successful
  CommitView: Remove cruft
  Add failed commit notifications
  GitIndex: add commit notifications
  CommitController: Add status messages for index operations
  GitIndex: Add a few notifications
  CommitView: Migrate patch apply stuff to GitIndex
  GitIndex: Add support for applying patches
  CommitController: Replace commit method with the one from GitIndex
  GitIndex: add basic commit method
  GitIndexController: Migrate stageFiles functions to GitIndex
  GitIndex: Add methods to stage and unstage files
  ...

Conflicts:
	PBGitCommitController.m
	PBGitIndexController.h
	PBGitIndexController.m
2009-09-17 23:47:43 +02:00
Pieter de Bie 5972bd4f7f HistoryView: Don't show the 'loading commit' thing until after 500 ms.
This was annoying me a lot, so it's in stable :)

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
2009-09-17 23:40:38 +02:00
Pieter de Bie 0363eea494 HistoryView: don't load in commit information in a separate thread anymore
I've seen this hang or crash a few times, so I hope this works better.
Instead of running a task in a separate thread, we just let it go through
the run loop and catch it when the task is done.

This ruins the second subview in the history view, but I don't think
anybody ever used that, so I'm going to remove it.
2009-09-17 23:29:06 +02:00
Pieter de Bie 64a52ad9e0 CommitView: Migrate diff displaying away from IndexController 2009-09-13 16:55:38 +02:00
Johannes Gilger 4544816ac8 GitX.css: Set a default-font for body
Some people have had Serif-fonts in their interface where no specific
fonts for classes/ids were specified. This sets the default-font to
'Lucida Grande' in order to have a nice non-serif on any system.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-09-09 23:03:03 +02:00
Pieter de Bie 53ca665271 Delete this test file.
I don't think we need it anymore. Otherwise, we can alway
get it back.
2009-09-08 15:53:43 +02:00
Johannes Gilger d3cb020598 commit.js: Fix discardHunk functionality
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>
2009-09-03 10:13:44 +02:00
Pieter de Bie 85fcee1710 DiffHighlighter: Remove weird end line
This was added in 1688c2a (diffHighlighter.js: Record the line index as attribute.),
I guess by accident
2009-08-28 00:34:30 +02:00
JD Smith ab47c14d6e commit.js: Interface for selecting lines to (un-)stage. 2009-07-08 17:22:09 -04:00
JD Smith 62333bf51b commit.js: Refactor hunk retrieval.
To work with subhunks, allow passing a header line explicitly to search for.
2009-06-21 02:36:02 +01:00
JD Smith 1688c2a359 diffHighlighter.js: Record the line index as attribute. 2009-06-21 02:35:58 +01:00
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 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 a002e3316c WebHistoryView: Also use the tree context menu 2009-06-16 19:41:57 +01: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
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
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
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 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
Pieter de Bie a780ad9438 Add an example of how drag-selection for staging lines could work. 2009-05-28 23:26:05 +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
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
Pieter de Bie b022d81b45 Merge branch 'stable'
* stable:
  Make confirmation of Gists optional
  Add more defaults for handling Gists
  HistoryView: Confirm paste to Gist if github.user is unset
  GitX: CFBuildVersion as x.x.x.xx
  UserManual: Explain the concept of the Amend-button
2009-03-26 23:04:51 +00:00
Pieter de Bie 11c9f51302 Make confirmation of Gists optional
This makes use of the rules that are explicit in the
preferences. By default, Gists are always private and there
will always be a confirmation message.

Both options can be changed from the preferences menu.
2009-03-26 23:03:48 +00:00
Johannes Gilger de31ea193a HistoryView: Confirm paste to Gist if github.user is unset
This patch relates to ticket #58. It adds a method which will ask for
confirmation when pasting to Gist as an anonymous user. Since users
which have github.user and github.token set can easily delete pasted
snippets no confirmation is needed for them.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-03-26 23:03:48 +00:00
Benjamin Kramer df545314f5 HistoryView: Make table header large enough so the text doesn't shift
"Committer" was too big. Use EMs so font size changes won't bother us.
2009-03-25 20:53:36 +01:00
Benjamin Kramer a762ae5219 HistoryView: Show commit date 2009-03-25 20:53:35 +01:00
Benjamin Kramer 89128794c9 HistoryView: Show committer if his name differs from the author's 2009-03-25 20:53:10 +01:00
Benjamin Kramer 5ff9620ec2 HistoryView: Factor out email formatting
The patches to show the committer's name depend on this.
2009-03-25 20:52:42 +01:00
Pieter de Bie 06d6da1fc5 Merge commit '3e21d041efb95b6358c749e021bf5ddbcc05bcd7'
* commit '3e21d041efb95b6358c749e021bf5ddbcc05bcd7':
  Info.plist: Make GitX open any file/folder on drop
  diffHighlighter: Correctly match unified diff hunks
  diffHighlighter: Fix indent-after-stagebutton bug
2009-03-24 00:48:17 +00:00
Pieter de Bie 8616b38eb3 WebHistoryView: Correctly show refs when reloading
We assigned a function instead of the result of that function,
which broke the refreshing
2009-03-23 23:08:27 +00:00
Johannes Gilger 51478449ec diffHighlighter: Correctly match unified diff hunks
Hunks in unified diffs are usually in the form of @@ -a,b +x,y @@, but
sometimes the ,b (i.e. the range) can be ommitted, in which case our
code didn't match the hunk-header at all, resulting in line-numbers
off-by-one in commit-view.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-02-21 23:02:14 +01:00
Johannes Gilger 58990fc318 diffHighlighter: Fix indent-after-stagebutton bug
- display context lines in own <div>.
- Stagebutton no longer is float: left.

This fixes ticket #104

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-02-21 22:33:28 +01:00
Johannes Gilger 308a5af02f diffHighlighter: Empty diffs and mode-changes
When there is no diff to display (i.e. empty-file mode-changes, deletion
or creation) we don't draw a diff-box (div) but just list the filename.

Also fixes a bug with mode-changes not displaying new-mode.
2009-02-07 16:31:03 +01:00
Johannes Gilger f23b3c498f diffHighlighter: Display removed, but empty, plain-text files 2009-02-07 15:04:41 +01:00
Johannes Gilger 20b5fa6214 diffHighlighter: Display created, but empty, plain-text files
Plain-text files which have been created are not diffed against
/dev/null, but have a "new file mode" line. This patch catches this case
and also highlights that the control-flow in diffHighlighter is less
than optimal.
2009-02-07 13:47:06 +01:00
Douglas Creager e5104b4069 Use <pre> tag for commit message so that whitespace displays correctly
The contents of the commit message is inserted into the “#message” tag
directly.  If we use a <div> tag, then any whitespace in the commit
message will get collapsed down into a single space as HTML requires.
Since the CSS stylesheet calls for a monospaced font, it makes sense
to use a <pre> tag instead, so that whitespace will be preserved.
2009-02-06 21:09:03 +01:00
Johannes Gilger 8bed6191f5 diffHighlighter.js: Bail out early for deleted binary/image files
If we have an image (png,jpg,...) which was deleted we cant display a
diff or the file itself anymore. In this case the entry in the file-list
is enough.
2009-02-06 21:09:01 +01:00
Johannes Gilger 7cb4930389 diffHighlighter: Fix display for deletion of binary files
When a binary file is deleted the second filename doesn't start with b/
but is "/dev/null". We didn't account for that.
2009-02-06 21:08:01 +01:00
Johannes Gilger ef8317bcb0 Allow email-addresses without the @-sign
These addresses are perfectly valid in a local scope, and GitX shouldn't
fail anyway.
2009-02-06 21:08:01 +01:00
Johannes Gilger bb8a615b22 Recognize file-mode changes correctly and display them
diffHighligher.js: Recognize file-mode changes and mark them
history.js: Extend newfile callback by parameters for mode
history.css: Adjust changed-span to accomodate "mode changed"
2009-02-06 21:07:57 +01:00
Pieter de Bie ab2ddd87cc CommitView: Show linebreaks with new files
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
2009-01-28 20:21:06 +00:00
Pieter de Bie b65170189a Merge branch 'pu/jg/rename_detection' (early part)
* 'pu/jg/rename_detection' (early part):
  Diff: also show a binary when it's deleted
  DiffHighlighter: Properly show binary changes
  HistoryView: Prettify the file list
  Show renames changes by default
  history.css, history.js: Color changed/deleted/added/moved appendices
  Rudimentary support for renames/deletions of files
2009-01-26 21:30:58 +00:00
Pieter de Bie 1dc649bf09 Diff: also show a binary when it's deleted 2009-01-26 21:18:29 +00:00
Pieter de Bie c6895105e2 Remove old code in Commit/Diff views
We used to put diffs inside a <pre><code> block,
but no longer need to do that as we now use tables anyway.
We changed the code for the History view, but not for the
other two views.
2009-01-25 22:06:56 +00:00
Pieter de Bie b44b0df75a DiffHighlighter: Properly show binary changes
Binary changes don't have a +++ / --- line, just like
a 100% rename doesn't show any changes. We work around
this in much the same way -- by reading the filenames
for that specific case.
2009-01-25 21:45:28 +00:00
Kim Does cf14746bda HistoryView: Prettify the file list 2009-01-25 21:00:25 +00:00