Commit Graph

26 Commits

Author SHA1 Message Date
Robin Rosenberg 236899204a Revert "Hide Maven target directories from Eclipse"
This reverts commit db4c516f67 since
it breaks compatibility with Eclipse 3.5 which can no longer import
the projects

Bug: 323390
Change-Id: I3cc91364a6747cfcb4c611a9be5258f81562f726
2010-08-28 09:50:50 +02:00
Chris Aniszczyk d1edd00f56 Run formatter on edited lines via save action
Updates the project level settings to run the formatter
on save on only on the edited lines.

Change-Id: I26dd69d0c95e6d73f9fdf7031f3c1dbf3becbb79
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-08-26 12:33:09 -05:00
Robin Rosenberg db4c516f67 Hide Maven target directories from Eclipse
Change-Id: I64f12a35423a90ced9c9bc83f6869d8ed766dd35
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2010-08-08 13:16:53 +02:00
Shawn O. Pearce fa9b225e06 Merge branch 'delta'
* delta: (103 commits)
  Discard the uncompressed delta as soon as its compressed
  Honor pack.windowlimit to cap memory usage during packing
  Honor pack.threads and perform delta search in parallel
  Cache small deltas during packing
  Implement delta generation during packing
  debug-show-packdelta:  Dump a pack delta to the console
  Initial pack format delta generator
  Add debugging toString() method to ObjectToPack
  Make ObjectToPack clearReuseAsIs signal available to subclasses
  Correctly classify the compressing objects phase
  Refactor ObjectToPack's delta depth setting
  Configure core.bigFileThreshold into PackWriter
  Add doNotDelta flag to ObjectToPack
  Add more configuration options to PackWriter
  Save object path hash codes during packing
  Add path hash code to ObjectWalk
  Add getObjectSize to ObjectReader
  Allow TemporaryBuffer.Heap to allocate smaller than 8 KiB
  Define a constant for 127 in DeltaEncoder
  Cap delta copy instructions at 64k
  ...

Conflicts:
	org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
	org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties
	org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
	org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteTreeFilter.java

Change-Id: I7c7a05e443a48d32c836173a409ee7d340c70796
2010-07-22 14:56:34 -07:00
Jonathan Gossage ec13e0382a Fully implement Logger interface
On April 27, 2010 the Logger interface was upgraded with a number of new methods
to make it consistent with the implementations it was meant to support.

This patch makes RecordingLogger consistent with the Logger interface and allows to
also use Jetty 7.1.5 released with Helios which can be installed from the p2 repository
at http://download.eclipse.org/jetty/7.1.5.v20100705/repository

Change-Id: I5645436bbe7492f82d4069e4d9cbebede0bf764e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-07-17 01:53:23 +02:00
Shawn O. Pearce ad5238dc67 Move FileRepository to storage.file.FileRepository
This move isolates all of the local file specific implementation code
into a single package, where their package-private methods and support
classes are properly hidden away from the rest of the core library.

Because of the sheer number of files impacted, I have limited this
change to only the renames and the updated imports.

Change-Id: Icca4884e1a418f83f8b617d0c4c78b73d8a4bd17
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-26 18:50:34 -07:00
Shawn O. Pearce 89d4a7377f Use FileRepository where we assume other file semantics
When the surrounding code is already heavily based upon the
assumption that we have a FileRepository (e.g. because it
created that type of repository) keep the type around and
use it directly.  This permits us to continue to do things
like save the configuration file.

Change-Id: Ib783f0f6a11acd6aa305c16d61ccc368b46beecc
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-25 17:46:40 -07:00
Shawn O. Pearce 6a822f0ebf Remove RepositoryConfig and use FileBasedConfig instead
Change the Repository API to use straight-up FileBasedConfig.
This lets us remove the subclass RepositoryConfig and stop having
a specialized configuration type for repository, letting us instead
focus the config type heirarchy on type-of-storage rather than use.

Change-Id: I7236800e8090624453a89cb0c7a9a632702691c6
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-25 17:46:40 -07:00
Matthias Sohn 767fb175ed Fix line endings
Some sources had dos line endings. Also configure all projects to use
unix line endings and UTF-8 text encoding.

