]> source.dussan.org Git - jgit.git/log
jgit.git
11 years agoSupport running from JARs in JGitTestUtil 90/17990/2
Shawn Pearce [Fri, 1 Nov 2013 16:49:06 +0000 (10:49 -0600)]
Support running from JARs in JGitTestUtil

Buck invokes JUnit tests from compiled JARs, not class directories.
When copying a resource back to the filesystem a jar: style URL is
obtained from the ClassLoader.

Change-Id: I28d702484ec13b0b309b87990da867050e4b5ec6

11 years agoCache SimpleDateFormat in GitDateParser per locale 93/18093/3
Matthias Sohn [Tue, 5 Nov 2013 15:57:06 +0000 (16:57 +0100)]
Cache SimpleDateFormat in GitDateParser per locale

Otherwise switching to another locale yields wrong results when parsing
date strings in GitDateParser. Since the MockSystemReader explicitly
uses english locale the tests need to specify the locale to be used when
parsing date strings.

Bug: 420772
Change-Id: I313ef6b1e9ef3bfb43d929ce34712ebd21f2cd9c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoFix FIXUP error for blank lines in interactive rebase 66/18666/3
Stefan Lay [Thu, 21 Nov 2013 13:00:30 +0000 (14:00 +0100)]
Fix FIXUP error for blank lines in interactive rebase

Empty lines of discarded commit messages were added to the commit
message because they were not commented out properly.

Bug: 422246
Change-Id: I263e8a6b30a3392d8b4f09c0695505068a0a485d
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
11 years agoFix parsing Rebase todo lines when commit message is missing 69/18669/1
Stefan Lay [Thu, 21 Nov 2013 13:46:12 +0000 (14:46 +0100)]
Fix parsing Rebase todo lines when commit message is missing

Bug: 422253
Change-Id: I9739b16c91d2df31a481360a712d3479a4eeee2e
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
11 years agoAdd close() method to API 60/18560/4
Christian Halstrick [Tue, 19 Nov 2013 11:44:19 +0000 (12:44 +0100)]
Add close() method to API

The API in org.eclipse.jgit.api does allow to open repositories but it
did not allow to close them. This commit fixes this and allows
API users to close a repository without having to use lower-level
classes.

Bug: 420502
Change-Id: I866225cc8534ae5916113fa24eb1c7513fd4472e
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate Jetty to 7.6.14.v20131031 12/18512/1
Matthias Sohn [Mon, 18 Nov 2013 16:57:30 +0000 (17:57 +0100)]
Update Jetty to 7.6.14.v20131031

Change-Id: Icb7f91e40d2a216fda519c64a94d5ad18eac683c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Don't delete .idx file if .pack file can't be deleted"
Robin Rosenberg [Mon, 18 Nov 2013 04:50:41 +0000 (23:50 -0500)]
Merge "Don't delete .idx file if .pack file can't be deleted"

11 years agoDocument that path parameters should use '/' as separator 45/18445/1
Robin Stocker [Fri, 15 Nov 2013 18:20:02 +0000 (19:20 +0100)]
Document that path parameters should use '/' as separator

Bug: 421600
Change-Id: I505d994518aa608aaa797252433b6c97e2def5b4
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoImprove Javadoc for typeHint parameter 70/18370/1
Robin Stocker [Wed, 13 Nov 2013 19:14:16 +0000 (20:14 +0100)]
Improve Javadoc for typeHint parameter

Link to an example type constant.

Change-Id: I214ab834fa02901a38e6048a94a5224b30c5d93f
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoDo not update the ref hot bit when checking isIndexLoaded 62/18362/1
Colby Ranger [Wed, 13 Nov 2013 23:19:03 +0000 (15:19 -0800)]
Do not update the ref hot bit when checking isIndexLoaded

DfsPackFile.isIndexLoaded() uses the DfsBlockCache.Ref.get() method
to check if the index loaded. However, using the get() method marks
a hot bit in the cache, which can cause the index to never be unloaded
and seem hotter than it really is. Add a has() method which only
checks if the value is not null and does not update the hot bit.

Change-Id: I7e9ed216f6e273e8f5d79ae573973197654419b4

11 years agoDon't delete .idx file if .pack file can't be deleted 64/18264/2
Christian Halstrick [Mon, 11 Nov 2013 09:57:46 +0000 (10:57 +0100)]
Don't delete .idx file if .pack file can't be deleted

If during an garbage collection old packfiles are deleted it could
happen that on certain platforms the index file can be deleted but the
packfile can't be deleted (because someone locked the file). This led
to repositories with packfiles without corresponding index files. Those
zombie-packfiles potentially consume a lot of space on disk and it is
never tried to delete them again. Try to avoid this situation by
deleting packfiles first and don't try to delete the other files if we
can't delete the packfile. This gives us the chance to delete the
packfile during next GC.

This commit only improves the situation - there is still the chance for
orphan files during packfile deletion. We don't have an atomic delete
of multiple files .

Change-Id: I0a19ae630186f07d0cc7fe9df246fa1cedeca8f6

11 years agoUpdate to Ant 1.9.2 12/18212/2
Matthias Sohn [Fri, 8 Nov 2013 08:06:47 +0000 (09:06 +0100)]
Update to Ant 1.9.2

