]> source.dussan.org Git - jgit.git/log
jgit.git
12 years agoReceivePack supports InputStream data after pack 59/6359/3
Ian Wetherbee [Thu, 7 Jun 2012 02:29:34 +0000 (19:29 -0700)]
ReceivePack supports InputStream data after pack

When receiving a pack, data buffered after the pack can restored
to the InputStream if the stream supports mark and reset.

Change-Id: If04915c32c91be28db8df7e8491ed3e9fe0e1608

12 years agoRead .gitmodules config from the tree in SubmoduleWalk 67/6367/5
Dave Borowitz [Thu, 14 Jun 2012 22:07:13 +0000 (15:07 -0700)]
Read .gitmodules config from the tree in SubmoduleWalk

It is not always appropriate to use the .gitmodules file from the
working tree, for example if reading the modules at a specific commit.
And sometimes it is impossible, as in a bare repository.

When using the static factory methods, automatically set up the
appropriate root tree so lazy loading of the config file reads from
the appropriate place. Leave the current behavior of looking in the
working tree as a fallback for the case where walking the index.

Change-Id: I71b7ed3ba16c80b0adb8c5fd85b5c37fd4aef8eb

12 years agoAdd a CommitBuilder method to edit arbitrary DirCacheEntrys 77/6377/2
Dave Borowitz [Fri, 15 Jun 2012 18:05:12 +0000 (11:05 -0700)]
Add a CommitBuilder method to edit arbitrary DirCacheEntrys

Change-Id: Ic2f5ec28621219a8ff1272674e2bf2c8d36eb107

12 years agoAdd a release() method to SubmoduleWalk 66/6366/2
Dave Borowitz [Thu, 14 Jun 2012 22:06:09 +0000 (15:06 -0700)]
Add a release() method to SubmoduleWalk

We need a way to release the underlying TreeWalk. Also, use this
method to release walks from the static factory methods on error or
when submodules are not found.

Change-Id: I6bedc2db78bcd577aef2cfe6715bb981a26dcfd7

12 years agoAdd "--squash" option to MergeCommand 95/4995/12
Tomasz Zarna [Wed, 13 Jun 2012 21:28:55 +0000 (23:28 +0200)]
Add "--squash" option to MergeCommand

CQ: 6570
Bug: 351806
Change-Id: I5e47810376419264ecf4247b5a333af5c8945080
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove unused import of ObjectInserter in ResolveMerger 69/6369/1
Tomasz Zarna [Fri, 15 Jun 2012 06:35:46 +0000 (08:35 +0200)]
Remove unused import of ObjectInserter in ResolveMerger

Change-Id: I415894418f6fbe922c61294b21e15eee64e8a806

12 years agoMerge "Add Transport URI constructor without a repository"
Shawn Pearce [Fri, 15 Jun 2012 05:53:45 +0000 (01:53 -0400)]
Merge "Add Transport URI constructor without a repository"

12 years agoMerge "Fix UnionInputStream.read to be more Java-like"
Shawn Pearce [Fri, 15 Jun 2012 05:27:43 +0000 (01:27 -0400)]
Merge "Fix UnionInputStream.read to be more Java-like"

12 years agoFix UnionInputStream.read to be more Java-like 58/6358/2
Ian Wetherbee [Thu, 7 Jun 2012 23:22:53 +0000 (16:22 -0700)]
Fix UnionInputStream.read to be more Java-like

Relax the read() method to not block until exactly "len" bytes have
been read. Instead, return when one or more bytes have been read, up
to "len", so UnionInputStream more closely resembles InputStream's
read() method.

Change-Id: I3f632be8eb85a4a0baf27c9f067c8d817162de2b

12 years agoUse only a single ObjectInserter in ResolveMerger 68/6368/1
Shawn O. Pearce [Fri, 15 Jun 2012 01:43:40 +0000 (18:43 -0700)]
Use only a single ObjectInserter in ResolveMerger

The base class supplies an ObjectInserter to its implementations
by way of the getObjectInserter method. Tracking a second inserter
instance doesn't match with the expected behavior.

Change-Id: I78996bd06ef9028c8aa2e4e192ff647c43da847d

12 years agoDefine ObjectInserter.Filter to wrap another ObjectInserter 64/6364/1
Shawn O. Pearce [Thu, 14 Jun 2012 19:49:57 +0000 (12:49 -0700)]
Define ObjectInserter.Filter to wrap another ObjectInserter