Change-Id: I8fc9a1dbb219ffa91d1b3011b3b11b7e48e74ca7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-06-18 23:36:18 +02:00
Shawn Pearce 86fcdc53ad Merge changes I53f71dc0,I3a899a3a,I3e8bd245,Ie7c9db83,If396326e,I6f4cf8da,I3bf96dd0,I3a2a43a1,I292fe88c,Ia1cf40cf
* changes:
  git-servlet: Fix comparing uploadFactory with the wrong DISABLED instance
  Prefer static inner classes
  Override equals for SwingLane since super class PlotLane defines it
  Make sure a Stream is closed upon errors in IpLogGenerator
  Make constant static in RebuildCommitGraph
  Make inner classes static in http code
  Cache filemode in GitIndex 
  Remove unused parent field in PlotLane
  Removed unused repo field in WorkDirCheckout
  Extend DiffFormatter API to simplify styling
2010-06-14 19:59:48 -04:00
Shawn O. Pearce 239ce58553 Start 0.9 development
Change-Id: I84173ece5100f1fcb78168e2e102b649d9466c08
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-14 08:11:27 -07:00
Robin Rosenberg 6f4cf8daec Make inner classes static in http code
Static classes are preferrable to keep unwanted dependencies away, 
and they have one less member field.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2010-06-13 03:19:47 +02:00
Shawn O. Pearce d8ec8527a6 Qualify post-0.8.1 builds
Change-Id: Id86e5876b2f684b2a272c07061a276b054ba410d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-02 15:55:39 -07:00
Shawn O. Pearce be86767d71 JGit 0.8.1
Change-Id: I3d4ac7d0617a3575019e2ed748ed2a298a988340
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-02 14:47:31 -07:00
Shawn O. Pearce 14e469c44e Qualify builds as 0.8.0
Since the API is changing relative to 0.7.0, we'll call our next
release 0.8.1.  But until that gets released, builds from master
will be 0.8.0.qualifier.

Change-Id: I921e984f51ce498610c09e0db21be72a533fee88
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-20 19:06:58 -07:00
Shawn O. Pearce c0f093899f http.server: Use TemporaryBuffer and compress some responses
The HTTP server side code now uses the same approach that the smart
HTTP client code uses when preparing a request body.  The payload
is streamed into a TemporaryBuffer of limited size.  If the entire
data fits, its compressed with gzip if the user agent supports that,
and a Content-Length header is used to transmit the fixed length
body to the peer.  If however the data overflows the limited memory
segment, its streamed uncompressed to the peer.

One might initially think that larger contents which overflow
the buffer should also be compressed, rather than sent raw, since
they were deemed "large".  But usually these larger contents are
actually a pack file which has been already heavily compressed by
Git specific routines.  Trying to deflate that with gzip is probably
going to take up more space, not less, so the compression overhead
isn't worthwhile.

This buffer and compress optimization helps repositories with a
large number of references, as their text based advertisements
compress well. For example jgit's own native repository currently
requires 32,628 bytes for its full advertisement of 489 references.
Most repositories have fewer references, and thus could compress
their entire response in one buffer.

Change-Id: I790609c9f763339e0a1db9172aa570e29af96f42
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-12 16:08:14 -08:00
Shawn O. Pearce d8c3e98d73 Use "ERR message" for early ReceivePack problems
If the application wants to, it can use sendError(String) to send one
or more error messages to clients before the advertisements are sent.
These will cause a C Git client to break out of the advertisement
parsing loop, display "remote error: message\n", and terminate.

Servers can optionally use this to send a detailed error to a client
explaining why it cannot use the ReceivePack service on a repository.
Over smart HTTP these errors are sent in a 200 OK response, and
are in the payload, allowing the Git client to give the end-user
the custom message rather than the generic error "403 Forbidden".

Change-Id: I03f4345183765d21002118617174c77f71427b5a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-12 16:08:14 -08:00
Shawn O. Pearce 673b3984bd Capture non-progress side band #2 messages and put in result
Any messages received on side band #2 that aren't scraped as a
progress message into our ProgressMonitor are now forwarded to a
buffer which is later included into the OperationResult object.
Application callers can use this buffer to present the additional
messages from the remote peer after the push or fetch operation
has concluded.