CQ: 7698
Change-Id: I2ae580041eb334c613969bc9d66d169d08c12c4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Add missing @since tags"
Matthias Sohn [Tue, 12 Nov 2013 23:09:02 +0000 (18:09 -0500)]
Merge "Add missing @since tags"

11 years agoAdd uses directives to ensure OSGi wires jgit bundles correctly 01/18301/2
Matthias Sohn [Tue, 12 Nov 2013 16:57:30 +0000 (17:57 +0100)]
Add uses directives to ensure OSGi wires jgit bundles correctly

See
http://spring.io/blog/2008/10/20/understanding-the-osgi-uses-directive/

Bug: 420903
Change-Id: I3706a2b8f695d4ce0ee2333722ed7b8d31032f1e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoIntroduce Kepler and Luna target platform 99/18299/3
Matthias Sohn [Tue, 12 Nov 2013 16:42:53 +0000 (17:42 +0100)]
Introduce Kepler and Luna target platform

We need this to enable building jgit with dependencies from Orbit
version used by Luna.

Default target platform is Kepler. In order to use Luna run

mvn clean install -P platform-luna -f org.eclipse.jgit.packaging/pom.xml

Change-Id: I544516d97067f45d1034929b534ad1600136614d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoUpdate build to use Tycho 0.19 59/18259/1
Matthias Sohn [Mon, 11 Nov 2013 10:58:19 +0000 (11:58 +0100)]
Update build to use Tycho 0.19

Change-Id: I90f71f2612a934e83a0af8dccfe08592e4532ddf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years ago[findBugs] Remove nonsense call 51/18251/2
Matthias Sohn [Sat, 9 Nov 2013 23:28:22 +0000 (00:28 +0100)]
[findBugs] Remove nonsense call

Result of c.containsAll(c)  is always true for any collection c.

Change-Id: I853cbb44bdc03e2b54229bb9c36ae42e02dcc4d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove unnecessary @SuppressWarnings("null") 50/18250/2
Matthias Sohn [Sat, 9 Nov 2013 23:20:54 +0000 (00:20 +0100)]
Remove unnecessary @SuppressWarnings("null")

Change-Id: I5bddcdab2c5cc92622144a7b207bad90cb601609
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoGrant access to internal jgit package to org.eclipse.jgit.junit 49/18249/2
Matthias Sohn [Sat, 9 Nov 2013 23:19:13 +0000 (00:19 +0100)]
Grant access to internal jgit package to org.eclipse.jgit.junit

This silences some discouraged access warnings issued since
TestRepository uses PackWriter which is in an internal package.

Change-Id: Ic9c4631e237c2fe1996c518328ecc2a9ab5c348b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove duplicate package export 48/18248/2
Matthias Sohn [Sat, 9 Nov 2013 23:17:00 +0000 (00:17 +0100)]
Remove duplicate package export

Change-Id: I185610f12069cd4ce1b27650581375b6b3019d2f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't import non-existing package org.eclipse.jgit.java7 47/18247/1
Matthias Sohn [Sat, 9 Nov 2013 23:01:51 +0000 (00:01 +0100)]
Don't import non-existing package org.eclipse.jgit.java7

Change-Id: Idc48cb1995050913498d2bad97a8e6e330dee94c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing @since tags 11/18211/2
Matthias Sohn [Fri, 8 Nov 2013 08:04:56 +0000 (09:04 +0100)]
Add missing @since tags

Change-Id: Ic4fabec818d6fe336d3256ddc95934271272914a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoInteractive Rebase: Do actions if there were conflicts 18/18118/5
Stefan Lay [Wed, 6 Nov 2013 10:16:34 +0000 (11:16 +0100)]
Interactive Rebase: Do actions if there were conflicts

If a commit was marked for edit, reword, squash or fixup, but the
interactive rebase stopped because of a conflict, the step was not done
after conflict resolution. This is done now.

Change-Id: If8e7ccc50469165744f2b8a53d180f9ba0f72330
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRebase interactive should finish if last step is edit 16/18116/1
Stefan Lay [Wed, 6 Nov 2013 08:43:31 +0000 (09:43 +0100)]
Rebase interactive should finish if last step is edit

When the last step was an edit step, rebase interactive did not finish
after continuing the rebase. Instead, it returned with the status
FAST_FORWARD.

Change-Id: Ib19857474ac089dfeaae665ad5e95c66c21099b0

11 years agoMerge changes I40f2311c,I3c419094
Matthias Sohn [Tue, 5 Nov 2013 22:03:35 +0000 (17:03 -0500)]
Merge changes I40f2311c,I3c419094

* changes:
  Add additional RebaseResult for editing commits
  Add Squash/Fixup support for rebase interactive in RebaseCommand

11 years agoMerge changes I85470d1d,I43711486,Ie6ade781,Ic9ab2b6e,Iebe50933,Id6fac253,Ia6becf30...
Shawn Pearce [Tue, 5 Nov 2013 17:41:12 +0000 (12:41 -0500)]
Merge changes I85470d1d,I43711486,Ie6ade781,Ic9ab2b6e,Iebe50933,Id6fac253,Ia6becf30,I2af8b0ac

* changes:
  Use absolute paths for file:// URIs in tests
  Use getPath() in FileResolverTest
  Extract protocol constants to a common class
  Move repeat() to utility class for tests
  Remove hardcoded target/trash from test cases
  Remove dependency on StatusCommandTest
  Remove dependency on DiffFormatterReflowTest
  Remove unnecessary import of BaseConnection in MessageWriter

