Commit Graph

2259 Commits

Author SHA1 Message Date
Matthias Sohn 9000351909 Prepare 2.1.0 builds
Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:45:13 +02:00
Matthias Sohn 221554e35f Merge branch 'stable-2.0'
* stable-2.0:
  Prepare post v2.0.0.201206130900-r builds
  JGit v2.0.0.201206130900-r
  Add org.eclipse.jgit.pgm.feature to enable consumption via p2
  Do not set core.autocrlf when creating repo

Change-Id: Ifdd71a6bc14d9c79f4433ebc3b53bf0042a4d4c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:20:48 +02:00
Matthias Sohn 2f27d5ae12 Prepare post v2.0.0.201206130900-r builds
Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:19:30 +02:00
Tomasz Zarna 55f42a8c1d Fix GitDateFormatter javadoc.
Change-Id: I627bdc387754a626ed8b1839494c05dfd5950d11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-14 00:06:30 +02:00
Matthias Sohn aacd4f721b JGit v2.0.0.201206130900-r
Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-13 15:03:59 +02:00
Matthias Sohn 4974090d33 Add org.eclipse.jgit.pgm.feature to enable consumption via p2
Orion wants to consume the pgm bundle from a p2 repository in their
build. Also add corresponding source bundle and feature to provision
sources via a target platform.

Bug: 373789
Change-Id: I0016ee155553c546606b63d310666eb10bd997e1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-12 18:10:04 +02:00
Robin Rosenberg 2853c61f12 Do not set core.autocrlf when creating repo
core.autorlf defaults to false, but can be set in the user or 
"system" config files. Note that EGit/JGit may not know
where the "system" config file is located.

Also fix pgm's ConfigTest which depends on default repository
configuration.

Bug: 382067
Change-Id: I2c698a76e30d968e7f351b4f5a2195f0b124f62f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-12 13:56:42 +02:00
Markus Duft f5b58d21a4 Add missing license header to modification times test.
This adds the header i forgot to add in
I18047f5725f22811bb4194ca1d3a3cac56074183.

Change-Id: I9160b0632c65da9e30a88688c4d9216b5f93d818
2012-06-11 07:13:58 +02:00
Shawn Pearce 20840f57e9 Merge changes I1c87fea9,I7bd5011f,Ie800c557
* changes:
  Add MetaFilter.serveRegex(Pattern)
  Expand RegexPipeline documentation
  Add simple tests for RegexPipeline
2012-06-08 16:02:35 -04:00
Dave Borowitz b12f80e71c Add MetaFilter.serveRegex(Pattern)
This allows the use of precompiled patterns, such as those compiled with
flags.

Change-Id: I1c87fea98e246004aecbae3aabaf1d21fbf3176e
2012-06-08 12:16:31 -07:00
Dave Borowitz 61c4e39067 Expand RegexPipeline documentation
Include some behaviors that were not clear to me until I had used it a
few times.

Warn about broken behavior for capture groups that do not match. It
would be nice to support these, but even for the cases where it's
clear what the behavior should be, it would be infeasible to
implement.

For example, consider the second group of the regex "(/a)/b(/c)?"
matched against the path "/a/b". We might want getServletPath() to
return "/a/b" and getPathInfo() to return null, but this is hard to
implement: there's no easy way to say "the substring up to the point
where (/c) would have matched if it were in the string even though
it's not." And even if we could, it's not clear there is even a right
answer in the general case.

Moreover, ideally we could warn about such broken patterns at servlet
initialization time, rather than at runtime, but even answering the
question of whether there are capture groups that might not match
requires more customized regular expression parsing than we want to
embark on. Hence, the best we can do is document how it fails.

