Commit Graph

31 Commits

Author SHA1 Message Date
Matthias Sohn 485917598e Qualify post 0.10 builds
Change-Id: Ifcb8fdea95286779c8aea6bf4d7647e8c1c98d63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 15:49:30 +01:00
Matthias Sohn 51d1af9489 Qualify post 0.10.1 builds
Change-Id: I320f1f739f3689daf11d532a55ae1133785aec8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 15:23:14 +01:00
Matthias Sohn 1fdc17bfe4 JGit 0.10.1
Change-Id: I4a46d35d354193e5d4f28ef7dfae75944be8ffcf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-12-17 03:10:07 +01:00
Shawn O. Pearce 936820988f Define NoteMap, a simple note tree reader
The NoteMap makes it easy to read a small notes tree as created by
the `git notes` command in C Git.  To make the initial implementation
simple a notes tree is read recursively into a map in memory.
This is reasonable if the application will need to access all notes,
or if there are less than 256 notes in the tree, but doesn't behave
well when the number of notes exceeds 256 and the application
doesn't need to access all of them.

We can later add support for lazily loading different subpaths,
thus fixing the large note tree problem described above.

Currently the implementation only supports reading.  Writing notes
is more complex because trees need to be expanded or collapsed at
the exact 256 entry cut-off in order to retain the same tree SHA-1
that C Git would use for the same content.  It also needs to retain
non-note tree entries such as ".gitignore" or ".gitattribute" files
that might randomly appear within a notes tree.  We can also add
writing support later.

Change-Id: I93704bd84ebf650d51de34da3f1577ef0f7a9144
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-11-11 10:06:43 -06:00
Matthias Sohn f8eb7e16aa Generate correct version for jgit source bundle
The maven 2 build for jgit source bundle didn't create a correct
OSGi version string, instead of
    org.eclipse.jgit.source_0.10.0.<timestamp>
the generated OSGi version was
    org.eclipse.jgit.source_0.10.0.SNAPSHOT
This caused trouble when trying to install it from p2 repository.

Bug: 327616
Change-Id: Ic27c763ae9a4bcbb5bd6ed9562cd98bb4da3386b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-10-13 15:33:46 +02:00
Shawn O. Pearce 4b5d3d291b Qualify builds as 0.10.0
Change-Id: I54815c85b32b9492c059064b39f48677e68c5e90
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-09-16 17:26:53 -07:00
Matthias Sohn 26f507f0df Qualify post-0.9.3 builds
Change-Id: Ideab4923a5d8055f0e8a36ddcf0bc8adbf71c329
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-16 01:49:03 +02:00
Matthias Sohn 2920fcdde8 JGit 0.9.3
Change-Id: I114106f3286c36f7d5e136748a7e5130f4da163f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-16 01:02:53 +02:00
Matthias Sohn 7ae5e82d66 Qualify post-0.9.1 builds
Change-Id: I07a3391de03379f32ecfd055d45750e3860b2be4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-15 11:31:05 +02:00
Matthias Sohn 445a3a281d JGit 0.9.1
Change-Id: Ic411b1b8a7e6039ae3ff567e2c9cdd5db84f4d41
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-09-15 09:46:11 +02:00
Chris Aniszczyk 38327a54a8 Refactor Git API exceptions to a new package
Create a new 'org.eclipse.jgit.api.errors' package to contain
exceptions related to using the Git porcelain API.

Change-Id: Iac1781bd74fbd520dffac9d347616c3334994470
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
2010-09-01 15:27:43 -07: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
Charley Wang b878cdcf6b Add compatibility with gitignore specifications
This patch adds ignore compatibility to jgit. It encompasses
exclude files as well as .gitignore. Uses TreeWalk and
FileTreeIterator to find nodes and parses .gitignore
files when required. The patch includes a simple cache that
can be used to save results and avoid excessive gitignore
parsing.

CQ: 4302
Bug: 303925
Change-Id: Iebd7e5bb534accca4bf00d25bbc1f561d7cad11b
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2010-07-13 00:34:15 +02:00
Shawn O. Pearce ea21c111cb Move PackWriter over to storage.pack.PackWriter
Similar to what we did with the file code, move the pack writer
into its own package so the related classes and their package
private methods are hidden from the rest of the library.

Change-Id: Ic1b5c7c8c8d266e90c910d8d68dfc8e93586854f
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-26 18:51:12 -07: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 8a9844b2af Redo event listeners to be more generic
Replace the old crude event listener system with a much more generic
implementation, patterned after the event dispatch techniques used
in Google Web Toolkit 1.5 and later.

Each event delivers to an interface that defines a single method,
and the event itself is what performs the delivery in a type-safe
way through its own dispatch method.