11 years agoAdd additional RebaseResult for editing commits 43/17643/5
Stefan Lay [Tue, 22 Oct 2013 14:01:18 +0000 (16:01 +0200)]
Add additional RebaseResult for editing commits

With the new RebaseResult.EDIT a client can now distinguish if rebase
stopped due to a conflict or because the commit was marked for edit in
an interactive rebase.

Change-Id: I40f2311cf43ed5f290dcda65a7bd85ba770a85f5
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
11 years agoAdd Squash/Fixup support for rebase interactive in RebaseCommand 93/15293/11
Tobias Pfeifer [Wed, 7 Aug 2013 12:18:23 +0000 (14:18 +0200)]
Add Squash/Fixup support for rebase interactive in RebaseCommand

The rebase command now supports squash and fixup. Both actions are not
allowed as the first step of the rebase.

In JGit, before any rebase step is performed, the next commit is
already cherry-picked. This commit keeps that behaviour. In case of
squash or fixup a soft reset to the parent is perfomed afterwards.

CQ: 7684
Bug: 396510
Change-Id: I3c4190940b4d7f19860e223d647fc78705e57203
Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de>
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Declare that org.eclipse.jgit.transport uses com.jcraft.jsch"
Matthias Sohn [Tue, 5 Nov 2013 16:53:17 +0000 (11:53 -0500)]
Merge "Declare that org.eclipse.jgit.transport uses com.jcraft.jsch"

11 years agoDeclare that org.eclipse.jgit.transport uses com.jcraft.jsch 70/18070/1
Matthias Sohn [Tue, 5 Nov 2013 09:39:10 +0000 (10:39 +0100)]
Declare that org.eclipse.jgit.transport uses com.jcraft.jsch

This should prevent class cast problems caused by jgit and egit bundles
wiring to different versions of com.jcraft.jsch.

Bug: 420903
Change-Id: Icabe40209ea07369e2b7eee31952d131aef3fbf1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAlso use MockSystemReader in GitDateParserBadlyFormattedTest 66/18066/1
Matthias Sohn [Tue, 5 Nov 2013 08:29:13 +0000 (09:29 +0100)]
Also use MockSystemReader in GitDateParserBadlyFormattedTest

All tests should use MockSystemReader to isolate them from the
underlying platform specifics.

GitDateParserBadlyFormattedTest wasn't using MockSystemReader which
induced Bug 420772 as a side effect since GitDateParser caches
SimpleDateFormat instances without regarding their locale. This will be
fixed in another change

Bug: 420772
Change-Id: I798e55d05730a71bb0326f80aea5488541d6c1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "testMaliciousPathEmpty fails on Windows"
Christian Halstrick [Mon, 4 Nov 2013 12:39:43 +0000 (07:39 -0500)]
Merge "testMaliciousPathEmpty fails on Windows"

11 years agoMerge "Revert "Close unfinished archive entries on error""
Dave Borowitz [Sat, 2 Nov 2013 03:12:29 +0000 (23:12 -0400)]
Merge "Revert "Close unfinished archive entries on error""

11 years agoUse absolute paths for file:// URIs in tests 89/17989/1
Shawn Pearce [Fri, 1 Nov 2013 14:59:57 +0000 (15:59 +0100)]
Use absolute paths for file:// URIs in tests

When run under Buck the repository paths may be relative.  Request
an absolute path to construct the URI, as relative paths are not
supported in file:// style URIs.

Change-Id: I85470d1db2f4e80cba30f1559c0d99bdfa8ac410

11 years agoUse getPath() in FileResolverTest 88/17988/1
Shawn Pearce [Fri, 1 Nov 2013 13:52:04 +0000 (14:52 +0100)]
Use getPath() in FileResolverTest

Necessary to get tests to pass when running under Buck.
Has no impact on Maven based invocation of tests.

Change-Id: I437114863df0bac346c94ef13796def47333d916

11 years agoExtract protocol constants to a common class 87/17987/1
Shawn Pearce [Fri, 1 Nov 2013 20:14:25 +0000 (14:14 -0600)]
Extract protocol constants to a common class

This avoids the server from referencing the client code directly.

Change-Id: Ie6ade781b5a689646ad8b0b2988ef2b544412195

11 years agoMove repeat() to utility class for tests 86/17986/1
Shawn Pearce [Fri, 1 Nov 2013 17:14:14 +0000 (11:14 -0600)]
Move repeat() to utility class for tests

Avoid depending on AutoCRLFOutputStreamTest from within another
test such as AutoCRLFInputStreamTest. Breaking the dependency up
allows the test classes to be built and executed in parallel.

Change-Id: Ic9ab2b6ec74ac87ff4adda8a802ae343dd2a6235

11 years agoRemove hardcoded target/trash from test cases 85/17985/1
Shawn Pearce [Fri, 1 Nov 2013 15:04:44 +0000 (16:04 +0100)]
Remove hardcoded target/trash from test cases

Buck does not create a target directory for the build output, this
is Maven specific and the project unit tests should not rely on it.

Instead follow the pattern used by org.eclipse.jgit.test which is to
create a temporary directory in the system temporary folder, and
configure the Maven surefire plugin to use the target directory.

Change-Id: Iebe5093332343a90f51080614e083aac0d29c26d