Filter supports wrapping another ObjectInserter. By default all
methods are delegated to the wrapped inserter. Implementors may
override methods selectively for altered behavior.

The instance that is wrapped may be determined dynamically by code,
supporting lazy allocation of the delegate, or other patterns like
object pooling.

Change-Id: I7b2613d09e73f94e675bad33afbb693f6a7f3df6

12 years agoAllow applications to pass ObjectInserter to Merger 63/6363/1
Shawn O. Pearce [Thu, 14 Jun 2012 19:42:39 +0000 (12:42 -0700)]
Allow applications to pass ObjectInserter to Merger

Gerrit Code Review needs to control which inserter is used by a
Merger. Allow the application to set the inserter before calling
merge, giving callers more direct control over how objects will
be created.

Change-Id: I3c527a493db4659e95289ff3077cffb9e32336cf

12 years agoAdd Transport URI constructor without a repository 60/6360/1
Ian Wetherbee [Thu, 7 Jun 2012 22:15:12 +0000 (15:15 -0700)]
Add Transport URI constructor without a repository

Let a Transport instance be opened with only a URI, for use in the
upcoming publish-subscribe feature.

Change-Id: I391c60c10d034b5c1c0ef19b1f24a9ba76b17bb5

12 years agoPrepare 2.1.0 builds 48/6348/1
Matthias Sohn [Wed, 13 Jun 2012 22:45:13 +0000 (00:45 +0200)]
Prepare 2.1.0 builds

Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMerge branch 'stable-2.0' 47/6347/1
Matthias Sohn [Wed, 13 Jun 2012 22:20:22 +0000 (00:20 +0200)]
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>
12 years agoPrepare post v2.0.0.201206130900-r builds 46/6346/1
Matthias Sohn [Wed, 13 Jun 2012 22:19:30 +0000 (00:19 +0200)]
Prepare post v2.0.0.201206130900-r builds

Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoFix GitDateFormatter javadoc. 21/6121/2
Tomasz Zarna [Wed, 13 Jun 2012 22:06:30 +0000 (00:06 +0200)]
Fix GitDateFormatter javadoc.

Change-Id: I627bdc387754a626ed8b1839494c05dfd5950d11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit v2.0.0.201206130900-r 39/6339/1 v2.0.0.201206130900-r
Matthias Sohn [Wed, 13 Jun 2012 13:03:59 +0000 (15:03 +0200)]
JGit v2.0.0.201206130900-r

Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd org.eclipse.jgit.pgm.feature to enable consumption via p2 18/6318/2
Matthias Sohn [Mon, 11 Jun 2012 22:17:55 +0000 (00:17 +0200)]
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>
12 years agoDo not set core.autocrlf when creating repo 16/6316/2
Robin Rosenberg [Tue, 12 Jun 2012 11:56:42 +0000 (13:56 +0200)]
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>
12 years agoAdd missing license header to modification times test. 09/6309/1
Markus Duft [Mon, 11 Jun 2012 05:13:58 +0000 (07:13 +0200)]
Add missing license header to modification times test.

This adds the header i forgot to add in
I18047f5725f22811bb4194ca1d3a3cac56074183.

Change-Id: I9160b0632c65da9e30a88688c4d9216b5f93d818

12 years agoMerge changes I1c87fea9,I7bd5011f,Ie800c557
Shawn Pearce [Fri, 8 Jun 2012 20:02:35 +0000 (16:02 -0400)]
Merge changes I1c87fea9,I7bd5011f,Ie800c557

* changes:
  Add MetaFilter.serveRegex(Pattern)
  Expand RegexPipeline documentation
  Add simple tests for RegexPipeline

12 years agoAdd MetaFilter.serveRegex(Pattern) 03/6303/2
Dave Borowitz [Fri, 8 Jun 2012 19:13:23 +0000 (12:13 -0700)]
Add MetaFilter.serveRegex(Pattern)

This allows the use of precompiled patterns, such as those compiled with
flags.

Change-Id: I1c87fea98e246004aecbae3aabaf1d21fbf3176e

12 years agoExpand RegexPipeline documentation 98/6298/2
Dave Borowitz [Thu, 7 Jun 2012 19:08:48 +0000 (12:08 -0700)]
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

