Commit Graph

13 Commits

Author SHA1 Message Date
Johannes Gilger 3a1b10ae8f PBGitTree: Improve binary-file decision
This uses the same mechanisms as git to determine whether a file is
binary: By simply searching the first 8000 bytes for a 0-byte. This
gets rid of the call to "file" and is a much cleaner and shorter
implementation.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
2009-09-08 15:13:13 +02:00
Johannes Gilger 8243cf58b3 PBGitTree: Don't try to print binary-file contents
This patch prevents the plaintext display of files with binary content
in tree-view by connecting the content to the textContents attribute.

PBGitTree is extended with the method textContents, which returns the
textual representation of a PBGitTree-object. The methods first checks
the output of "git check-attr binary <file>" to see if the user
set/unset the binary attribute manually. Then it checks for common
binary file-extensions. If this method can't determine whether the file
is binary, the file-content is loaded and Unix "file" is run on the
first 100 bytes of the file to make a decision.

It also adds the -[PBGitTree fileSize] method to check the size
of the file before actually loading its contents.

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Edited-by: Pieter de Bie <pdebie@ai.rug.nl>
2009-09-07 14:38:44 +02: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
Michael Stephens b48469da93 Fix saving tree to folder 2009-03-23 23:01:51 +00:00
Pieter de Bie f94ab0f5fe Use NSISOLatin1 encoding instead of ASCII
We used to fall back on the ASCII encoding if UTF-8 did not work out. However,
this causes its own problems; ASCII is only valid for the lower 7 bytes. We
solve this by using Latin-1, which should have a valid character for every
byte sequence
2009-01-19 17:05:32 +00:00
Pieter de Bie d2eafc2d52 Include libgit2 as submodule and use it to store sha's
This reduces GitX's memory usage and makes some operations much faster,
like graphing, by having a cheaper comparison
2008-11-24 22:53:48 +01:00
Pieter de Bie 304a1a5d03 Remove stray debug messages 2008-11-01 21:14:57 +01:00
Ciarán Walsh 9b6974bf31 Prevent confusing filenames when quick-looking files.
Instead of creating a file with a random prefix, create a file with the same name in a temporary directory name. This way the quicklook window shows the correct filename.
2008-08-19 00:16:31 +02:00
Pieter de Bie e2b507313b Delete temporary files when they are deallocated
This will remove a lot of the stray files in the
temporary dir. However, they won't be deleted on exit
of the program. What to do about this?
2008-06-17 05:56:00 +02:00
Pieter de Bie 28e8bacb89 Add QuickLook support in tree view
This adds a QuickLook button that will allow you to directly view any file in
the tree view in QuickLook. This is really nice for PDF's and images. You can
select multiple files and even play a slideshow if you want.

Currently it does not remove temporary files it created. This means that they
will probably stay around until you reboot.
2008-06-17 02:29:27 +02:00
Pieter de Bie cc6ac22047 Allow double click to open file 2008-06-16 14:19:38 +02:00
Pieter de Bie 3106379334 Use unified interface and display tree contents 2008-06-15 23:10:05 +02:00
Pieter de Bie 9be3c50a75 Add a Tree displayer
This displays the tree of a specific commit in an NSBrowser.
2008-06-15 20:35:07 +02:00