Change-Id: I7bd5011f5bd387f9345a0e79b22a4d7ed918a190
2012-06-08 12:16:31 -07:00
Dave Borowitz 7016504ecc Add simple tests for RegexPipeline
Change-Id: Ie800c55702ea9724b393be0a8b36e0e4da1a6e0d
2012-06-08 12:16:31 -07:00
Shawn O. Pearce 65f6e06b8d Merge branch 'stable-2.0'
By Robin Rosenberg (6) and others
via Gerrit Code Review @ Eclipse.org (2) and Matthias Sohn (1)
* stable-2.0:
  Prepare next 2.0.0-SNAPSHOT builds
  JGit v2.0.0.201206060730-rc3
  Remove Jetty p2 repository from Maven build
  Get rid of warnings about empty statments
  Removed unused parameters from private methods
  cleanup: Remove unused declarations
  Make FS OS X detection work for OpenJDK
  Use working tree iterator to compare file modes
  Further cleanup of exceptions in Git API
  Update build to use Tycho 0.15.0
  Throw formal CheckoutConflictException on hard reset
  Configure maven-source-plugin execution in parent POM
  Support gitdir: refs in BaseRepositoryBuilder.findGitDir
  Relax RevisionSyntaxException to an IllegalArgumentException

Change-Id: I05727693e0c9e762d4fc220ceadcd5a5bfb11d0d
2012-06-07 11:38:23 -07:00
Matthias Sohn f2d9a5ed31 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:57:32 +02:00
Matthias Sohn 1cb135ebfb JGit v2.0.0.201206060730-rc3
Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 13:27:54 +02:00
Markus Duft 8672c43ae3 Make DirCacheCheckout update timestamps in the index.
This updates the timestamp of files that are not touched during
checkout. Otherwise the timestamp will always be zero, causing the
IndexDiffFilter to always calculate the checksum of file contents.

Change-Id: I18047f5725f22811bb4194ca1d3a3cac56074183
2012-06-06 13:14:14 +02:00
Christian Halstrick 87c5588853 Merge "Use working tree iterator to compare file modes" into stable-2.0 2012-06-06 06:43:20 -04:00
Matthias Sohn 794f42f0ac Remove Jetty p2 repository from Maven build
This reference is not required and would force all JGit consumers to
switch to Maven 3 and Tycho which isn't desirable.

Bug: http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg01687.html
Change-Id: Iecf7c5aad46bb05fce0455cc8127aee2f679848c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 10:29:00 +02:00
Robin Rosenberg e251355897 Get rid of warnings about empty statments
In HtttpAuthMethod there were comments, but not in a style
that Eclipse recognizes.

Change-Id: I64f55b27143f8badcefbb419d3951f2a26b87d5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 09:44:39 +02:00
Robin Rosenberg 4e5944fbf8 Removed unused parameters from private methods
Change-Id: I60bc03b9550ccd2350918e6328276ec9839748d5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-06 09:44:18 +02:00
Robin Rosenberg 4321f9353f cleanup: Remove unused declarations
Change-Id: I3b54cb9f73cb433c71a441a11ddc74cfecdaa1dc
2012-06-06 01:43:44 +02:00
Shawn O. Pearce 73cdb08af6 Merge changes Iee9af8d5,I8e1674f0,If5a6fcc5,I3bb28e4d
* changes:
  Use BatchRefUpdate for tracking refs in FetchProcess
  Batch reference updates together for storage
  Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD
  Reject non-fast-forwards earlier in BaseReceivePack
2012-06-05 19:31:57 -04:00
Robin Rosenberg 20c33e6b0c Make FS OS X detection work for OpenJDK
OpenJDK sets the os.name system.property to "Darwin", while Apple's
version says "Mac OS X".

Change-Id: If08f8e7b8ef94ec00023a3f78bbf502ebd9699fb
2012-06-06 01:14:19 +02:00
Kevin Sawicki 59a98b49d2 Use working tree iterator to compare file modes
Add isModeDifferent method to WorkingTreeIterator
that compares mode with consideration of the
core.filemode setting in the config.

Bug: 379004
Change-Id: I07335300d787a69c3d1608242238991d5b5214ac
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
2012-06-05 08:23:04 -07:00
Robin Rosenberg b61d35e848 Further cleanup of exceptions in Git API
- Translate internal exceptions to corresponding API exception
- Do not catch GitAPI exceptions internally to an internal
exception. Just pass them to caller
- Mention thrown exceptions in javadoc

Change-Id: I9044cf86d2b0bcc8b63b7cc016e1bf0055a62053
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-05 16:55:39 +02:00
Matthias Sohn 1c0ac7cd10 Update build to use Tycho 0.15.0
Also use packaging type eclipse-repository to create the p2 repository
since Tycho fixed bug 368596 which we worked around using packaging type
eclipse-update-site.