11 years agoRemove dependency on StatusCommandTest 84/17984/1
Shawn Pearce [Fri, 1 Nov 2013 17:19:20 +0000 (11:19 -0600)]
Remove dependency on StatusCommandTest

Move the set constructor function to a Sets utility class,
allowing the tests to compile in parallel.

Change-Id: Id6fac2533fab8d423f949c892f199af2491a450b

11 years agoRemove dependency on DiffFormatterReflowTest 83/17983/1
Shawn Pearce [Fri, 1 Nov 2013 17:10:55 +0000 (11:10 -0600)]
Remove dependency on DiffFormatterReflowTest

Reference the resource from the root of the CLASSPATH, allowing the
test classes to be compiled in parallel with no dependencies.

Change-Id: Ia6becf30ccfe93b8585b82293d9a4863b0cf837e

11 years agoRemove unnecessary import of BaseConnection in MessageWriter 82/17982/1
Shawn Pearce [Fri, 1 Nov 2013 18:57:30 +0000 (12:57 -0600)]
Remove unnecessary import of BaseConnection in MessageWriter

Change-Id: I2af8b0ac0f9fbf2814eca23990ae527baf040539

11 years agoEnable to prepare interactive rebase and then start it explicitly 55/16755/6
Tobias Pfeifer [Thu, 11 Jul 2013 09:09:30 +0000 (11:09 +0200)]
Enable to prepare interactive rebase and then start it explicitly

Add Operation.PROCESS_STEPS to RebaseCommand to enable starting
interactive rebase explicitly after rebase steps have been configured.

Change-Id: I2d6f0de82010ea6523fbce6fb4501e847bdcdddc
Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agotestMaliciousPathEmpty fails on Windows 63/17963/1
Robin Rosenberg [Fri, 1 Nov 2013 15:43:46 +0000 (16:43 +0100)]
testMaliciousPathEmpty fails on Windows

Checking of spaces at the end of the file name caused the
test to fail for Windows only.

Bug: 396662
Change-Id: I47bcccb0fa32ce606276c3f30d454851d115ca11
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
11 years agoParse commitId and shortMessage of a commented out line in rebase todo 29/15129/4
Tobias Pfeifer [Mon, 5 Aug 2013 10:54:23 +0000 (12:54 +0200)]
Parse commitId and shortMessage of a commented out line in rebase todo

A rebase todo file consists of regular non-comment action lines and
comment lines. In case that a regular action line has been commented out
(i.e. prefixed with a hash '#'), the RebaseTodoLine that is representing
this line should hold the values for commitId and shortMessage even
though it's a comment line. This allows to switch between comment and
non-comment easily even after the file has been persisted and reread.

Change-Id: I56ec2ba08eaf3772e2d74d937dd496209a744d4b
Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoEnhance reading of git-rebase-todo formatted files 07/15007/10
Christian Halstrick [Tue, 30 Jul 2013 12:00:18 +0000 (14:00 +0200)]
Enhance reading of git-rebase-todo formatted files

Reading and writing files formatted like the git-rebase-todo files was
hidden in the RebaseCommand. Certain constructs (like leading tabs and
spaces) have not been handled as in native git. Also the upcoming
rebase interactive feature in EGit needs reading/writing these files
independently from a RebaseCommand.

Therefore reading and writing those files has been moved to the
Repository class. RebaseCommand gets smaller because of that and doesn't
have to deal with reading/writing files.

Additional tests for empty todo-list files, or files containing comments
have been added.

Change-Id: I323f3619952fecdf28ddf50139a88e0bea34f5ba
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Also-by: Tobias Pfeifer <to.pfeifer@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoEnhance RepositoryTestCase.commitFile() to work on empty repository 18/17618/2
Matthias Sohn [Sun, 20 Oct 2013 23:22:08 +0000 (01:22 +0200)]
Enhance RepositoryTestCase.commitFile() to work on empty repository

Change-Id: Ic64497f0eedf8996ba593ca52dc9a040732a5b24
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Add missing resources from source.. in build.properties"
Matthias Sohn [Wed, 30 Oct 2013 22:21:28 +0000 (18:21 -0400)]
Merge "Add missing resources from source.. in build.properties"

11 years agoRemove protobuf from target platform 87/17887/2
Matthias Sohn [Wed, 30 Oct 2013 14:01:01 +0000 (15:01 +0100)]
Remove protobuf from target platform

Change-Id: Ic160a021c376f02c8a839a766c69a0558f2a361e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing resources from source.. in build.properties 43/12543/5
Tomasz Zarna [Mon, 6 May 2013 17:24:28 +0000 (19:24 +0200)]
Add missing resources from source.. in build.properties

Change-Id: Ief9b84c07494bdb01ce16b4ae3353c5364cc6625
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
11 years agoSupport extension of TransportHttp 58/15858/2
Michael Nelson [Mon, 26 Aug 2013 16:35:48 +0000 (09:35 -0700)]
Support extension of TransportHttp

This allows subclasses to configure the HTTP connection (for example,
to add headers to the request).

Bug: 400724
Change-Id: I6f9d699e158a7b9d813c8fa8d273992a28994e41
Signed-off-by: Michael Nelson <michael.nelson@tasktop.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoCLI fetch command should support --tags 33/17433/2
Kaloyan Raev [Fri, 11 Oct 2013 08:44:53 +0000 (11:44 +0300)]
CLI fetch command should support --tags