12 years agoAdd simple tests for RegexPipeline 97/6297/2
Dave Borowitz [Thu, 7 Jun 2012 18:41:25 +0000 (11:41 -0700)]
Add simple tests for RegexPipeline

Change-Id: Ie800c55702ea9724b393be0a8b36e0e4da1a6e0d

12 years agoMerge branch 'stable-2.0' 96/6296/1
Shawn O. Pearce [Thu, 7 Jun 2012 18:37:11 +0000 (11:37 -0700)]
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

12 years agoPrepare next 2.0.0-SNAPSHOT builds 80/6280/1
Matthias Sohn [Wed, 6 Jun 2012 11:57:32 +0000 (13:57 +0200)]
Prepare next 2.0.0-SNAPSHOT builds

Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit v2.0.0.201206060730-rc3 77/6277/1 v2.0.0.201206060730-rc3
Matthias Sohn [Wed, 6 Jun 2012 11:27:54 +0000 (13:27 +0200)]
JGit v2.0.0.201206060730-rc3

Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMake DirCacheCheckout update timestamps in the index. 32/6232/6
Markus Duft [Wed, 6 Jun 2012 11:14:14 +0000 (13:14 +0200)]
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

12 years agoMerge "Use working tree iterator to compare file modes" into stable-2.0
Christian Halstrick [Wed, 6 Jun 2012 10:43:20 +0000 (06:43 -0400)]
Merge "Use working tree iterator to compare file modes" into stable-2.0

12 years agoRemove Jetty p2 repository from Maven build 76/6276/1
Matthias Sohn [Wed, 6 Jun 2012 08:29:00 +0000 (10:29 +0200)]
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>
12 years agoGet rid of warnings about empty statments 72/6272/2
Robin Rosenberg [Wed, 6 Jun 2012 00:28:06 +0000 (02:28 +0200)]
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>
12 years agoRemoved unused parameters from private methods 68/6268/4
Robin Rosenberg [Wed, 6 Jun 2012 00:26:53 +0000 (02:26 +0200)]
Removed unused parameters from private methods

Change-Id: I60bc03b9550ccd2350918e6328276ec9839748d5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agocleanup: Remove unused declarations 67/6267/1
Robin Rosenberg [Tue, 5 Jun 2012 23:43:44 +0000 (01:43 +0200)]
cleanup: Remove unused declarations

Change-Id: I3b54cb9f73cb433c71a441a11ddc74cfecdaa1dc

12 years agoMerge changes Iee9af8d5,I8e1674f0,If5a6fcc5,I3bb28e4d
Shawn O. Pearce [Tue, 5 Jun 2012 23:31:57 +0000 (19:31 -0400)]
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

12 years agoMake FS OS X detection work for OpenJDK 66/6266/1
Robin Rosenberg [Sun, 20 May 2012 08:45:03 +0000 (10:45 +0200)]
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

12 years agoUse working tree iterator to compare file modes 42/6142/6
Kevin Sawicki [Tue, 5 Jun 2012 15:23:04 +0000 (08:23 -0700)]
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>
12 years agoFurther cleanup of exceptions in Git API 07/6207/9
Robin Rosenberg [Tue, 5 Jun 2012 14:52:49 +0000 (16:52 +0200)]
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>
12 years agoUpdate build to use Tycho 0.15.0 55/6255/1
Matthias Sohn [Tue, 5 Jun 2012 13:45:29 +0000 (15:45 +0200)]
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>
12 years agoThrow formal CheckoutConflictException on hard reset 40/6240/3
Kevin Sawicki [Tue, 5 Jun 2012 00:17:30 +0000 (02:17 +0200)]
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>
12 years agoConfigure maven-source-plugin execution in parent POM 36/6136/2
Kevin Sawicki [Wed, 22 Feb 2012 22:50:25 +0000 (14:50 -0800)]
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>
12 years agoSupport gitdir: refs in BaseRepositoryBuilder.findGitDir 39/6139/2
Kevin Sawicki [Thu, 10 May 2012 20:32:16 +0000 (13:32 -0700)]
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>
12 years agoMerge "fix PackWriter excluded objects handling"
Shawn Pearce [Mon, 4 Jun 2012 15:08:12 +0000 (11:08 -0400)]
Merge "fix PackWriter excluded objects handling"