Change-Id: Id4ee884027d55cd2d43e8a6ef58a67f74ab488e4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-05 15:50:29 +02:00
Kevin Sawicki 108e2bc6e4 Throw formal CheckoutConflictException on hard reset
This will allow calling classes to have access to the
conflicts that occurred during the attempted checkout.

Even though setFailOnConflict(false) is called on the
DirCacheCheckout a CheckoutConflictException can still
be thrown if cleanup fails.

Change-Id: Iea7ad3176a1b0e8606a643de8945e276718eb3ce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-05 15:49:55 +02:00
Kevin Sawicki 036e40ef42 Configure maven-source-plugin execution in parent POM
This ensures all modules will have source jars built

Change-Id: I11a762f54cc8b059eff3bd99138a7efa9723b19f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-05 00:37:30 +02:00
Kevin Sawicki 2a18bb304c Support gitdir: refs in BaseRepositoryBuilder.findGitDir
This allows findGitDir to be used for repositories containing
a .git file with a gitdir: ref to the repository's directory
such as submodule repositories that point to a folder under the
parent repository's .git/modules folder

Change-Id: I2f1ec7215a2208aa90511c065cadc7e816522f62
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-06-04 09:15:35 -07:00
Shawn Pearce e83d096ec6 Merge "fix PackWriter excluded objects handling" 2012-06-04 11:08:12 -04:00
Christian Halstrick 8a0169727f Merge "Relax RevisionSyntaxException to an IllegalArgumentException" into stable-2.0 2012-06-04 11:05:32 -04:00
Christian Halstrick 0f84b86e01 fix PackWriter excluded objects handling
PackWriter supports excluding objects from being written to the pack.
You may specify a PackIndex which lists all those objects which should
not go into the new pack. This feature was broken because not all
commits have been checked whether they should be excluded or not. For
other object types the exclude algorithm worked. This commit adds the
missing check.

Change-Id: Id0047098393641ccba784c58b8325175c22fcece
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-04 07:52:36 -07:00
Shawn Pearce bc7817c943 Merge "Only increment mod count if packed-refs file changes" into stable-2.0 2012-06-04 10:44:10 -04:00
Robin Rosenberg 0da46186e5 Relax RevisionSyntaxException to an IllegalArgumentException
Change-Id: Ide46eeb6cddcf3111f7c237ba8425a0854a90bfd
2012-06-04 16:32:16 +02:00
Stefan Lay f0df18ff4f Add lazy loading of body for tags to PlotWalk
This change is required by egit's lazy loading of the body in the
history view when the walk is started with setRetainBody(false).

Change-Id: I9291ba8c34c8744bc009b1bd302ed28bfa4e9476
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
2012-06-04 01:20:38 +02:00
Matthias Sohn 725329a0b9 Set minimum Jetty version to 7.6
This reverts commit 0c6e7d7127 which
didn't work since package imports need to be different with Jetty 7.5
and 7.6. Jetty 7.6 can be installed into Eclipse SDK 3.7.2 so rather
require Jetty 7.6 instead of adding a lot of reflective code to
workaround these incompatible changes.

Change-Id: I7eb6413ecf2bc4ad7bef0c70cde45ae3fde02b2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-03 23:54:12 +02:00
Matthias Sohn 0c6e7d7127 Fix compile error when using Jetty 7.5
Class Constraint was moved from package org.eclipse.jetty.http.security
in Jetty 7.5 to package org.eclipse.jetty.util.security in Jetty 7.6.
Hence also import package org.eclipse.jetty.security, then also Jetty
7.5, coming with Indigo, can be used to run JGit HTTP tests.

Change-Id: I26c38ec9f51b0a4fb62e1aa9f2266ada7bb2fa0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-03 09:30:03 +02:00
Matthias Sohn 447002b303 Revert Jetty from 8.1.3.v20120416 to 7.6.0.v20120127
This reverts commit 24a0f47e32 and
updates JGit dependencies to use the latest available Jetty 7.x
release. We can't use Jetty 8.x since it depends on Servlet API 3.0
which requires Java 6 but JGit still wants to support Java 5.
Use one of the target platforms defined in
Ibf67a6d3539fa0708a3e5dbe44fb899c56fbd8ed to work with that in Eclipse.

