]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoAdd missing @since tags for new public methods in Config 73/19673/2
Matthias Sohn [Tue, 10 Dec 2013 17:17:34 +0000 (18:17 +0100)]
Add missing @since tags for new public methods in Config

Change-Id: I3b7937577c897a7e298ee431bd8c052cdb293dd9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoDon't use API exception in RebaseTodoLine 98/19598/3
Christian Halstrick [Tue, 10 Dec 2013 10:06:10 +0000 (11:06 +0100)]
Don't use API exception in RebaseTodoLine

This came up while testing the proposed buck build for jgit. With buck
we can introduce smaller modules to allow for more concurrency during
build and to better control inner structure of jgit. Trying to put the
porcelain API into a different module than lower level implementation
classes failed since RebaseTodoLine used a porcelain API exception
causing a dependency cycle on the proposed modules. Using an exception
defined on the same abstraction level fixes this problem.

Change-Id: I26a5353e1a8fc23e67d8ce61309bd964f7665bcb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
10 years agoMerge "Fix aborting rebase with detached head" into stable-3.2
Robin Rosenberg [Tue, 10 Dec 2013 21:15:55 +0000 (16:15 -0500)]
Merge "Fix aborting rebase with detached head" into stable-3.2

10 years agoFix aborting rebase with detached head 86/19586/1
Stefan Lay [Tue, 10 Dec 2013 14:54:48 +0000 (15:54 +0100)]
Fix aborting rebase with detached head

Bug: 423670
Change-Id: Ia6052867f85d4974c4f60ee5a6c820501e8d2427

10 years agoAdd recursive variant of Config.getNames() methods 29/19429/1
Matthias Sohn [Sun, 1 Dec 2013 00:19:35 +0000 (01:19 +0100)]
Add recursive variant of Config.getNames() methods

These methods allow to find all configuration entry names for a given
section or section/subsection searching recursively through all base
configurations of the given configuration.

These methods are needed to calculate the names for the effective
configuration of a git repository which combines the configuration entry
names found in the repository, global and system configuration files

Bug: 396659
Change-Id: Ie3731b5e877f8686aadad3f1a46b2e583ad3b7c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge branch 'master' into stable-3.2 49/19349/1
Matthias Sohn [Wed, 4 Dec 2013 23:14:08 +0000 (00:14 +0100)]
Merge branch 'master' into stable-3.2

* master:
  Implement rebase.autostash
  CLI status should support --porcelain
  More helpful InvalidPathException messages (include reason)
  Fix IgnoreRule#isMatch returning wrong result due to missing reset
  Fix exception on conflicts with recursive merge
  Add pgm test for checkout of existing branch with checkout conflict
  Fix broken symbolic links on Cygwin.
  Do not allow non-ff-rebase if there are uncommitted changes
  Manage CheckoutConflictException in pgm
  Fix handling of file/folder conflicts during a checkout
  Mention null return in Javadoc of Config#getString
  Fix applying stash on other commit
  Use static factory methods instead of overloaded constructors
  Break up GCTest to run in parallel
  Modify T0004_PackReaderTest to use existing pack
  Move SampleDataRepositoryTestCase to org.eclipse.jgit.test
  Support running from JARs in JGitTestUtil
  Cache SimpleDateFormat in GitDateParser per locale
  Fix FIXUP error for blank lines in interactive rebase
  Fix parsing Rebase todo lines when commit message is missing
  Add close() method to API
  Update Jetty to 7.6.14.v20131031
  Document that path parameters should use '/' as separator
  Improve Javadoc for typeHint parameter
  Do not update the ref hot bit when checking isIndexLoaded
  Don't delete .idx file if .pack file can't be deleted

Change-Id: I02abfc09000d0fe9bdf4331c65bec7046f586179
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoImplement rebase.autostash 09/19209/4
Stefan Lay [Mon, 2 Dec 2013 16:24:09 +0000 (17:24 +0100)]
Implement rebase.autostash

This feature was introduced in native git with version 1.8.4.

Bug: 422951
Change-Id: I42f194174d64d7ada6631e2156c2a7bf93b5e91c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "CLI status should support --porcelain"
Matthias Sohn [Wed, 4 Dec 2013 14:26:16 +0000 (09:26 -0500)]
Merge "CLI status should support --porcelain"

10 years agoCLI status should support --porcelain 90/17590/3
Kaloyan Raev [Thu, 10 Oct 2013 20:08:14 +0000 (23:08 +0300)]
CLI status should support --porcelain