12 years agoMerge "Relax RevisionSyntaxException to an IllegalArgumentException" into stable-2.0
Christian Halstrick [Mon, 4 Jun 2012 15:05:32 +0000 (11:05 -0400)]
Merge "Relax RevisionSyntaxException to an IllegalArgumentException" into stable-2.0

12 years agofix PackWriter excluded objects handling 75/5875/2
Christian Halstrick [Tue, 8 May 2012 12:25:46 +0000 (14:25 +0200)]
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>
12 years agoMerge "Only increment mod count if packed-refs file changes" into stable-2.0
Shawn Pearce [Mon, 4 Jun 2012 14:44:10 +0000 (10:44 -0400)]
Merge "Only increment mod count if packed-refs file changes" into stable-2.0

12 years agoRelax RevisionSyntaxException to an IllegalArgumentException 28/6128/3
Robin Rosenberg [Sat, 26 May 2012 08:07:18 +0000 (10:07 +0200)]
Relax RevisionSyntaxException to an IllegalArgumentException

Change-Id: Ide46eeb6cddcf3111f7c237ba8425a0854a90bfd

12 years agoAdd lazy loading of body for tags to PlotWalk 50/6150/3
Stefan Lay [Fri, 11 May 2012 09:18:36 +0000 (11:18 +0200)]
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>
12 years agoSet minimum Jetty version to 7.6 29/6229/1
Matthias Sohn [Sun, 3 Jun 2012 21:54:12 +0000 (23:54 +0200)]
Set minimum Jetty version to 7.6

This reverts commit 0c6e7d71273b2b899f35e974d5a1463ce110fa7e 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>
12 years agoFix compile error when using Jetty 7.5 27/6227/1
Matthias Sohn [Sun, 3 Jun 2012 07:30:03 +0000 (09:30 +0200)]
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>
12 years agoRevert Jetty from 8.1.3.v20120416 to 7.6.0.v20120127 13/6213/4
Matthias Sohn [Sun, 3 Jun 2012 06:32:38 +0000 (08:32 +0200)]
Revert Jetty from 8.1.3.v20120416 to 7.6.0.v20120127

This reverts commit 24a0f47e32ab7cdf20c2201d7100599ea057f8a3 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>
12 years agoUse default thread pool to prevent thread pool starvation 26/6226/1
Matthias Sohn [Sun, 3 Jun 2012 06:00:48 +0000 (08:00 +0200)]
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>
12 years agoMerge "Reduce number of hard-coded maven artifact versions" into stable-2.0
Robin Rosenberg [Thu, 31 May 2012 21:49:29 +0000 (17:49 -0400)]
Merge "Reduce number of hard-coded maven artifact versions" into stable-2.0

12 years agoRemove obsolete GitlinksNotSupportedException 27/6127/3
Robin Rosenberg [Sat, 26 May 2012 07:51:21 +0000 (09:51 +0200)]
Remove obsolete GitlinksNotSupportedException

Change-Id: Idddd86818858b229e68b4a46597fc67547bcce17

12 years agoUpdate ORIG_HEAD when resetting 40/6140/5
Kevin Sawicki [Thu, 10 May 2012 22:56:21 +0000 (15:56 -0700)]
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

12 years agoReduce number of hard-coded maven artifact versions 89/6189/1
Matthias Sohn [Wed, 30 May 2012 23:50:55 +0000 (01:50 +0200)]
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>
12 years agoPrepare next 2.0.0-SNAPSHOT builds 88/6188/1
Matthias Sohn [Wed, 30 May 2012 23:39:57 +0000 (01:39 +0200)]
Prepare next 2.0.0-SNAPSHOT builds

Change-Id: Iffc57d6b25dafb72272d1957116c19ab45ba2c54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoJGit v2.0.0.201205301645-rc2 83/6183/1 v2.0.0.201205301645-rc2
Matthias Sohn [Wed, 30 May 2012 20:44:08 +0000 (22:44 +0200)]
JGit v2.0.0.201205301645-rc2

Change-Id: Ic4f84f1a11c93863c229c0089f2e4edc7c7a36b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoGit API does not declare GitAPIException call() and related cleanups 00/6100/11
Robin Rosenberg [Wed, 30 May 2012 00:07:25 +0000 (02:07 +0200)]
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>
12 years agoMerge "Retain file length and mod time when doing a mixed reset" into stable-2.0
Robin Rosenberg [Wed, 30 May 2012 19:57:04 +0000 (15:57 -0400)]
Merge "Retain file length and mod time when doing a mixed reset" into stable-2.0