Listeners are registered in a generic listener list, indexed by
the interface they implement and wish to receive an event for.
Delivery of events is performed by looping through all listeners
implementing the event's corresponding listener interface, and using
the event's own dispatch method to deliver the event.  This is the
classical "double dispatch" pattern for event delivery.

Listeners can be unregistered by invoking remove() on their
registration handle.  This change therefore requires application
code to track the handle if it wishes to remove the listener at a
later point in time.

Event delivery is now exposed as a generic public method on the
Repository class, making it easier for any type of message to
be sent out to any type of listener that has registered, without
needing to pre-arrange for type-safe fireFoo() methods.

New event types can be added in the future simply by defining a
new RepositoryEvent subclass and a corresponding RepositoryListener
interface that it dispatches to.  By always adding new events through
a new interface, we never need to worry about defining an Adapter
to provide default no-op implementations of new event methods.

Change-Id: I651417b3098b9afc93d91085e9f0b2265df8fc81
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-25 18:03:41 -07: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
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
Sasa Zivkov f3d8a8ecad Externalize strings from JGit
The strings are externalized into the root resource bundles.
The resource bundles are stored under the new "resources" source
folder to get proper maven build.

Strings from tests are, in general, not externalized. Only in
cases where it was necessary to make the test pass the strings
were externalized. This was typically necessary in cases where
e.getMessage() was used in assert and the exception message was
slightly changed due to reuse of the externalized strings.

Change-Id: Ic0f29c80b9a54fcec8320d8539a3e112852a1f7b
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2010-05-19 14:37:16 -07:00
Christian Halstrick f3fb5824ba Add builder-style API to jgit and Commit & Log cmd
Added a new package org.eclipse.jgit.api and a builder-style API for
jgit. Added also the first implementation for two git commands: Commit
and Log.

This API is intended to be used by external components when
functionalities of the standard git commands are required. It will also
help to ease writing JGit tests.

For internal usages this API may often not be optimal because the git
commands are doing much more than required or they expect parameters of
an unappropriate type.

Change-Id: I71ac4839ab9d2f848307eba9252090c586b4146b
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2010-05-10 15:17:55 +02:00
Robin Rosenberg fa4c3fe461 JGit plugin not compatible with Eclipse 3.4
The JSch bundle in Eclipse 3.4 does not export its packages with
version numbers. Use Require-Bundle on version 0.1.37 that comes
with Eclipse 3.4

There is no 0.1.37 in the maven repositories so the pom still refers
to 0.1.41 so the build can get the compile time dependencies right.

Bug: 308031
CQ: 3904 jsch Version: 0.1.37 (using Orbit CQ2014)

Change-Id: I12eba86bfbe584560c213882ebba58bf1f9fa0c1
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2010-04-05 12:25:06 +02: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
Sasa Zivkov 2ae9a85045 Provide NLS support in JGit.
The support for NLS relies on java.util API to load a standard
ResourceBundle and then uses java reflection API to inject localized
strings into public String fields of the corresponding instance
of TranslationBundle.

Locale setting is supported per thread to enable concurrent threads
to use different locales. This is useful when JGit runs in a server
context where (error) messages might need to differ per-request to
suit the user's preference.

Change-Id: Ie0e63a0d7bb74eaad495dbe8248595d8a3a76883
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
2010-03-11 15:19:34 +01: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
Robin Rosenberg 5eac1a4896 Partial revert "Switch build to Apache Felix maven-bundle-plugin"
This restores the ability to build using just Eclipse without
strange procedures, extra plugins and it is again possible to
work on both JGit and EGit in the same Eclipse workspace with
ease.

Change-Id: I0af08127d507fbce186f428f1cdeff280f0ddcda
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
2010-01-10 15:59:03 +01:00
Shawn O. Pearce fc5fc70e2e Switch build to Apache Felix maven-bundle-plugin
Tycho isn't production ready for projects like JGit to be using as
their primary build driver.  Some problems we ran into with Tycho
0.6.0 that are preventing us from using it are:

 * Tycho can't run offline

   The P2 artifact resolver cannot perform its work offline.  If the
   build system has no network connection, it cannot compile a
   project through Tycho.  This is insane for a distributed version
   control system where developers are used to being offline during
   development and local testing.

 * Magic state in ~/.m2/repository/.meta/p2-metadata.properties

   Earlier iterations of this patch tried to use a hybrid build,
   where Tycho was only used for the Eclipse specific feature and P2
   update site, and maven-bundle-plugin was used for the other code.
   This build seemed to work, but only due to magic Tycho specific
   state held in my local home directory.  This means builds are not
   consistently repeatable across systems, and lead me to believe
   I had a valid build, when in fact I did not.

 * Manifest-first build produces incomplete POMs

   The POM created by the manifest-first build format does not
   contain the dependency chain, leading a downstream consumer to
   not import the runtime dependencies necessary to execute the
   bundle it has imported.  In JGit's case, this means JSch isn't
   included in our dependency chain.

 * Manifest-first build produces POMs unreadable by Maven 2.x

   JGit has existing application consumers who are relying on
   Maven 2.x builds.  Forcing them to step up to an alpha release
   of Maven 3 is simply unacceptable.

 * OSGi bundle export data management is tedious

   Editing each of our pom.xml files to mark a new release is
   difficult enough as it is.  Editing every MANIFEST.MF file to
   list our exported packages and their current version number is
   something a machine should do, not a human.  Yet the Tycho OSGi
   way unfortunately demands that a human do this work.

 * OSGi bundle import data management is tedious

   There isn't a way in the MANIFEST.MF file format to reuse the
   same version tags across all of our imports, but we want to have
   a consistent view of our dependencies when we compile JGit.