Change-Id: I343273d994dc7b6e0287c604e5926ff77d5b585b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-03 08:32:38 +02:00
Matthias Sohn ac98c29df9 Use default thread pool to prevent thread pool starvation
Bug: 380302
Change-Id: Ie66d495481776469ff2aa603c550557cff82cafc
Suggested-By: Joakim Erdfelt <joakim@intalio.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-06-03 08:00:48 +02:00
Robin Rosenberg 23b8136f8c Merge "Reduce number of hard-coded maven artifact versions" into stable-2.0 2012-05-31 17:49:29 -04:00
Robin Rosenberg 76514a3450 Remove obsolete GitlinksNotSupportedException
Change-Id: Idddd86818858b229e68b4a46597fc67547bcce17
2012-05-31 23:46:06 +02:00
Kevin Sawicki 058c74d8ad Update ORIG_HEAD when resetting
Write the old object id from the RefUpdate to the
ORIG_HEAD file after the update completes.

Add two new convenience methods to Repository to read
and write the ORIG_HEAD reference similar to the methods
for reading/writing CHERRY_PICK_HEAD and MERGE_HEAD.

Bug: 375525
Change-Id: I120b3b2cd3b1ddae88fce435285bae15cbf96f5e
2012-05-31 21:52:31 +02:00
Matthias Sohn b0531ee180 Reduce number of hard-coded maven artifact versions
This reduces the number of hard-coded version numbers we have to touch
with every release.

Change-Id: I0f2e910423d3db081b644968cd0d6a89178ba12a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-31 01:50:55 +02:00
Matthias Sohn 9bd9d9a698 Prepare next 2.0.0-SNAPSHOT builds
Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-31 01:39:57 +02:00
Matthias Sohn 4aa550f7cc JGit v2.0.0.201205301645-rc2
Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-30 23:08:15 +02:00
Robin Rosenberg 4e1454ded6 Git API does not declare GitAPIException call() and related cleanups
All commands should throw a GitAPIException so new exceptions can be
added without breaking the builds of old code, i.e. anyone that calls
a Git API should catch GitAPIException and not just the currently known
exceptions.

Now the only checked exceptions on Git API calls are GitException and
subclasses of it. New checked exceptions that are subclasses of
GitException may be added without breaking the API.

Javadoc for GitAPIException is declared on GitCommand and
inherited to subclasses. JGitInternalException is not explicitly
documented anymore.

Unfortunately this change itself breaks the API. The intention is
that it shall be possible to add new checked subclasses of
GitAPIException without breaking the API.

Bug: 366914
EGit-Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5
Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-30 22:08:49 +02:00
Robin Rosenberg 629e7cd926 Merge "Retain file length and mod time when doing a mixed reset" into stable-2.0 2012-05-30 15:57:04 -04:00
Robin Rosenberg 875247e24b Merge "Update smudged entries when writing index" into stable-2.0 2012-05-30 15:56:30 -04:00
Matthias Sohn 59d2ef9470 Enable loading history until a given commit
This is needed to allow jumping to a selected commit when loading
history incrementally.

Change-Id: Id3b97d88d3b4b2d67561b11f8810cb88fe040823
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-30 10:26:21 +02:00
Kevin Sawicki 91f5ce3a15 Only increment mod count if packed-refs file changes
Previously if a packed-refs file was racily clean then there
was a 2.5 second window in which each call to getPackedRefs
would increment the mod count causing a RefsChangedEvent to be
fired since the FileSnapshot would report the file as modified.

If a RefsChangedListener called getRef/getRefs from the
onRefsChanged method then a StackOverflowError could occur
since the stack could be exhausted before the 2.5 second
window expired and the packed-refs file would no longer
report being modified.

Now a SHA-1 is computed of the packed-refs file and the
mod count is only incremented when the packed refs are
successfully set and the id of the new packed-refs file
does not match the id of the old packed-refs file.

Change-Id: I8cab6e5929479ed748812b8598c7628370e79697
2012-05-28 14:06:12 -07:00