12 years agoMerge "Update smudged entries when writing index" into stable-2.0
Robin Rosenberg [Wed, 30 May 2012 19:56:30 +0000 (15:56 -0400)]
Merge "Update smudged entries when writing index" into stable-2.0

12 years agoEnable loading history until a given commit 67/6167/1
Matthias Sohn [Sat, 19 May 2012 14:49:03 +0000 (16:49 +0200)]
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>
12 years agoOnly increment mod count if packed-refs file changes 41/6141/1
Kevin Sawicki [Fri, 11 May 2012 02:13:24 +0000 (19:13 -0700)]
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

12 years agoRetain file length and mod time when doing a mixed reset 38/6138/1
Kevin Sawicki [Sun, 6 May 2012 17:17:05 +0000 (10:17 -0700)]
Retain file length and mod time when doing a mixed reset

Previously the index was cleared and updated with a new tree.

Now the commit being reset to and the index are iterated over
in a tree walk and the current index mod time and file length
are copied over to the new dir cache entry being written if
the object ids are the same.

Change-Id: Iaf9e624efb0bf90f9e05fcb0587dde4dec50000c

12 years agoUpdate smudged entries when writing index 37/6137/1
Kevin Sawicki [Mon, 21 May 2012 22:00:23 +0000 (15:00 -0700)]
Update smudged entries when writing index

Overload DirCache.lock to take a repository that is
used for updating smudged index entries with information
from the repository's working tree.

New unit tests are also added for updating smudged index
entries on reset, checkout, and commit.

Change-Id: I88689f26000e4e57e77931e5ace7c804d92af1b6

12 years agoMerge "Enable loading history until a given commit"
Stefan Lay [Fri, 25 May 2012 07:51:21 +0000 (03:51 -0400)]
Merge "Enable loading history until a given commit"

12 years agoUpdate Jetty to 8.1.3.v20120416 97/6097/1
Matthias Sohn [Wed, 23 May 2012 20:21:58 +0000 (22:21 +0200)]
Update Jetty to 8.1.3.v20120416

Jetty 8.1.3 comes with Juno M7 and this version can be installed from
http://download.eclipse.org/jetty/updates/jetty-bundles-8.x/8.1.3.v20120416/

Change-Id: Ifc4bfbb3efbab0f5bfbde74f0b2ddc5a2f9ee6a5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd config --list command to pgm 98/4898/4
Tomasz Zarna [Fri, 18 May 2012 12:20:05 +0000 (14:20 +0200)]
Add config --list command to pgm

Currently, only --list option is supported with --global, --system,
--local and --file switches.

Change-Id: I9b179b162996520e95c4e001dccd65c566a4bd27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnsure resetting on commit id 80/6080/2
Dariusz Luksza [Wed, 23 May 2012 00:04:04 +0000 (02:04 +0200)]
Ensure resetting on commit id

When reset command was called with tag name as parameter the resulting
HEAD was set to the tag's SHA-1 which is a bug. This patch ensures that
repository.resolve() call always returns commit id.

Change-Id: I219b898c620a75c497c8652dbf4735fd094c4d7c
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUse BatchRefUpdate for tracking refs in FetchProcess 87/6087/2
Shawn O. Pearce [Wed, 23 May 2012 03:13:11 +0000 (20:13 -0700)]
Use BatchRefUpdate for tracking refs in FetchProcess

If there are a lot of references to modify, using BatchRefUpdate can
save time if the underlying storage is able to combine these updates
together. This should speed up initial clone or fetch into an empty
repository, as some projects can have hundreds of release tags, or
hundreds of branch heads.

Change-Id: Iee9af8d5fa19080077d88357c18853540936e940

12 years agoBatch reference updates together for storage 54/5254/2
Shawn O. Pearce [Tue, 22 May 2012 23:45:06 +0000 (16:45 -0700)]
Batch reference updates together for storage

clone, fetch and push can all update multiple references in a single
command invocation. Rather than performing sequential iteration
of each reference change inside of the application code, push this
down into the reference database where the implementation can take
advantage of the batch size and optimize itself.