Bug: 419638
Change-Id: I1dc99fd38e678e091a1d141d741328f0dec1756a
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
11 years agoAdd missing JUnit dependency in MANFEST.MF 33/17633/2
Rüdiger Herrmann [Tue, 22 Oct 2013 08:59:37 +0000 (10:59 +0200)]
Add missing JUnit dependency in MANFEST.MF

Bug: 419998
Change-Id: Ie49ad97cb86d51274251296cee559141bfdb9fc9
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd / fix @since tags 19/17719/1
Matthias Sohn [Thu, 24 Oct 2013 06:32:47 +0000 (08:32 +0200)]
Add / fix @since tags

Change-Id: I1e5bea968b3c79df4f600b75fde5b547ebadde36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMake sure SystemReader is reset after test is run 16/17616/1
Robin Stocker [Mon, 21 Oct 2013 22:37:56 +0000 (00:37 +0200)]
Make sure SystemReader is reset after test is run

Otherwise the MockSystemReader from the test setup is active for other
tests.

Change-Id: I7caf693bd692d06936e29efd4dc4aabb48c1c39b
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoMerge "Add describe command to JGit command line interface"
Robin Rosenberg [Sun, 20 Oct 2013 16:31:25 +0000 (12:31 -0400)]
Merge "Add describe command to JGit command line interface"

11 years agoMerge "Fix failed tests when the tmp directory is a symlink"
Matthias Sohn [Sat, 19 Oct 2013 22:14:46 +0000 (18:14 -0400)]
Merge "Fix failed tests when the tmp directory is a symlink"

11 years agoFix failed tests when the tmp directory is a symlink 45/17145/3
Robin Rosenberg [Tue, 8 Oct 2013 08:35:39 +0000 (10:35 +0200)]
Fix failed tests when the tmp directory is a symlink

On Mac OS X /tmp is by default a symbolic link.

Change-Id: I0913ee5ee8db5c5918a9e41abbbfe125b6c70783
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge changes I5a5a2387,I04805ce2
Robin Rosenberg [Sat, 19 Oct 2013 13:55:58 +0000 (09:55 -0400)]
Merge changes I5a5a2387,I04805ce2

* changes:
  Describe HEAD if no explicit target was set
  Allow to set target of DescribeCommand

11 years agoScripts to publish jgit artifacts on Maven central 66/14466/3
Matthias Sohn [Wed, 10 Jul 2013 22:20:09 +0000 (00:20 +0200)]
Scripts to publish jgit artifacts on Maven central

- you need an account on oss.sonatype.org and permissions for group id
  org.eclipse.jgit, see [1]
- install ruby [2] if necessary
- run download.rb to download the Maven artifacts from repo.eclipse.org
- then run deploy.rb to stage the artifacts on oss.sonatype.org
- follow [3] to close the staging repository which triggers some sanity
checks on Nexus
- ask community to test artifacts from staging repository
- if tests are ok release the staging repository as described in [4]

[1] https://issues.sonatype.org/browse/OSSRH-2758
[2] https://www.ruby-lang.org/en/downloads/
[3]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7b.StageExistingArtifacts
[4]
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8a.ReleaseIt

Change-Id: I830f2392b9234e585b01dbb4a5a369edd88796a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoCLI version command falls back to Bundle-Version 37/17237/4
Kaloyan Raev [Wed, 9 Oct 2013 19:40:48 +0000 (22:40 +0300)]
CLI version command falls back to Bundle-Version

If the version command cannot read the Implementation-Version of the
containing JAR fall back to read the Bundle-Version header in
MANIFEST.MF. This makes the command working also from the
org.eclipse.jgit.pgm bundle and during development in a host IDE.

Bug: 419087
Change-Id: I4269d1cbd9bf9fd8be6fb4463aecc1c434aa387b
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd describe command to JGit command line interface 86/17286/3
Matthias Sohn [Thu, 10 Oct 2013 16:40:42 +0000 (18:40 +0200)]
Add describe command to JGit command line interface

Change-Id: I1560fd2be417361b3d2df15a27618053031bd873
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDescribe HEAD if no explicit target was set 85/17285/2
Matthias Sohn [Thu, 10 Oct 2013 21:01:30 +0000 (23:01 +0200)]
Describe HEAD if no explicit target was set

Change-Id: I5a5a238709df813ec07278bb3b4f9ea5c85c0883
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAllow to set target of DescribeCommand 84/17284/2
Matthias Sohn [Thu, 10 Oct 2013 16:32:03 +0000 (18:32 +0200)]
Allow to set target of DescribeCommand

Change-Id: I04805ce20cc203f5e491406c39b71e7017553b37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoList all supported formats in archive command's help 83/17283/1
Matthias Sohn [Thu, 10 Oct 2013 15:53:09 +0000 (17:53 +0200)]
List all supported formats in archive command's help

Change-Id: I4bd271cb348914642069239853488f4960444746
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Add support for --version in JGit CLI"
Robin Stocker [Thu, 10 Oct 2013 11:53:57 +0000 (07:53 -0400)]
Merge "Add support for --version in JGit CLI"

11 years agoAdd resources/ as source folder in build.properties 38/17238/2
Kaloyan Raev [Wed, 9 Oct 2013 13:58:29 +0000 (16:58 +0300)]
Add resources/ as source folder in build.properties