Add support for the machine-readable output format along with the
existing default long format.

Bug: 419968
Change-Id: I37fe5121b4c9dbae1106b1d18e9fdc134070a9dd
Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
10 years agoMerge "More helpful InvalidPathException messages (include reason)"
Christian Halstrick [Wed, 4 Dec 2013 08:23:56 +0000 (03:23 -0500)]
Merge "More helpful InvalidPathException messages (include reason)"

10 years agoMore helpful InvalidPathException messages (include reason) 12/15312/3
Robin Stocker [Sat, 10 Aug 2013 15:37:20 +0000 (17:37 +0200)]
More helpful InvalidPathException messages (include reason)

Instead of just a generic "Invalid path: $path", add a reason for the
cases where it's not obvious what the problem is (e.g. "aux" being
reserved on Windows).

Bug: 413915
Change-Id: Ia6436bd2560e4f049c92d9aac907cb87348605e0
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix IgnoreRule#isMatch returning wrong result due to missing reset 71/19271/1
Robin Stocker [Tue, 3 Dec 2013 21:25:40 +0000 (22:25 +0100)]
Fix IgnoreRule#isMatch returning wrong result due to missing reset

The matcher has to be reset before using it, as was already done in the
other cases.

Bug: 423039
Change-Id: I87abaa7ad7f0aac8651db6e88d41427cacb4d776
Also-by: Ondrej Vrabec <ovrabec@netbeans.org>
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix exception on conflicts with recursive merge 36/17436/3
Robin Stocker [Wed, 16 Oct 2013 21:51:24 +0000 (23:51 +0200)]
Fix exception on conflicts with recursive merge

When there are conflicts with a recursive merge, the conflicting paths
are stored in unmergedPaths (field in ResolveMerger). Later, when the
MergeResult is constructed in MergeCommand, getBaseCommit is called,
which computes the merge base a second time.

In case of RecursiveMerger, getBaseCommit merges the multiple merge
bases into one. It does this not by creating a new ResolveMerger but
instead calling mergeTrees. The problem with mergeTrees is that at the
end, it checks if unmergedPaths is non-empty and returns false in that
case.

Because unmergedPaths was already non-empty because of the real merge,
it thinks that there were conflicts when computing the merge base again,
when there really were none.

This can be fixed by storing the base commit when computing it and then
returning that instead of computing it a second time.