The smart push connections using the native send-pack/receive-pack
protocol now request side-band-64k capability if it is available
and forward any messages received through that channel onto this
message buffer.  This makes hook messages available over smart HTTP,
or even over SSH.

The SSH transport was modified to redirect the remote command's
stderr stream into the message buffer, interleaved with any data
received over side band #2.  Due to buffering between these two
different channels in the SSH channel mux itself the order of any
writes between the two cannot be ensured, but it tries to stay close.

The local fork transport was also modified to redirect the local
receive-pack's stderr into the message buffer, rather than going to
the invoking JVM's System.err.  This gives applications a chance
to log the local error messages, rather than needing to redirect
their JVM's stderr before startup.

To keep things simple, the application has to wait for the entire
operation to complete before it can see the messages.  This may
be a downside if the user is trying to debug a remote hook that is
blocking indefinitely, the user would need to abort the connection
before they can inspect the message buffer in any sort of UI built
on top of JGit.

Change-Id: Ibc215f4569e63071da5b7e5c6674ce924ae39e11
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-03-12 16:08:13 -08:00
Shawn O. Pearce 3dd067042f http.test: Use JUnit 3 test runner
JGit relies on JUnit 3, not JUnit 4.

Change-Id: Ic5a0ae1564d7744c203321857fc603e7008dbf13
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-02-09 19:51:36 -08:00
Shawn O. Pearce 1ca22467f5 http.test: Add missing plugin.properties to build
Change-Id: I17e2c22498092d25dace88319698626ce55df822
2010-02-09 19:28:28 -08:00
Shawn O. Pearce d207c69ff4 http.test: Use JGit Format and compiler settings
Somehow we missed setting this up for the project.

Change-Id: Id55a6415f5fd03a7cd9d4d4ecbdd726cef79430d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-02-09 19:28:28 -08:00
Shawn O. Pearce 179a9ba4a2 Cleanup OSGi Import-Package specifications to use versions
Actually set the range of versions we are willing to accept for
each package we import, lest we import something in the future
that isn't compatible with our needs.

Change-Id: I25dbbb9eaabe852631b677e0c608792b3ed97532
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-02-02 20:03:03 -08:00
Shawn O. Pearce f2d5187ea1 Fix racy HTTP tests by waiting for requests to finish
Ensure the background Jetty threads have been able to write the
request log record before the JUnit thread tries to read the set
of requests back.  This wait is necessary because the JUnit thread
may be able to continue as soon as Jetty has finished writing
the response onto the socket, and hasn't necessarily finished the
post-response logging activity.

By using a semaphore with a fixed number of resources, and using
one resource per request, but all of them when we want to read the
log, we implement a simple lock that requires there be no active
requests when we want to get the log from the JUnit thread.

Change-Id: I499e1c96418557185d0e19ba8befe892f26ce7e4
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-25 14:51:56 -08:00
Shawn O. Pearce 0238a21b62 Correct bundle, provider names to be consistent
Technically our project name is "JGit", not "Java Git".  In fact
there is already another project called "JavaGit" (no space) that we
don't want to become confused with.  Ensure we always call ourselves
"JGit" in user visible assets, like the bundle name.

Other Eclipse products list their provider as "Eclipse.org",
not "eclipse.org".  So list ourselves that way in all of our
plugin.properties files.

Change-Id: Ibcea1cd6dda2af757a8584099619fc23b7779a84
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 11:42:15 -08:00
Robin Rosenberg 56f6d9ebc3 Make HTTP test project work in Eclipse
The Jetty components are not available as part of Eclipse, but a
P2 packaged version can be found via [1] for Eclipse 3.5 and newer.

[1] http://wiki.eclipse.org/Jetty-OSGi_SDK

Change-Id: Ibd5930bb9fc9589125876ca50c52e58bd31b051c
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23 11:29:25 -08:00
Shawn O. Pearce f5eb0d9366 Add JUnit tests for HTTP transport
No Eclipse support for this project is provided, because the
Jetty project does not publish a complete P2 repository.

Change-Id: Ic5fe2e79bb216e36920fd4a70ec15dd6ccfd1468
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-12 12:30:42 -08:00