This allows correct export of org.eclipse.jgit.pgm via the PDE Export
wizard.

Bug: 419089
Change-Id: I98765208edd7df59e262001dd01ed2b43e4475a9
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
11 years agoAdd support for --version in JGit CLI 30/17230/1
Kaloyan Raev [Wed, 9 Oct 2013 10:52:47 +0000 (13:52 +0300)]
Add support for --version in JGit CLI

Bug: 419000
Change-Id: I43f5267182ea69d1f9abbff33136e0491c629071
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
11 years agoFix ServiceMayNotContinueException constructors for Java 1.5 76/17176/1
Colby Ranger [Tue, 8 Oct 2013 17:16:45 +0000 (10:16 -0700)]
Fix ServiceMayNotContinueException constructors for Java 1.5

IOException did not add a (String, Throwable) constructor until 1.5.
Instead use the String super constructor and initCause to initialize
the exception.

Fixes bug 418889

Change-Id: Ide735ecfc7d04884981b79b57a4275863ce17006

11 years agoAdd constructors that take Throwable to ServiceMayNotContinueException. 35/17135/4
Colby Ranger [Mon, 7 Oct 2013 21:14:01 +0000 (14:14 -0700)]
Add constructors that take Throwable to ServiceMayNotContinueException.

ServiceMayNotContinueException usually wraps an underlying exception.
Add convenience constructors that take Throwable. In the case a
string is not provided, the message defaults to "internal server error",
since it may be reported to the client.

Change-Id: I15dc20306826c352f69e88afb7ed6927c12b6c1f

11 years agoPropagate IOException where possible when getting refs. 22/17122/2
Colby Ranger [Mon, 7 Oct 2013 17:25:28 +0000 (10:25 -0700)]
Propagate IOException where possible when getting refs.

Currently, Repository.getAllRefs() and Repository.getTags() silently
ignores an IOException and instead returns an empty map. Repository
is a public API and as such cannot be changed until the next major
revision change. Where possible, update the internal jgit APIs to
use the RefDatabase directly, since it propagates the error.

Change-Id: I4e4537d8bd0fa772f388262684c5c4ca1929dc4c

11 years agoPrepare 3.2.0-SNAPSHOT builds 02/17002/2
Matthias Sohn [Thu, 3 Oct 2013 15:40:22 +0000 (17:40 +0200)]
Prepare 3.2.0-SNAPSHOT builds

Change-Id: Iac6cf7a5bb6146ee3fe38abe8020fc3fc4217584
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-3.1' 01/17001/1
Matthias Sohn [Thu, 3 Oct 2013 15:39:03 +0000 (17:39 +0200)]
Merge branch 'stable-3.1'

* stable-3.1:
  Prepare post 3.1.0 builds
  JGit v3.1.0.201310021548-r
  Fix order of commits in rebase todo file header
  Prepare post 3.1.0 RC1 builds
  JGit v3.1.0.201309270735-rc1
  Attempt to fix graph layout when new heads are introduced
  Prepare re-signing pgm's ueberjar to avoid SecurityException
  Use full branch name when getting ref in BranchTrackingStatus

Change-Id: Ida30175d0c058048cbe4b563aae7f85cd008db29
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.1.0 builds 99/16999/1 stable-3.1
Matthias Sohn [Thu, 3 Oct 2013 15:22:08 +0000 (17:22 +0200)]
Prepare post 3.1.0 builds

Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.1.0.201310021548-r 72/16972/1 v3.1.0.201310021548-r
Matthias Sohn [Wed, 2 Oct 2013 20:09:19 +0000 (22:09 +0200)]
JGit v3.1.0.201310021548-r

Change-Id: I2170b13047d5eab7565f47f9feb1680e03b1ba09
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Added the git-describe implementation"
Matthias Sohn [Wed, 2 Oct 2013 19:45:22 +0000 (15:45 -0400)]
Merge "Added the git-describe implementation"

11 years agoFix order of commits in rebase todo file header 25/16825/2
Stefan Lay [Fri, 27 Sep 2013 08:55:56 +0000 (10:55 +0200)]
Fix order of commits in rebase todo file header

Change-Id: I0e41d89bbd4fc01ad3b3d05a45ee60af853bfae7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.1.0 RC1 builds 40/16840/1
Matthias Sohn [Fri, 27 Sep 2013 13:54:08 +0000 (15:54 +0200)]
Prepare post 3.1.0 RC1 builds

Change-Id: I060f2082ccd0c91905b6b29a49cc633a0b51a1f2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.1.0.201309270735-rc1 30/16830/1 v3.1.0.201309270735-rc1
Matthias Sohn [Fri, 27 Sep 2013 11:34:51 +0000 (13:34 +0200)]
JGit v3.1.0.201309270735-rc1

Change-Id: I48202dd461110da25f9bc159c938311fff0669e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdded the git-describe implementation 71/14871/10
Kohsuke Kawaguchi [Thu, 25 Jul 2013 17:42:22 +0000 (10:42 -0700)]
Added the git-describe implementation

CQ: 7609
Bug: 339246
Change-Id: I689bc0578ce3a430b9800ad84122e221c69829f4
Signed-off-by: Kohsuke Kawaguchi <kk@kohsuke.org>
Also-By: Robin Stocker<robin@nibor.org>
Also-By: Matthias Sohn <matthias.sohn@sap.com>
Also-By: Christian Halstrick <christian.halstrick@sap.com>
11 years agoAttempt to fix graph layout when new heads are introduced 92/16792/1
Robin Rosenberg [Sun, 17 Mar 2013 20:01:24 +0000 (21:01 +0100)]
Attempt to fix graph layout when new heads are introduced