For the local filesystem implementation the obvious optimization
is to write a packed-refs file when the repository is completely
empty. The initial clone, fetch or push into the destination may
have hundreds of new references. Writing all of these as loose
files is not efficient. This optimization is not implemented in
this commit and is left as an exercise for the reader to supply
in a future commit to JGit.

To make the API changes simple, define the BatchRefUpdate type and
implementation using the existing sequential behavior.

Change-Id: I8e1674f091e05e24e3ff56ccbc687a6d18a6a61e

12 years agoExpose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD 85/6085/1
Shawn O. Pearce [Tue, 22 May 2012 23:22:41 +0000 (16:22 -0700)]
Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD

When a command's type is UPDATE, JGit might not yet be sure if it
is a fast-forward or not. Expose a utility method to compute the
exact type by performing the merge base test, allowing the type
to be switched to UPDATE_NONFASTFORWARD if old ObjectId is not
contained in new ObjectId.

BaseReceivePack already does this test when validating the incoming
command list, so provide a package level backdoor to set the type
and avoid needing to redo the merge test later.

Change-Id: If5a6fcc50dc4d6f96e9bb0bb7bba15ebe8b86377

12 years agoReject non-fast-forwards earlier in BaseReceivePack 84/6084/1
Shawn O. Pearce [Tue, 22 May 2012 22:59:53 +0000 (15:59 -0700)]
Reject non-fast-forwards earlier in BaseReceivePack

If BaseReceivePack has setAllowNonFastForwards(false) configured
(such as by receive.denynonfastforwards), automatically reject
any command that attempts a non-fast-forward update before it goes
further in processing.

This matches with other checks in validateCommands(), such as the
early failure of delete attempts when isAllowDeletes() is false.

Change-Id: I3bb28e4dd6d17cb31ede09eb84ceb67cdb17ea5d

12 years agoMove NLS test for HttpServerText to http.test 83/6083/1
Shawn O. Pearce [Tue, 22 May 2012 21:52:32 +0000 (14:52 -0700)]
Move NLS test for HttpServerText to http.test

This never should have been in the core library test suite, as that
test suite never should depend upon the HTTP server module.

Change-Id: Ie0528c4d1c755823303d138e327a3a2f4caccc32

12 years agoFix JGit source bundle packaging 46/6046/2
Matthias Sohn [Mon, 21 May 2012 18:51:10 +0000 (20:51 +0200)]
Fix JGit source bundle packaging

Due to Tycho bug 368596 we didn't package the correct JGit source bundle
anymore. Instead of sources it contained the binary bundle. As a
workaround fall back to use packaging type eclipse-update-site which
doesn't seem to have this problem.

Bug: 368596
Bug: 379402
Change-Id: I3192dbd00b51e6ee6596d2301050b2a6f7028e3b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoSmudge index entries on first write (too), as well when reading 13/5413/9
Robin Rosenberg [Mon, 21 May 2012 17:48:40 +0000 (10:48 -0700)]
Smudge index entries on first write (too), as well when reading

That happens when the index and a new file is created within the same
second and becomes a problem if we then modify the newly created file
within the same second after adding it to the index. Without smudging
JGit will, on later reads, think the file is unchanged.

The accompanying test passed with the smuding on read.

Change-Id: I4dfecf5c93993ef690e7f0dddb3f3e6125daae15

12 years agoEnable loading history until a given commit 53/5653/7
Matthias Sohn [Sat, 19 May 2012 14:49:03 +0000 (16:49 +0200)]
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>
12 years agoAdd user friendly output from jgit commit command 34/6034/1
Mikael Karlsson [Fri, 18 May 2012 20:07:50 +0000 (22:07 +0200)]
Add user friendly output from jgit commit command

Instead of printing the stack trace from the JGitInternalException
thrown from CommitMessage.call(), print just the exception
message, using the Die exception.

Change-Id: I9ec3eb02eb001813fa15ac6f90a606223dcdafdc

12 years agoDon't swallow JSchException "Auth fail" exception 88/5988/3
Dariusz Luksza [Wed, 16 May 2012 05:55:03 +0000 (07:55 +0200)]
Don't swallow JSchException "Auth fail" exception

"Auth fail" exception was swallowed during retrying, this leads to
"Session down" exception during clone operation with invalid SSH keys.