Note that another possible fix would be to just use a new ResolveMerger
for merging the merge bases instead. This would also remove the need to
remember the old value of dircache, inCore and workingTreeIterator (see
RecursiveMerger#getBaseCommit).

Bug: 419641
Change-Id: Ib2ebf4e177498c22a9098aa225e3cfcf16bbd958
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoAdd pgm test for checkout of existing branch with checkout conflict 59/19059/8
Axel Richard [Thu, 28 Nov 2013 13:14:32 +0000 (14:14 +0100)]
Add pgm test for checkout of existing branch with checkout conflict

Add a test that checks out an existing branch with a dirty working tree
and involves a checkout conflict. This test should pass with a message:
"error: Your local changes to the following files would be overwritten
by checkout: a".

Change-Id: I5428a04a7630d9e0101404ea1aedd796f127bd7d
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix broken symbolic links on Cygwin. 91/18691/2
John Ross [Thu, 21 Nov 2013 19:48:42 +0000 (13:48 -0600)]
Fix broken symbolic links on Cygwin.

Bad files from symbolic links were being generated on Cygwin and
required resolution by the appropriate FS. Pass FS to getSymRef and call
FS.resolve before asking if the file is absolute.

Bug: 419494
Change-Id: I74aa7a285954cade77f41df6f813b6dafb5d6cd7
Signed-off-by: John Ross <jwross@us.ibm.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoDo not allow non-ff-rebase if there are uncommitted changes 77/18977/7
Stefan Lay [Wed, 27 Nov 2013 10:01:47 +0000 (11:01 +0100)]
Do not allow non-ff-rebase if there are uncommitted changes

With this change jgit checks for uncommitted changes before a rebase is
started. This is also done by native git. One reason is that an abort
would override such changes. The check is skipped for a non-interactive
rebase when it will result in a fast-forward. In this case there can be
only checkout conflicts but no merge conflicts, so there cannot be an
abort which overrides uncommitted changes.

Bug: 422352
Change-Id: I1e0b59b2a4d80a686b67a6729e441924362b1236
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoManage CheckoutConflictException in pgm 00/19100/3
Axel Richard [Fri, 29 Nov 2013 10:06:11 +0000 (11:06 +0100)]
Manage CheckoutConflictException in pgm

Change-Id: I49f92bf7cafc80404f0bd07d62ff4b25e4db6e7c
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix handling of file/folder conflicts during a checkout 78/19078/3
Christian Halstrick [Thu, 28 Nov 2013 17:00:36 +0000 (18:00 +0100)]
Fix handling of file/folder conflicts during a checkout

JGit was not handling certain file/folder conflicts during a checkout
correctly. This was reported by Axel Richard in
http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg02358.html.
This commit fixes this problem.

Still JGit behaves intentionally different than native git.
If HEAD contains a tree, and workingtree, Index and Merge contain a file
with same content ... then JGit allows a conflict free checkout of
Merge. Native git always complains that it doesn't want to overwrite
local changes. But there is no need to update the working tree because
Index and Merge are already equal.

A shell script which shows how native git behaves can be found here.
https://gist.github.com/chalstrick/7694959#file-gistfile1-sh

Change-Id: Ifd6a68974d61cd4fa23bc575f3a40773db66cafc
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
10 years agoMention null return in Javadoc of Config#getString 31/19131/1
Robin Stocker [Fri, 29 Nov 2013 16:16:23 +0000 (17:16 +0100)]
Mention null return in Javadoc of Config#getString

Change-Id: Ibf09395fb3ac4d5d8f47872ed8f239c821bbee7a
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix applying stash on other commit 80/18980/3
Stefan Lay [Wed, 27 Nov 2013 16:10:39 +0000 (17:10 +0100)]
Fix applying stash on other commit

Applying a stash on another commit failed because the merge base for the
cherry-pick of the stashed index state was not corectly set.

Bug: 422684
Change-Id: I9355352b2b9a7abefa3248ca3c17a9301177d0d6
Signed-off-by: Stefan Lay <stefan.lay@sap.com>
10 years agoUse static factory methods instead of overloaded constructors 53/19053/2
Stefan Lay [Thu, 28 Nov 2013 10:18:16 +0000 (11:18 +0100)]
Use static factory methods instead of overloaded constructors

Change-Id: Ib10e0798dcfb9f1b611caec393926c95eff4c2a2

11 years agoBreak up GCTest to run in parallel 93/17993/2
Shawn Pearce [Fri, 1 Nov 2013 18:13:25 +0000 (12:13 -0600)]
Break up GCTest to run in parallel

Separate some sections of the GC tests into different test classes.
Individual classes permits running in parallel under Buck, reducing
test latency if there are sufficient CPUs available.

Change-Id: I5eb177f78efd4aa8ac857d0d8b1a1fd81ca07790

11 years agoModify T0004_PackReaderTest to use existing pack 92/17992/2
Shawn Pearce [Fri, 1 Nov 2013 17:32:04 +0000 (11:32 -0600)]
Modify T0004_PackReaderTest to use existing pack

Instead of making a new PackFile from a resource, lookup
the existing PackFile that was already created by the base
class SampleDataRepositoryTestCase.

Change-Id: Ib5da18c832ae0cb29703706b99e99503f5cc819d

11 years agoMove SampleDataRepositoryTestCase to org.eclipse.jgit.test 91/17991/2
Shawn Pearce [Fri, 1 Nov 2013 16:51:52 +0000 (10:51 -0600)]
Move SampleDataRepositoryTestCase to org.eclipse.jgit.test

This class requires resources which are private to another
bundle. Move the class next to its resources, removing an
odd cross bundle dependency.

Change-Id: I30d5568b09ea5fb3bd3bb60b602f149c0867f49a

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 agoPrepare post 3.2.0-m3 builds 57/18357/1
Matthias Sohn [Wed, 13 Nov 2013 21:53:50 +0000 (22:53 +0100)]
Prepare post 3.2.0-m3 builds

Change-Id: I6ef4aa758a6a5d465d4c460178ca3050b8a30449
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
11 years agoJGit v3.2.0.201311130903-m3 39/18339/1 v3.2.0.201311130903-m3
Matthias Sohn [Wed, 13 Nov 2013 14:04:05 +0000 (15:04 +0100)]
JGit v3.2.0.201311130903-m3

Change-Id: Icca089f4a60cc94123dc8bf61f7f76f501e08c4d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
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>