Sometime the new commit is no allocated onto a new lane leading to
the commit being drawn on the wrong branch and something that looks
like a merge.

The drawback is that this also changes existing valid graphs.

Bug: 368927
Change-Id: Ic8a8247c8a53be802c1be83850ed766b902ca646

11 years agoPrepare re-signing pgm's ueberjar to avoid SecurityException 11/16711/2
Matthias Sohn [Tue, 24 Sep 2013 07:11:47 +0000 (09:11 +0200)]
Prepare re-signing pgm's ueberjar to avoid SecurityException

Since we now sign all build artifacts immediately after creating them
we need to re-sign the ueberjar created for jgit command line tool
because the signatures of the individual jars are invalidated when
repacking them into the ueberjar. Hence we need to exclude the
signatures of the individual jars when using maven-shade-plugin to
create the ueberjar.

Also install the shaded plugin into maven repository and exclude osgi
framework sources which were included unintentionally.

See http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02277.html

Change-Id: Ia302e68a4b2a9399cb18025274574e31d3d3e407
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRevert "Close unfinished archive entries on error" 10/16710/1
Jonathan Nieder [Tue, 24 Sep 2013 00:35:15 +0000 (17:35 -0700)]
Revert "Close unfinished archive entries on error"

This reverts commit 75d9b31f14d6226a535a80c05cffda29e55d2ceb.
Now that we do not try to close the ArchiveOutputStream in the error
path, there is no need to artificially close partial entries from
before the error.

Change-Id: I1f1cb08ec4e9b14c79bf4621f3fa959463034b82
Signed-off-by: Jonathan Nieder <jrn@google.com>
11 years agoDo not close ArchiveOutputStream on error 09/16709/4
Jonathan Nieder [Tue, 24 Sep 2013 00:06:18 +0000 (17:06 -0700)]
Do not close ArchiveOutputStream on error