After wasting more than 2 full days trying to get Tycho to work,
I've decided its a lost cause right now.  We need to be chasing down
bugs and critical features, not trying to bridge the gap between
the stable Maven repository format and the undocumented P2 format
used only by Eclipse.

So, switch the build to use Apache Felix's maven-bundle-plugin.

This is the same plugin Jetty uses to produce their OSGi bundle
manifests, and is the same plugin used by the Apache Felix project,
which is an open-source OSGi runtime.  It has a reasonable number
of folks using it for production builds, and is running on top of
the stable Maven 2.x code base.

With this switch we get automatically generated MANIFEST.MF files
based on reasonably sane default rules, which reduces the amount
of things we have to maintain by hand.  When necessary, we can add
a few lines of XML to our POMs to tweak the output.

Our build artifacts are still fully compatible with Maven 2.x, so
any downstream consumers are still able to use our build products,
without stepping up to Maven 3.x.  Our artifacts are also valid as
OSGi bundles, provided they are organized on disk into a repository
that the runtime can read.

With maven-bundle-plugin the build runs offline, as much as Maven
2.x is able to run offline anyway, so we're able to return to a
distributed development environment again.

By generating MANIFEST.MF at the top level of each project (and
therefore outside of the target directory), we're still compatible
with Eclipse's PDE tooling.  Our projects can be imported as standard
Maven projects using the m2eclipse plugin, but the PDE will think
they are vaild plugins and make them available for plugin builds,
or while debugging another workbench.

This change also completely removes Tycho from the build.

Unfortunately, Tycho 0.6.0's pom-first dependency resolver is broken
when resolving a pom-first plugin bundle through a manifest-first
feature package, so bundle org.eclipse.jgit can't be resolved,
even though it might actually exist in the local Maven repository.

Rather than fight with Tycho any further, I'm just declaring it
plugina-non-grata and ripping it out of the build.

Since there are very few tools to build a P2 format repository, and
no documentation on how to create one without running the Eclipse
UI manually by poking buttons, I'm declaring that we are not going
to produce a P2 update site from our automated builds.

Change-Id: If7938a86fb0cc8e25099028d832dbd38110b9124
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-12-28 15:59:14 -08:00
Mykola Nikishov cf2edb6518 Move AWT UI code to new org.eclipse.jgit.ui bundle
This new UI bundle contains the org.eclipse.jgit.awtui package,
which was moved out of the org.eclipse.jgit bundle.

org.eclipse.jgit.pgm depends on org.eclipse.jgit.ui, so we need
to update the classpath and make_jgit.sh to include it.

This move takes the awtui classes out of the Maven build, which
means we are no longer able to distribute these classes to our
downstream Maven customers.  The entire Maven package structure
needs to be overhauled so that Eclipse bundle matches 1:1 with the
Maven artifact.

Bug: https://bugs.eclipse.org/291124
Change-Id: Ibf1a9968387e3d11fdce54592f710ec4cc7f1ddb
Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-31 16:35:10 -07:00
Shawn O. Pearce 9b48eb940a Mark JGit plugin as 0.6
Our project plan calls for us to build 0.6 as the next version,
but I forgot to also update the MANIFEST.MF for the plugin when
I edited the Maven pom.

Change-Id: Ic1a6c64374a4384a65a3dd0306adddfc73adac52
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-05 14:17:16 -07:00
Chris Aniszczyk 4cfc7baf9e Cleanup MANIFEST.MF in JGit
- We shouldn't be re-exporting bundles, JSch in this case.
  Instead used a Import-Package clause.

- Some packages weren't exported.  In Eclipse we have a policy to
  export all the packages in a bundle

- Exporting version numbers on the export packages.

Bug: 291108
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-10-01 14:12:50 -07:00
Git Development Community 1a6964c827 Initial JGit contribution to eclipse.org
Per CQ 3448 this is the initial contribution of the JGit project
to eclipse.org.  It is derived from the historical JGit repository
at commit 3a2dd9921c8a08740a9e02c421469e5b1a9e47cb.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-09-29 16:47:03 -07:00