Bug: 336795
Change-Id: Id8d9e83b10f4f2a01e0cf89819190bb23a04a2b9
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
12 years agoEnable call chaining on LsRemoteCommand methods 74/5974/1
Dave Borowitz [Tue, 20 Mar 2012 14:45:12 +0000 (07:45 -0700)]
Enable call chaining on LsRemoteCommand methods

Change-Id: I706332386415892d7a964b241442832ad79fa223

12 years agoFactor a base class out of ReceivePack 18/5818/4
Dave Borowitz [Thu, 3 May 2012 23:44:53 +0000 (16:44 -0700)]
Factor a base class out of ReceivePack

We are working on a publish/subscribe based git protocol, and we want to
reuse several parts of the ReceivePack-like code for reading commands
and processing a pack. In this new implementation, the connection
management will be very different, in particular, there may be multiple
packs received on a single open connection. So, hoist out as much as we
can from ReceivePack, mostly just leaving behind the single-connection
version in that class.

Change-Id: I5567aad6ae77951f73f59c1f91996d934ea88334

12 years agoAdd --all switch to org.eclipse.jgit.pgm.Commit 63/5763/2
Tomasz Zarna [Mon, 30 Apr 2012 13:18:07 +0000 (15:18 +0200)]
Add --all switch to org.eclipse.jgit.pgm.Commit

Change-Id: Iab52f995676daf60e0dfa043cc9e022f6e32a758
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoCleanup MergeResult constructors 68/5368/2
Tomasz Zarna [Thu, 15 Mar 2012 17:04:16 +0000 (18:04 +0100)]
Cleanup MergeResult constructors

'mergeStrategy' should be 5th argument, after 'mergeStatus'. Pass
'description' if available.

Change-Id: I97cebfe5d7db6247fe899075d917b82955906f85
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoAdd missing @since tags to mark API added in 2.0 73/5873/2
Matthias Sohn [Mon, 7 May 2012 21:45:24 +0000 (23:45 +0200)]
Add missing @since tags to mark API added in 2.0

Change-Id: I0a86ce0e393dfde9bb27f0b29e036e76c856396e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
12 years agoUpdate tycho version to 0.14.1 96/5596/2
Matthias Sohn [Mon, 16 Apr 2012 15:40:43 +0000 (17:40 +0200)]
Update tycho version to 0.14.1

Tycho 0.14.1 enforces that artifactId and feature/bundle SymbolicName
must match, hence follow recommended migration practice and change
groupId of feature projects in order not to change the feature names as
this would require a feature migration.

Also migrate the p2 repository build from the deprecated packaging type
eclipse-update-site to packaging type eclipse-repository.

Change-Id: I99fc6c2bbb20efbd6514bdd9940f3535707c21bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoUpdate packaging project to build using Indigo platform 95/5595/2
Matthias Sohn [Mon, 16 Apr 2012 12:47:44 +0000 (14:47 +0200)]
Update packaging project to build using Indigo platform

Change-Id: I4c07112a6723d90d3677761f5476af00ead58282
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove throws IOException declaration on filterClean 03/5903/2
Kevin Sawicki [Wed, 9 May 2012 18:18:02 +0000 (11:18 -0700)]
Remove throws IOException declaration on filterClean

This method only creates an EolCanonicalizingInputStream
which does not throw an IOException and so the throws
declaration on the method is unneeded.

Change-Id: Icae8b80006c5e3ffcf3b69790a1a45c505be0f05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoAdd Object type to Comparable implements declaration 02/5902/3
Kevin Sawicki [Wed, 9 May 2012 17:41:40 +0000 (10:41 -0700)]
Add Object type to Comparable implements declaration

This removes unchecked warnings when a List of
AnyObjectId objects or any of its subclasses are
passed to Collections.sort such as in PackWriter

Change-Id: I806732cee24349c75c0357a655df55b070f2f213
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoRemove 4 unboxed warnings 01/5901/2
Kevin Sawicki [Wed, 9 May 2012 15:45:08 +0000 (08:45 -0700)]
Remove 4 unboxed warnings

Use Integer.intValue to explicitly convert to an int

Change-Id: I1135ed01af4e274b26d6b07d1a50f48ef0a30d91
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoMake output stream optional in DiffCommand 08/5908/2
Kevin Sawicki [Wed, 9 May 2012 22:19:04 +0000 (00:19 +0200)]
Make output stream optional in DiffCommand

Use the NullOutputStream.INSTANCE value when the
configured output stream is null or the command is
configured to only show name and status.