If we encounter an I/O error while writing an archive (for example due
to the reader of an HTTP stream closing the connection), the result is
an archive with unclosed entries, causing
TarArchiveOutputStream.finish() to throw IOException("This archives
contains unclosed entries"), hiding the IOException that caused the
early termination.

The unclosed entries are fine: the same exception that occured in the
first place will probably prevent closing the entries before finishing
this partial archive that should be discarded anyway.

It would be nicer to call TarArchiveOutputStream.finish and leave the
underlying OutputStream unclosed --- all callers close it already ---
but that would be a more invasive change so we hold off for now.

Change-Id: I328ced19aa8a1888e5353cdbb6106a85fd72d5d7
Signed-off-by: Jonathan Nieder <jrn@google.com>
11 years agoUse full branch name when getting ref in BranchTrackingStatus 80/16580/2
Robin Stocker [Sun, 15 Sep 2013 21:26:35 +0000 (23:26 +0200)]
Use full branch name when getting ref in BranchTrackingStatus

In case there is both a tag and branch called "foo", the tag is returned
if calling getRef with the short name. By using refs/heads/foo, the
branch is returned.

Bug: 417158
Change-Id: I86b4f83955586bb24774fd621f5012499cf67909
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoIgnore bitmap indexes that do not match the pack checksum 18/16618/4
Colby Ranger [Thu, 19 Sep 2013 21:33:13 +0000 (14:33 -0700)]
Ignore bitmap indexes that do not match the pack checksum

If `git gc` creates a new pack with the same file name, the
pack checksum may not match that in the .bitmap. Fix the PackFile
implementaion to silently ignore invalid bitmap indexes.

Fixes Issue https://code.google.com/p/gerrit/issues/detail?id=2131

Change-Id: I378673c00de32385ba90f4b639cb812f9574a216

11 years agoMerge branch 'stable-3.0' 03/16503/1
Matthias Sohn [Tue, 17 Sep 2013 13:08:55 +0000 (15:08 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  JGit v3.0.3.201309161630-r
  Add org.eclipse.jgit.java7.source to jgit source feature

Change-Id: I738afcfbc78ea1ac56d0d0ab7d4f7717167dd8dd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.3.201309161630-r 83/16483/1 stable-3.0 v3.0.3.201309161630-r
Matthias Sohn [Mon, 16 Sep 2013 20:29:58 +0000 (22:29 +0200)]
JGit v3.0.3.201309161630-r

Change-Id: I73ff609ba681500394b5919f62cff9ec24a52756
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoRemove unneeded packs when compacting with no new objects
Colby Ranger [Mon, 16 Sep 2013 18:56:02 +0000 (11:56 -0700)]
Remove unneeded packs when compacting with no new objects

Previously, the DfsPackCompactor exited without pruning the existing
packs, when no new packs were created.

Change-Id: I5e3b6f8c789706c7a982e6ae93cf7c3d4346797c

11 years agoAdd org.eclipse.jgit.java7.source to jgit source feature 57/16457/1
Matthias Sohn [Mon, 16 Sep 2013 09:19:43 +0000 (11:19 +0200)]
Add org.eclipse.jgit.java7.source to jgit source feature

Change-Id: Ifd9153f77c246a67d5d15734667dc2360718a390
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoResetCommand: Allow reset on unborn branch when ref not specified 64/15364/3
Robin Stocker [Mon, 12 Aug 2013 13:13:03 +0000 (15:13 +0200)]
ResetCommand: Allow reset on unborn branch when ref not specified

In C Git 1.8.2, "git reset" now also works on an unborn branch (no HEAD
yet) if no explicit ref was specified. In that case, it is treated as a
reset to an empty tree.

This can be useful for callers because "unborn branch" no longer has to
be special-cased to "git rm --cached".

Bug: 414870
Change-Id: Ied750116f767518ae4d48823cf00752b049a8477
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge branch 'stable-3.0' 47/16347/1
Matthias Sohn [Wed, 11 Sep 2013 21:14:42 +0000 (23:14 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.2 builds
  JGit v3.0.2.201311090911-r

Change-Id: I99a7d1072285646f7fcd4169225c1fd249ad5e37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoPrepare post 3.0.2 builds 31/16331/1
Matthias Sohn [Wed, 11 Sep 2013 14:51:47 +0000 (16:51 +0200)]
Prepare post 3.0.2 builds

Change-Id: Ie1bd951a2cb35d069c94dab4a62507115913764f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.0.2.201311090911-r 18/16318/1 v3.0.2.201311090911-r
Matthias Sohn [Wed, 11 Sep 2013 13:15:00 +0000 (15:15 +0200)]
JGit v3.0.2.201311090911-r

Change-Id: Ifaae2e3e2f1bb0504bf9e6d59983086ac19a540b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoDon't treat "/" as valid ignore pattern 55/15955/2
Robin Stocker [Wed, 28 Aug 2013 20:57:37 +0000 (22:57 +0200)]
Don't treat "/" as valid ignore pattern

This matches the behavior of C Git.

Bug: 415767
Change-Id: Ifa6500f3f6a033da40c48287630b77c47b15f4a0
Signed-off-by: Robin Stocker <robin@nibor.org>
11 years agoMerge "Add missing usage texts for JGit commandline commands"
Matthias Sohn [Mon, 9 Sep 2013 21:04:58 +0000 (17:04 -0400)]
Merge "Add missing usage texts for JGit commandline commands"

11 years agoAdd missing usage texts for JGit commandline commands 99/13999/5
Matthias Sohn [Sat, 22 Jun 2013 00:19:08 +0000 (02:19 +0200)]
Add missing usage texts for JGit commandline commands

Also update help text for the merge command now supporting recursive
strategy as the default merge strategy.

Change-Id: I07886fe875c407e2244f562c003bb9d04f398026
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoAdd missing dependency for testing ArchiveCommand with xz compression 12/16212/1
Matthias Sohn [Mon, 26 Aug 2013 14:38:42 +0000 (16:38 +0200)]
Add missing dependency for testing ArchiveCommand with xz compression

Without this dependency the ArchiveTest.testTxzExtension() fails with a
ClassNotFoundException if it is started from Eclipse.

Change-Id: Ief2fceaaffab7641ba63ace4577462fa3bbf1c13
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoMerge "Remove unnecessary inflate stride in DfsBlock"
Shawn Pearce [Wed, 4 Sep 2013 23:13:55 +0000 (19:13 -0400)]
Merge "Remove unnecessary inflate stride in DfsBlock"

11 years agoRemove unnecessary inflate stride in DfsBlock 36/16136/3
Shawn Pearce [Wed, 4 Sep 2013 19:56:38 +0000 (12:56 -0700)]
Remove unnecessary inflate stride in DfsBlock

OpenJDK 7 does not benefit from using an inflate stride on the input
array. The implementation of java.util.zip.Inflater supplies the
entire input byte[] to libz, with no regards for the bounds supplied.
Slicing at 512 byte increments in DfsBlock no longer has any benefit.

In OpenJDK 6 the native portion of Inflater used GetByteArrayRegion
to obtain a copy of the input buffer for libz. In this use case
supplying a small stride made sense, it avoided allocating space
for and copying data past the end of the object's compressed stream.

In OpenJDK 7 the native code uses GetPrimitiveArrayCritical,
which tries to avoid copying by freezing Java garbage collection
and accessing the byte[] contents in place. On OpenJDK 7 derived
JVMs it is likely more efficient to supply the entire DfsBlock.

Since OpenJDK 5 and 6 are deprecated and replaced by OpenJDK 7
it is reasonable to suggest any consumers running JGit with DFS
support use an OpenJDK 7 derived JVM. However, JGit still targets
local filesystem support on Java 5, so it is still not reasonble to
apply this same simplification to the internal.storage.file package.

See: JDK-6751338 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6751338)
Change-Id: Ib248b6d383da5c8aa887d9c355a0df6f3e2247a5

11 years agoMerge branch 'stable-3.0' 38/16138/1
Matthias Sohn [Wed, 4 Sep 2013 20:45:53 +0000 (22:45 +0200)]
Merge branch 'stable-3.0'

* stable-3.0:
  Prepare post 3.0.2-rc2 builds
  JGit v3.0.2.201309041250-rc2
  Uncomment eclipse-jar-signer plugin
  Update build to use CBI jarsigner plugin
  Update maven plugins
  Update to Orbit Kepler SR1 release R20130827064939

Change-Id: Iaa8bba21c300dd1de2b91a77cddf6727fbc66340
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>