Also only set the context and prefix options if
formatting is actually being performed.

Bug: 377157
Change-Id: I333cfcc82ee746f3c6a8e94c09dcc803ffbb4b3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoCompare modes before comparing ids in ResolveMerger 09/5909/1
Kevin Sawicki [Wed, 9 May 2012 21:31:59 +0000 (14:31 -0700)]
Compare modes before comparing ids in ResolveMerger

Comparing ids can be more expensive so do the cheap
mode check first and short circuit the id comparison
when modes are non-equal

Change-Id: I671eda51c74a411cc27de9d6077cc76e816ebe2b

12 years agoRemove 86 boxing warnings 93/5893/2
Kevin Sawicki [Wed, 9 May 2012 04:42:53 +0000 (21:42 -0700)]
Remove 86 boxing warnings

Use Integer, Character, and Long valueOf methods when
passing parameters to MessageFormat and other places
that expect objects instead of primitives

Change-Id: I5942fbdbca6a378136c00d951ce61167f2366ca4

12 years agoRemove unnecessary boxing SuppressWarnings annotation 91/5891/1
Kevin Sawicki [Wed, 9 May 2012 03:42:19 +0000 (20:42 -0700)]
Remove unnecessary boxing SuppressWarnings annotation

Change-Id: Id8a6d9f96860742f9094efdb4f31a952be7d3025

12 years agoRemove unneeded catch block and null checks 32/5832/1
Kevin Sawicki [Fri, 4 May 2012 21:37:40 +0000 (14:37 -0700)]
Remove unneeded catch block and null checks

The catched exception was just rethrown and the
null check of the locked dir cache was unneeded if
the assignment was done outside the try block.

Change-Id: If2ee1f3eff3849f8da51eab825057fc56e166a94

12 years agoFix two typos in CLIText.properties 80/5780/1
Tomasz Zarna [Wed, 2 May 2012 09:35:13 +0000 (11:35 +0200)]
Fix two typos in CLIText.properties

Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca

12 years agoMerge "Update README regarding CRLF conversion, /etc and $HOME"
Matthias Sohn [Mon, 30 Apr 2012 20:07:38 +0000 (16:07 -0400)]
Merge "Update README regarding CRLF conversion, /etc and $HOME"

12 years agoUpdate README regarding CRLF conversion, /etc and $HOME 59/5759/1
Robin Rosenberg [Sat, 28 Apr 2012 22:37:54 +0000 (00:37 +0200)]
Update README regarding CRLF conversion, /etc and $HOME

Change-Id: I3c41a8ee7f500e2c39df94eaf5d87c234934b741

12 years agoValidate paths during DirCheckout 17/4617/16
Robin Rosenberg [Mon, 23 Apr 2012 20:37:50 +0000 (22:37 +0200)]
Validate paths during DirCheckout

DirCacheCheckout and CanonicalTreeParser cooperate. CanonicalTreeParser
can detect malformed, potentially malicious tree entries and sets a
flag, while DirCacheCheckout refuses to work with such paths.

Malicious tree entries are ".", "..", ".git" (case insensitive), any
name containing '/' and (on Windows '\') and also (on Windows)
any paths ending in a combination of '.' or space or containing a ':'.
We also forbid all special names like "con" etc on Windows.

Some of the test can execute on any platform by enabling partial
platform emulation.

A new runtime exception, InvalidPathException, is introduced. For
backwards compatibility it extends InvalidArgumentException.

Change-Id: I86199105814b63d4340e5de0e471d0da6b579ead
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
12 years agoEnable large file support 89/5589/4
Robin Rosenberg [Mon, 16 Apr 2012 22:18:10 +0000 (00:18 +0200)]
Enable large file support

Allow adding files with size over 2 GB. The drawback is that the tests
for huge file support adds roughly 10 minutes of execution time.
For that reason we @Ignore the test in the standard test execution.

Change-Id: I5788e8009899203b346f353297166825b3744575

12 years agoAllow to write tests with CLI syntax 08/5408/2
Tomasz Zarna [Fri, 23 Mar 2012 08:10:41 +0000 (09:10 +0100)]
Allow to write tests with CLI syntax

CQ: 6385
Bug: 365444
Change-Id: I2d5164cd92429673fe3c37e9f5f9bc565192cc12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>