]> source.dussan.org Git - jgit.git/log
jgit.git
10 years agoAdd toString to Git with repository path 03/31803/1
Robin Stocker [Sun, 17 Aug 2014 07:48:05 +0000 (17:48 +1000)]
Add toString to Git with repository path

Useful for debugging.

Change-Id: I78b92ccbcc099370fc99a1d2fa2cf60d5f5892e6
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoResolveMerger: Use the ObjectReader to access objects 71/31771/3
Shawn Pearce [Fri, 15 Aug 2014 17:21:32 +0000 (10:21 -0700)]
ResolveMerger: Use the ObjectReader to access objects

This is necessary to ensure objects accessed by the TreeWalk come from
the associated ObjectInserter when the merger is a RecursiveMerger
instance and a virtual common base was constructed but not flushed.

Change-Id: Iebe739d30fd868ebc4f61dbfb714673146a2c3ec

10 years agoCleanup use of java.util.Inflater, fixing rare infinite loops 04/31604/4
Shawn Pearce [Wed, 13 Aug 2014 23:54:22 +0000 (16:54 -0700)]
Cleanup use of java.util.Inflater, fixing rare infinite loops

The native implementation of inflate() can set finished to return
true at the same time as it copies the last bytes into the buffer.

Check for finished on each iteration, terminating as soon as libz
knows the stream was completely inflated.

If not finished, it is likely input is required before the next
native call could do any useful work. Most invocations are passing
in a buffer large enough to store the entire result. A partial return
from inflate() will need more input before it can continue. Checking
right away that needsInput() is true saves a native call to determine
no bytes can be inflated without more input.

This should fix a rare infinite loop condition inside of inflation
when an object ends exactly at the end of a block boundary, and
the next block contains only the 20 byte trailing SHA-1.

When the stream is finished each new attempt to inflate() returns
n == 0, as no additional bytes were output. The needsInput() test
tries to add the length of the footer block to itself, but then loops
back around an reloads the same block as the block is smaller than
a full block size. A zero length input is set to the inflater,
which triggers needsInput() condition again.

Change-Id: I95d02bfeab4bf995a254d49166b4ae62d1f21346

10 years agoAdd missing @since 3.5 tag to RepoCommand.setIncludedFileReader 98/31598/1
Shawn Pearce [Wed, 13 Aug 2014 22:28:24 +0000 (15:28 -0700)]
Add missing @since 3.5 tag to RepoCommand.setIncludedFileReader

Change-Id: Ib5d24f8dafacc0d12c36927c2bbc3ebef2fff7b2

10 years agoAdd support to <include> tag in repo manifest xml. 50/31150/4
Yuxuan 'fishy' Wang [Thu, 7 Aug 2014 05:01:08 +0000 (22:01 -0700)]
Add support to <include> tag in repo manifest xml.

Change-Id: I32d468f92e24701ea680435bf3417e3850857303
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Tweak the handling of remote url in jgit repo."
Shawn Pearce [Wed, 13 Aug 2014 20:02:57 +0000 (16:02 -0400)]
Merge "Tweak the handling of remote url in jgit repo."

10 years agoRevert "Add a method to DfsOutputStream to read as an InputStream" 52/31552/1
Shawn Pearce [Wed, 13 Aug 2014 17:42:43 +0000 (10:42 -0700)]
Revert "Add a method to DfsOutputStream to read as an InputStream"

This reverts commit b646578d89513c5db30151f0b865c7335c88d682.

openInputStream() is never used in JGit, nor is it used by any
known working DFS implementation. The method was added as a
utility for reading back from a DfsInserter, but the final
implementation of that feature does not requrire this method.

Change-Id: I075ad95e40af49c92b554480f8993ef5658f7684

10 years agoAdd a Merger.merge method that makes flushing optional 04/12504/8
Dave Borowitz [Fri, 3 May 2013 18:45:36 +0000 (11:45 -0700)]
Add a Merger.merge method that makes flushing optional

This allows callers performing multiple separate merges to reuse a
single ObjectInserter without flushing the inserter on each iteration
(which can be slow in the DFS case).

Change-Id: Icaff7d2bc2c20c873ce5a7d9af5002da84ae1c2b

10 years agoTeach mergers to use ObjectInserter.newReader() 03/12503/10
Dave Borowitz [Fri, 3 May 2013 17:54:38 +0000 (10:54 -0700)]
Teach mergers to use ObjectInserter.newReader()

This allows the RecursiveMerger to iteratively create new merge bases
without necessarily flushing packs to storage in the DFS case;
flushing only need happen at the end of the whole merge process.

Since Merger's walk now depends on its inserter, we need to construct
an inserter at Merger construction time.  This should not be a
significant increase in overhead since unused inserters don't use any
resources (beyond a reference to the Repository).

We also must release and recreate the walk whenever setObjectInserter
is called, which can break usages where setObjectInserter is called in
the middle of stateful operations on the walk.  No usages of this
method within JGit currently do this; the inserter is only ever set
before any stateful walk operations happen.

Change-Id: I9682a6aa4a2c37dccef8e163f132ddb791d79103

10 years agoTweak the handling of remote url in jgit repo. 62/31562/1
Yuxuan 'fishy' Wang [Wed, 13 Aug 2014 17:36:56 +0000 (10:36 -0700)]
Tweak the handling of remote url in jgit repo.

This kind of reverted 31148. URI.resolve actually can handle the absolute URL
well, the problem is only the missing "/".

Change-Id: Iee5866c005cbc1430dc20ee7db321b8b51afed30
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoAdd a method to ObjectInserter to read back inserted objects 22/12422/11
Dave Borowitz [Wed, 1 May 2013 17:20:31 +0000 (10:20 -0700)]
Add a method to ObjectInserter to read back inserted objects

In the DFS implementation, flushing an inserter writes a new pack to
the storage system and is potentially very slow, but was the only way
to ensure previously-inserted objects were available.  For some tasks,
like performing a series of three-way merges, the total size of all
inserted objects may be small enough to avoid flushing the in-memory
buffered data.

DfsOutputStream already provides a read method to read back from the
not-yet-flushed data, so use this to provide an ObjectReader in the
DFS case.

In the file-backed case, objects are written out loosely on the fly,
so the implementation can just return the existing WindowCursor.

Change-Id: I454fdfb88f4d215e31b7da2b2a069853b197b3dd

10 years agoDfsInserter: buffer up to streamFileThreshold from InputStream 82/31482/3
Shawn Pearce [Tue, 12 Aug 2014 21:57:28 +0000 (14:57 -0700)]
DfsInserter: buffer up to streamFileThreshold from InputStream

Since 2badedcbe0f87c0a in-core merges can write up to 10 MiB
into a TemporaryBuffer.Heap strategy, where the data is stored
as a chain of byte[] blocks.

Support the inserter reading up to the streamFileThreshold (default 50
MiB) from the supplied input stream and hash the content to determine
if the merged result blob is already present in the repository.  This
allows the inserter to avoid creating duplicate objects in more cases,
reducing repository pack file churn.

Change-Id: I38967e2a0cff14c0a856cdb46a2c8fedbeb21ed5

10 years agoMerger: clarify getBaseCommit javadoc 02/12502/3
Dave Borowitz [Fri, 3 May 2013 17:21:50 +0000 (10:21 -0700)]
Merger: clarify getBaseCommit javadoc

Change-Id: Ic52475248a545d51d3d8ac31a24f0344a1241e45

10 years agoReuse Merger's ObjectReader from ResolveMerger 01/12501/7
Dave Borowitz [Wed, 1 May 2013 22:47:23 +0000 (15:47 -0700)]
Reuse Merger's ObjectReader from ResolveMerger

The base Merger class already has a single ObjectReader instance that
it handles releasing as necessary, so creating new readers is not
necessary.

Change-Id: I990ec43af7df448c7825fc1b10e62eadaa3e0c2a

10 years agoMerge "Fix CheckoutCommand not setting up tracking"
Robin Rosenberg [Mon, 11 Aug 2014 20:23:38 +0000 (16:23 -0400)]
Merge "Fix CheckoutCommand not setting up tracking"

10 years agoMerge "Process most in-core merges without local temp files"
Shawn Pearce [Mon, 11 Aug 2014 16:42:10 +0000 (12:42 -0400)]
Merge "Process most in-core merges without local temp files"

10 years agoMerge "Update tycho and signing plugins to latest versions"
Robin Rosenberg [Mon, 11 Aug 2014 15:26:21 +0000 (11:26 -0400)]
Merge "Update tycho and signing plugins to latest versions"

10 years agoMerge "Update maven plugins to latest versions"
Robin Rosenberg [Mon, 11 Aug 2014 15:25:57 +0000 (11:25 -0400)]
Merge "Update maven plugins to latest versions"

10 years agoUpdate tycho and signing plugins to latest versions 30/31330/3
Matthias Sohn [Fri, 8 Aug 2014 22:46:43 +0000 (00:46 +0200)]
Update tycho and signing plugins to latest versions

Change-Id: I3e8b3835b8ebbb8f0a2a9be42e6c16899cb3b993
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUpdate maven plugins to latest versions 29/31329/3
Matthias Sohn [Fri, 8 Aug 2014 22:44:21 +0000 (00:44 +0200)]
Update maven plugins to latest versions

Also, remove unused findbugs exclude filter in java7 bundle since latest
findbugs plugins raises an error on this.

Change-Id: I791fc054596e7d9aa9f3cc8126eb0162539c57bf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Remove redundant semicolon"
Robin Rosenberg [Sun, 10 Aug 2014 08:22:08 +0000 (04:22 -0400)]
Merge "Remove redundant semicolon"

10 years agoMerge "We should not warn for unqualifiedFieldAcces"
Robin Rosenberg [Sun, 10 Aug 2014 08:21:55 +0000 (04:21 -0400)]
Merge "We should not warn for unqualifiedFieldAcces"

10 years agoReplace deprecated method call in Java7 FTI test 46/29946/3
Robin Rosenberg [Tue, 15 Jul 2014 09:29:57 +0000 (11:29 +0200)]
Replace deprecated method call in Java7 FTI test

Change-Id: I3bbb6da951765d79d77aa955edeac7b5e4da5d8a

10 years agoWe should not warn for unqualifiedFieldAcces 43/29943/3
Robin Rosenberg [Tue, 15 Jul 2014 09:25:17 +0000 (11:25 +0200)]
We should not warn for unqualifiedFieldAcces

It does not make sense and I cannot explain why it slipped through.

Change-Id: I005a54cde545ea99553c0a2d6dd8d64e6e0a7611

10 years agoRemove redundant semicolon 45/29945/3
Robin Rosenberg [Tue, 15 Jul 2014 09:28:50 +0000 (11:28 +0200)]
Remove redundant semicolon

Change-Id: I15370d7807c82ee85ed7fdb05061a4baf0a77a68

10 years agoProcess most in-core merges without local temp files 36/31336/1
Shawn Pearce [Sat, 9 Aug 2014 00:53:49 +0000 (17:53 -0700)]
Process most in-core merges without local temp files

Instead of always writing to disk use TemporaryBuffer.LocalFile to
store up to 10 MiB of merge result in RAM. Most source code will
fit into this limit, avoiding local disk IO for simple merges.

Larger files will automatically spool to a temporary file that
can be cleaned up in the finally, reducing the risk of leaving
them on disk and consuming space in /tmp.

Change-Id: Ieccbd9b354d4dd3d2bc1304857325ae7a9f34ec6

10 years agoMerge "ResolveMerger: push result file creation into updateIndex()"
Matthias Sohn [Fri, 8 Aug 2014 22:34:47 +0000 (18:34 -0400)]
Merge "ResolveMerger: push result file creation into updateIndex()"

10 years agoResolveMerger: push result file creation into updateIndex() 26/31326/1
Shawn Pearce [Fri, 8 Aug 2014 22:04:57 +0000 (15:04 -0700)]
ResolveMerger: push result file creation into updateIndex()

The only caller of writeMergedFile is updateIndex, and the only
user of this path object is the code within the method. This is
a no-op change that opens the door to refactoring the way temp
files are handled for inCore merges.

Change-Id: I863a303194689a806b667e55eb958e1decf046c1

10 years agoUpdate Maven JAR plugins 12/31312/1
Shawn Pearce [Fri, 8 Aug 2014 18:26:16 +0000 (11:26 -0700)]
Update Maven JAR plugins

Seems to fix the build stalls observed under some builds of the
Java 7 JRE.

Change-Id: I94d5e927b5b2ec3971e9a70c18966368a61ec14c

10 years agoRecursiveMerger: do not insert virtual commits into repository 11/31311/2
Shawn Pearce [Fri, 8 Aug 2014 18:19:45 +0000 (11:19 -0700)]
RecursiveMerger: do not insert virtual commits into repository

When merging common ancestors to create a single virtual common
ancestor the commit does not need to be inserted into the Git
repository. Instead just mock it out in memory as part of the
merger's RevWalk pool.

Make the author and committer stable and predictable for any
given pair of merge bases. It is not necessary for the caller's
name or email to be used as the commit will not be written out.

Change-Id: I88d5ee4de121950e1b032a5c10486c9d2c42656c

10 years agoFix non-relative remote defined in manifest xml. 48/31148/3
Yuxuan 'fishy' Wang [Thu, 7 Aug 2014 01:17:29 +0000 (18:17 -0700)]
Fix non-relative remote defined in manifest xml.

Currently if the remote defined in repo manifest xml is non-relative (e.g.
"https://chromium.googlesource.com"), our code will break. This change fixed
that.

It also makes that remotes are ending with "/".

Change-Id: Icef46360b32227a9db1d9bb9e6d929c72aeaa8df
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoFix CheckoutCommand not setting up tracking 42/31042/1
Robin Stocker [Tue, 5 Aug 2014 13:38:07 +0000 (23:38 +1000)]
Fix CheckoutCommand not setting up tracking

Instead of passing on the start point as is to CreateBranchCommand, the
resolved ObjectId was used. Given this, CreateBranchCommand did not set
up tracking.

This also fixes CreateBranchCommand with setStartPoint(null) to use HEAD
(instead of NPEing), as documented in the Javadoc.

Bug: 441153
Change-Id: I5ed82b4a4b4a32a81a7fa2854636b921bcb3d471
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoRun unit tests in parallel 36/30936/1
Matthias Sohn [Sun, 3 Aug 2014 23:04:26 +0000 (01:04 +0200)]
Run unit tests in parallel

Configure Maven surefire plugin to run tests concurrently using
multiple processes. By default use one process per core available
on the machine running the tests.

Running this on my MacBook Pro i7 with 8 cores 16 GB RAM SSD
I get the following results:

forkCount   "mvn clean install" on org.eclipse.jgit.test
--------------------------------------------------------
1           02:36 min
2           01:26 min
4           00:56 min
6           00:49 min
8           00:49 min
10          00:51 min

When on-access scan of McAfee virus scanner is enabled the optimum
is at half the number of cores (4 of 8) on my MacBook.

Set system property "test-fork-count" to override the default.
Either set it to an absolute number e.g. "4" or in units of
cores available on the system running the build. E.g. "0.5C" to
use 4 cores on a 8 core system or "1C" to use all 8 cores on
a 8 core system.
E.g.
$ mvn clean install -Dtest-fork-count=0.5C
to use half the number of cores processes to run tests.

Change-Id: Ifdbd1ae8153f2033922eae6ae8942c36db1f9806
Signed-off-by: Sohn <matthias.sohn@sap.com>
10 years agoMerge "Add isRebase to API of BranchConfig"
Robin Rosenberg [Sun, 3 Aug 2014 11:33:28 +0000 (07:33 -0400)]
Merge "Add isRebase to API of BranchConfig"

10 years agoMerge "Use bitcheck to check for presence of OPT_FULL option"
Robin Rosenberg [Sun, 3 Aug 2014 08:51:12 +0000 (04:51 -0400)]
Merge "Use bitcheck to check for presence of OPT_FULL option"

10 years agoAdd isRebase to API of BranchConfig 24/30924/1
Robin Stocker [Sun, 3 Aug 2014 08:32:43 +0000 (18:32 +1000)]
Add isRebase to API of BranchConfig

Change-Id: I9819f49410e30d32c2157db0556a0dd6a0bcc5a4
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoNetRC parser and credentials provider. 94/22194/8
Alexey Kuznetsov [Tue, 18 Feb 2014 22:23:09 +0000 (02:23 +0400)]
NetRC parser and credentials provider.

Adds default git command line behaviour of reading credentials
for https connections from .netrc file.

Bug: 428229
Change-Id: I88699ca5da6a20bdeaed24b7e3899cc1022b8e7c
Signed-off-by: Alexey Kuznetsov <axet@me.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoUse bitcheck to check for presence of OPT_FULL option 94/17894/3
Kevin Sawicki [Wed, 30 Oct 2013 15:55:14 +0000 (08:55 -0700)]
Use bitcheck to check for presence of OPT_FULL option

Previously an equality check was performed so an exception would
be thrown if any other options were set.

Change-Id: I36b60e2c0a8aef9fcfe663055dba520192996872

10 years agoEnhance BranchConfig API to expose branch.* options 15/30915/2
Robin Stocker [Sat, 2 Aug 2014 09:20:51 +0000 (19:20 +1000)]
Enhance BranchConfig API to expose branch.* options

With these, more code can use BranchConfig instead of directly accessing
the raw configuration values.

Change-Id: I4b52f97ff0e3fc8f097512806f043c615a3d2594
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdd IndexDiff tests for merge conflict state BOTH_ADDED 85/30585/5
Laurent Goubet [Mon, 28 Jul 2014 12:27:05 +0000 (14:27 +0200)]
Add IndexDiff tests for merge conflict state BOTH_ADDED

JGit handled this case improperly which these tests demonstrate. Fixed
by I25915880f304090fe90584c79bddf021231227a2.

Bug: 440537
Change-Id: Ia29c1d6cf8c0ce724cc3ff5ed9e0b396949b44bf
Signed-off-by: Laurent Goubet <laurent.goubet@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoIndexDiffFilter should never filter entries with stage!=0 58/30858/2
Christian Halstrick [Fri, 1 Aug 2014 09:28:01 +0000 (11:28 +0200)]
IndexDiffFilter should never filter entries with stage!=0

If the IndexDiffFilter is asked whether it should include or filter out
a certain path and for that path there is a dircache entry with a stage
different from 0, then the filter should never filter out this entry.
IndexDiffFilter is an optimized version of AnyDiffFilter and there is no
case where the index contains non-0 stages but we still don't see any
diff for that path.

Change-Id: I25915880f304090fe90584c79bddf021231227a2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "HistogramDiff: Convert stack recursion to heap managed queue"
Robin Rosenberg [Sat, 2 Aug 2014 09:35:18 +0000 (05:35 -0400)]
Merge "HistogramDiff: Convert stack recursion to heap managed queue"

10 years agoFix Javadoc errors with Java 8 49/30549/2
Robin Stocker [Sun, 27 Jul 2014 05:13:36 +0000 (15:13 +1000)]
Fix Javadoc errors with Java 8

Bug: 440414
Change-Id: Icce87bd23a3698513b76246677f1d45ddbcaab47
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix API errors raised on ResolveMerger affecting API providers only 67/30767/2
Christian Halstrick [Wed, 30 Jul 2014 15:01:56 +0000 (17:01 +0200)]
Fix API errors raised on ResolveMerger affecting API providers only

In change If45bc3d078b3d3de87b758e71d7379059d709603 a new parameter was
added to 3 protected methods of ResolveMerger. This breaks the code of
developers which have subclassed ResolveMerger. The API baseline check
in Eclipse reports this as API breakage.

Since this will break only providers but not consumers of the API this
should be allowed also in minor versions. According to OSGi semantic
versioning
http://www.osgi.org/wiki/uploads/Links/SemanticVersioning.pdf
breaking providers in a minor version update is ok.

Therefore silence these errors using API filter rules.

Bug: 440757
Change-Id: Icabbd0e1de7e877c66a5c4a2c8391473f992a1aa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoImplement RepoCommand.Project.hashCode() since we override equals() 66/30766/2
Matthias Sohn [Wed, 30 Jul 2014 21:10:13 +0000 (23:10 +0200)]
Implement RepoCommand.Project.hashCode() since we override equals()

Bug: 440757
Change-Id: I16614c75b62b2fbef05419dd8667e3c50889abe4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove @Override annotation illegal for interfaces on Java 5 65/30765/2
Matthias Sohn [Wed, 30 Jul 2014 21:07:13 +0000 (23:07 +0200)]
Remove @Override annotation illegal for interfaces on Java 5

Bug: 440757
Change-Id: I11897e8e680722313f28d9d241e23e92eddeb966
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMark package org.eclipse.jgit.gitrepo.internal as x-internal 64/30764/2
Matthias Sohn [Wed, 30 Jul 2014 21:05:33 +0000 (23:05 +0200)]
Mark package org.eclipse.jgit.gitrepo.internal as x-internal

It's an internal package which isn't part of the API. Mark it x-internal
to silence @since tag warnings which are only raised for new API.

Bug: 440757
Change-Id: Id05deaca43f135cd1bfe83cf1f29787cbbdbecac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoSmall performance optimization for ignore rules/fnmatcher 27/30727/2
Andrey Loskutov [Wed, 30 Jul 2014 08:42:30 +0000 (10:42 +0200)]
Small performance optimization for ignore rules/fnmatcher

 - don't check empty segments generated by String.split()
 - don't continue to add segments if the matcher fails to match input
 - don't add empty heads
 - don't iterate over empty heads.

Bug: 440732
Change-Id: I7d04dccfe24d91275d17ba246662337d6dba66df
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAdded toString() methods for better debugging of ignore rules 26/30726/2
Andrey Loskutov [Wed, 30 Jul 2014 08:38:53 +0000 (10:38 +0200)]
Added toString() methods for better debugging of ignore rules

Change-Id: Ie31687faa2df47ecaacace2504c3b4e93f1ea809
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoFix RevertCommand to correctly revert multiple commits at once. 26/30026/3
Maik Schreiber [Thu, 19 Jun 2014 10:54:14 +0000 (12:54 +0200)]
Fix RevertCommand to correctly revert multiple commits at once.

The fix is to move the new head commit to the newly-created revert
commit, so that additional revert commits will use the correct head.

Change-Id: I5de3a9a2a4c276e60af732e9c507cbbdfd1a4652
Signed-off-by: Maik Schreiber <blizzy@blizzy.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Remove overlapping submodules from repo manifest."
Shawn Pearce [Tue, 29 Jul 2014 23:28:11 +0000 (19:28 -0400)]
Merge "Remove overlapping submodules from repo manifest."

10 years agoRemove overlapping submodules from repo manifest. 99/30699/2
Yuxuan 'fishy' Wang [Tue, 29 Jul 2014 22:43:04 +0000 (15:43 -0700)]
Remove overlapping submodules from repo manifest.

Apparently repo allows projects overlapping, e.g. one project's path is "foo"
and another project's path is "foo/bar". This is not supported in git submodule.
At JGit repo side we'll skip all the submodules that are in subdirectories of
other submodules, and on repo side we'll make them submodules to resolve this
problem.

Change-Id: I6820c4ef400c530a36150b1228706adfcc43ef64
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Added the missing export in MANIFEST.MF."
Shawn Pearce [Tue, 29 Jul 2014 23:01:13 +0000 (19:01 -0400)]
Merge "Added the missing export in MANIFEST.MF."

10 years agoMerge "RecursiveMerger should not fail on content-merge conflicts of parents"
Christian Halstrick [Tue, 29 Jul 2014 07:46:52 +0000 (03:46 -0400)]
Merge "RecursiveMerger should not fail on content-merge conflicts of parents"

10 years agoStrip trailing /s in repo base URI. 16/28216/7
Yuxuan 'fishy' Wang [Mon, 9 Jun 2014 18:27:52 +0000 (11:27 -0700)]
Strip trailing /s in repo base URI.

Change-Id: I71040db2cca69638cfad89acdc9179ee80592b27
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoRecursiveMerger should not fail on content-merge conflicts of parents 62/30562/2
Christian Halstrick [Fri, 25 Jul 2014 06:41:38 +0000 (08:41 +0200)]
RecursiveMerger should not fail on content-merge conflicts of parents

Previously when RecursiveMerger was trying to create a single virtual
common base for the merge it was failing when this lead to content-merge
conflicts. This is different from what native git is doing. When native
git's recursive merge algorithm creates a new common base it will merge
the multiple parents and simply take the merge result (potentially
including conflict markers) as common base. See my discussion with Shawn
here: http://www.spinics.net/lists/git/msg234959.html :

  > - How should workingtree, index (stage1,2,3) look like if during
that
  > merge of common ancestors a conflict occurs? Will I see in stage2
and
  > stage3 really see content of X1 and X2?

  Its done entirely in memory and never touches the working tree or
  index. When a conflict exists in the X1-X2 merge the conflict is
  preserved into the new virtual base.

There is still the possibility that the merge of parents lead to
conflicts. File/Folder conclicts, conflicts on filemodes. This commit
only fixes the situation for conflicts when merging content.

Bug: 438203
Change-Id: If45bc3d078b3d3de87b758e71d7379059d709603

10 years agoFixed message for exception thrown during recursive merge 61/30561/2
Christian Halstrick [Thu, 26 Jun 2014 11:42:21 +0000 (13:42 +0200)]
Fixed message for exception thrown during recursive merge

During recursive merge jgit potentially has to merge multiple
common ancestors. If this fails because there are conflicts then
the exception thrown for that should have a message which states
this clearly. Previously a wrong message was given ("More than 200
merge bases ...")

Change-Id: Ia3c058d5575decdefd50390ed83b63668d31c1d1

10 years agoHistogramDiff: Convert stack recursion to heap managed queue 26/30526/4
Shawn Pearce [Fri, 25 Jul 2014 15:17:27 +0000 (08:17 -0700)]
HistogramDiff: Convert stack recursion to heap managed queue

Each time the longest common substring is found the diff algorithm
recurses to reprocess the regions before and after the common string.

Large files with many edits can trigger StackOverflowError as the
algorithm attempts to process a deeply split tree of regions. This
is especially prone to happen in servers where the Java stack size
may have been limited to 1M or even 256K.

To keep edits produced in order a queue is used to process edits
in a depth-first strategy.

Change-Id: Iae7260c6934efdffac7c7bee4d3633a8208924f7

10 years agoFix RecursiveMerger's internal use of merge to find a merge base 28/30128/5
Christian Halstrick [Fri, 18 Jul 2014 09:04:33 +0000 (11:04 +0200)]
Fix RecursiveMerger's internal use of merge to find a merge base

When RecursiveMerger tried to determine a common base tree it was
recursively tried to merge multiple common bases. But these intermediate
merges which have just been done to determine a single common base for
the final merge already filled some important fields (toBeCheckedOut,
toBeDeleted, ...). These side effects of the intermediate merges led to
wrong results of the final merge. One symptom was that after a recursive
merge which should be succesful you could still see leftover files in
the worktree: files which existed in the (virtual) common base but which
don't exist anymore in the branches to be merged.

The solution is easy: Clear the appropriate fields after common base
determination and start the final merge with a clean state.

Change-Id: I644ea9e1cb15360f7901bc0483cdb9286308c226
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
10 years agoHandle initial checkout correctly 26/30326/3
Christian Halstrick [Wed, 23 Jul 2014 13:30:06 +0000 (15:30 +0200)]
Handle initial checkout correctly

As described in native gits file "git-read-tree.txt" git has in a
special mode when doing the "initial" checkout. "Initial" means that the
index is empty before the checkout. This was not handled correctly in
JGit and is fixed in this commit. Also see
https://github.com/git/git/blob/master/Documentation/git-read-tree.txt#L181

Change-Id: I9b9d1bd9ebf349cfca420c891c7b099a18d07ba4

10 years agoAdded the missing export in MANIFEST.MF. 38/30438/1
Yuxuan 'fishy' Wang [Thu, 24 Jul 2014 15:17:10 +0000 (08:17 -0700)]
Added the missing export in MANIFEST.MF.

This fixes bug 440352.

Change-Id: I4b1c63087a97b7b2f3d7bdb5e066424a84ef6cef
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoUpdate SUBMITTING_PATCHES 56/30156/3
Robin Stocker [Sat, 19 Jul 2014 04:59:12 +0000 (14:59 +1000)]
Update SUBMITTING_PATCHES

It contained outdated information about attaching patches to bug
reports. Shorten it to the essentials.

Also format it using markdown and rename it to CONTRIBUTING.md, which is
a convention and doesn't include "patches" in the name.

Change-Id: I9ee73f16e6fa8fbf529ac0ca791e2375d4d56d68
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoDon't prefix output from jgit status with '# ' 59/30159/2
Robin Rosenberg [Sat, 19 Jul 2014 11:27:00 +0000 (13:27 +0200)]
Don't prefix output from jgit status with '# '

C Git does not do it anymore

Bug: 439937
Change-Id: I20bdb787a00bba3e4adf269fd64ec6296bdc2a66

10 years agoPreserve merges during pull if configured to do so 71/29771/5
Konrad Kügler [Fri, 23 May 2014 21:09:17 +0000 (23:09 +0200)]
Preserve merges during pull if configured to do so

Setting branch.<name>.rebase or pull.rebase to 'preserve' will preserve
merges during rebase. Also, pull.rebase is now consulted if there is no
branch-specific configuration.

Bug: 429664
Change-Id: I345fa295c7e774e0d0a8e6aba30fbfc3552e0084
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoRebase: Add --preserve-merges support 70/29770/3
Konrad Kügler [Mon, 19 May 2014 19:47:27 +0000 (21:47 +0200)]
Rebase: Add --preserve-merges support

With --preserve-merges C Git re-does merges using the rewritten merge
parents, discarding the old merge commit. For the common use-case of
pull with rebase this is unfortunate, as it loses the merge conflict
resolution (and other fixes in the merge), which may have taken quite
some time to get right in the first place.

To overcome this we use a two-fold approach:
If any of the (non-first) merge parents of a merge were rewritten, we
also redo the merge, to include the (potential) new changes in those
commits.
If only the first parent was rewritten, i.e. we are merging a branch
that is otherwise unaffected by the rebase, we instead cherry-pick the
merge commit at hand. This is done with the --mainline 1 and --no-commit
options to apply the changes introduced by the merge. Then we set up an
appropriate MERGE_HEAD and commit the result, thus effectively forging a
merge.

Apart from the approach taken to rebase merge commits, this
implementation closely follows C Git. As a result, both Git
implementations can continue rebases of each other.

Preserving merges works for both interactive and non-interactive rebase,
but as in C Git it is easy do get undesired outcomes with interactive
rebase.

CommitCommand supports committing merges during rebase now.

Bug: 439421
Change-Id: I4cf69b9d4ec6109d130ab8e3f42fcbdac25a13b2
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoRepository.writeMergeHeads to accept a list with subtypes of ObjectId 69/29769/2
Konrad Kügler [Fri, 16 May 2014 16:33:12 +0000 (18:33 +0200)]
Repository.writeMergeHeads to accept a list with subtypes of ObjectId

Allows to pass for example a List<RevCommit>.

Change-Id: I5522707060d7d3e0d848ba579956dc62f8fa0234
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoCherry-Pick: Support --no-commit 21/27621/5
Konrad Kügler [Mon, 19 May 2014 19:46:09 +0000 (21:46 +0200)]
Cherry-Pick: Support --no-commit

Change-Id: Ic4c313a8971a5aa15745518c49e2587a1a0fe8d4
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
10 years agoHandle diff formatting when there is nothing to compare with 70/29170/4
Robin Rosenberg [Sun, 29 Jun 2014 20:31:26 +0000 (22:31 +0200)]
Handle diff formatting when there is nothing to compare with

DiffFormatter now suports either side being null and the log program
will output the diff for the first commit.

Bug: 395791
Change-Id: I378957b57e9ad1f7195ba416f402178453f0ebd3

10 years agoEliminate warning about overlapping variable names 29/29429/2
Robin Rosenberg [Thu, 3 Jul 2014 20:06:46 +0000 (22:06 +0200)]
Eliminate warning about overlapping variable names

Change-Id: I7e749092c5b51e2857c186088e2c5c6c6d295367

10 years agoDon't warn for methods that can be static 38/28538/5
Robin Rosenberg [Sun, 15 Jun 2014 19:36:15 +0000 (21:36 +0200)]
Don't warn for methods that can be static

Making the methods static would gain little in performance,
make the code harder to change. Removing unncessary warnings
is more important.

Change-Id: If3e6aa9c1d92e58b4e7a8e246cf4aace237d7a7b

10 years agoAdd new default settings from Eclipse 4.4 42/28542/5
Robin Rosenberg [Sun, 15 Jun 2014 19:53:53 +0000 (21:53 +0200)]
Add new default settings from Eclipse 4.4

These settings were added by Eclipse simply by touching
the project settings. Adding these makes it simpler to see
what local changes have been made.

Change-Id: Iab0aa62530312eb0c78b03b5c6a632742bcc4978

10 years agoMerge "Clarify comments in message properties files (and fix grammar)"
Matthias Sohn [Tue, 1 Jul 2014 22:29:48 +0000 (18:29 -0400)]
Merge "Clarify comments in message properties files (and fix grammar)"

10 years agoTry to fix intermittent test failure related to file timestamps 61/29161/6
Robin Rosenberg [Sat, 28 Jun 2014 13:31:11 +0000 (15:31 +0200)]
Try to fix intermittent test failure related to file timestamps

Improve how tests do a "touch" operation on files. Instead of doing
"f.setLastModified(System.currentTimeMillis)" open a Outputstream on the
file and directly close it again. This makes this method rely only on
one clock - the clock of the filesystem.

Bug: 436917
Change-Id: I68ef3c2878f28b12daebf2ef6a9fa0a5d6e0964d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoClarify comments in message properties files (and fix grammar) 86/29186/1
Robin Stocker [Mon, 30 Jun 2014 10:54:32 +0000 (20:54 +1000)]
Clarify comments in message properties files (and fix grammar)

Bug: 438261
Change-Id: I7b98475886ef789ae7635d8c9e008fc1aa00d534
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoFix incorrect "''" in CLIText.properties 85/29185/1
Robin Stocker [Mon, 30 Jun 2014 10:53:10 +0000 (20:53 +1000)]
Fix incorrect "''" in CLIText.properties

This message is not processed by MessageFormat.

Bug: 438261
Change-Id: If75d8f3cd3f356a56623eee96b64e8845de5eb38
Signed-off-by: Robin Stocker <robin@nibor.org>
10 years agoAdd a comment to the message properties files on how they are processed 57/29157/2
Robin Rosenberg [Sat, 28 Jun 2014 09:25:53 +0000 (11:25 +0200)]
Add a comment to the message properties files on how they are processed

Change-Id: I073f0c2c0729e6a5d3f1834203f0cfeb4c462eda

10 years agoFix spelling error in error messgae 56/29156/2
Robin Rosenberg [Sat, 28 Jun 2014 09:18:36 +0000 (11:18 +0200)]
Fix spelling error in error messgae

Change-Id: I5f712ba290592f7c5aa9ee865ff30383ad315247

10 years agoRemove duplicate string in CLIText.properties 55/29155/3
Robin Rosenberg [Sat, 28 Jun 2014 08:30:01 +0000 (10:30 +0200)]
Remove duplicate string in CLIText.properties

Bug: 438261
Change-Id: Idd6839465ea36d072b1c4393f5abd2f39da02b62

10 years agoFix formatting errors in error messages 54/29154/4
Robin Rosenberg [Sat, 28 Jun 2014 08:24:15 +0000 (10:24 +0200)]
Fix formatting errors in error messages

{} is plain wrong and is not accepted by MessageFormat, the other risk
becoming wrong if another single quote is introduced in the future and
sets a bad example.

Bug: 438261
Change-Id: I2948ca90c10f6ec2574f7f2b9be0a72821ea4daf

10 years agoMerge branch 'stable-3.4' 42/28842/1
Matthias Sohn [Fri, 20 Jun 2014 23:28:55 +0000 (01:28 +0200)]
Merge branch 'stable-3.4'

* stable-3.4:
  Prepare 3.4.2-SNAPSHOT builds
  JGit v3.4.1.201406201815-r
  Allow retrying connecting SshSession in case of an exception

Change-Id: I7efb009b9e012637a16c57e2e93e074023b8e46c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare 3.4.2-SNAPSHOT builds 41/28841/1
Matthias Sohn [Fri, 20 Jun 2014 22:57:43 +0000 (00:57 +0200)]
Prepare 3.4.2-SNAPSHOT builds

Change-Id: If88217d84b88cda6d04c159418d5bc86233fe28c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.1.201406201815-r 38/28838/1 v3.4.1.201406201815-r
Matthias Sohn [Fri, 20 Jun 2014 22:16:29 +0000 (00:16 +0200)]
JGit v3.4.1.201406201815-r

Change-Id: I4383a90fd91a243cd5ce5d0ae4e53874b36c1f47
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoAllow retrying connecting SshSession in case of an exception 76/28676/4
Stefan Lay [Wed, 18 Jun 2014 09:33:34 +0000 (11:33 +0200)]
Allow retrying connecting SshSession in case of an exception

Connecting to an SshSession may fail due to different reasons. Jsch for
example often throws an com.jcraft.jsch.JschException: verify: false.[1]
The issue is still not fixed in JSch 0.1.51.

In such a case it is worth retrying to connect. The number of connection
attempts can be configured using ssh_config parameter
"ConnectionAttempts" [2].

Don't retry if the user canceled authentication.

[1] http://sourceforge.net/p/jsch/bugs/58/
[2] http://linux.die.net/man/5/ssh_config

Bug: 437656
Change-Id: I6dd2a3786b7d3f15f5a46821d8edac987a57e381
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRemove no longer needed API breakage filters 41/28541/2
Robin Rosenberg [Sun, 15 Jun 2014 19:45:28 +0000 (21:45 +0200)]
Remove no longer needed API breakage filters

Change-Id: I2ea2dec55c187b62662195bae810b3f0af8a2983

10 years agoRemove an unnecessary semicolon 40/28540/2
Robin Rosenberg [Sun, 15 Jun 2014 19:39:18 +0000 (21:39 +0200)]
Remove an unnecessary semicolon

Change-Id: I6c5b085ae4a47d0026bd2b2341de76ab333936b9

10 years agoRemove an unnecessary $NON-NLS$ comment 39/28539/2
Robin Rosenberg [Sun, 15 Jun 2014 19:38:56 +0000 (21:38 +0200)]
Remove an unnecessary $NON-NLS$ comment

Change-Id: I8335464061dac1c20de2b698f834e516ef78cf3d

10 years agoMerge "Enable NLS / TranslationBundle to be used in OSGi"
Robin Rosenberg [Sun, 15 Jun 2014 19:58:29 +0000 (15:58 -0400)]
Merge "Enable NLS / TranslationBundle to be used in OSGi"

10 years agoDon't set REWRITE flag unless parent rewriting is requested 47/28447/1
Dave Borowitz [Thu, 12 Jun 2014 19:01:48 +0000 (12:01 -0700)]
Don't set REWRITE flag unless parent rewriting is requested

Change-Id: I65e3702ceb6c8854a2c358cfc2c2e3a9fb9486ff

10 years agoRename RewriteTreeFilter to TreeRevFilter and make it public 46/28446/1
Dave Borowitz [Thu, 12 Jun 2014 17:04:01 +0000 (10:04 -0700)]
Rename RewriteTreeFilter to TreeRevFilter and make it public

The current behavior of passing a TreeFilter to RevWalk has limited
usefulness, since the RevFilter derived from the TreeFilter is always
ANDed together with any other RevFilters. It is also tied fairly
tightly to the parent rewriting mechanism.

Make TreeRevFilter a generic RevFilter that matches modified paths
against any TreeFilter. This allows for more complex logic like
(modified this path OR authored by this person).

Leave the rewrite flag logic in this class, since it's closely tied to
the parent comparison code, but hidden behind a protected constructor.

Change-Id: Ia72ef591a99415e6f340c5f64583a49c91f1b82f

10 years agoAdd missing javadoc and since tag for RepoCommand.readFileFromRepo() 04/28404/1
Matthias Sohn [Thu, 12 Jun 2014 08:50:03 +0000 (10:50 +0200)]
Add missing javadoc and since tag for RepoCommand.readFileFromRepo()

Change-Id: Ib0a98ce633e83c82a58b633c767e70d316b7254c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoMerge "Refactor DefaultRemoteReader for easier code reuse"
Dave Borowitz [Wed, 11 Jun 2014 23:10:24 +0000 (19:10 -0400)]
Merge "Refactor DefaultRemoteReader for easier code reuse"

10 years agoMerge branch 'stable-3.4' 69/28369/1
Matthias Sohn [Wed, 11 Jun 2014 15:48:46 +0000 (17:48 +0200)]
Merge branch 'stable-3.4'

* stable-3.4:
  Prepare post 3.4.0 builds
  JGit v3.4.0.201406110918-r

Change-Id: I1aa3b911c7ace01b82ab9844eec5432d4125b726
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoPrepare post 3.4.0 builds 68/28368/1
Matthias Sohn [Wed, 11 Jun 2014 15:45:04 +0000 (17:45 +0200)]
Prepare post 3.4.0 builds

Change-Id: I49f3741f3973b247a635f7c99b72309d2381a377
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoJGit v3.4.0.201406110918-r 50/28350/1 v3.4.0.201406110918-r
Matthias Sohn [Wed, 11 Jun 2014 13:20:26 +0000 (15:20 +0200)]
JGit v3.4.0.201406110918-r

Change-Id: I56543234316f04bff4e45628bcb8286a6e52e31f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
10 years agoRefactor DefaultRemoteReader for easier code reuse 08/28308/2
Yuxuan 'fishy' Wang [Tue, 10 Jun 2014 22:44:15 +0000 (15:44 -0700)]
Refactor DefaultRemoteReader for easier code reuse

Change-Id: I7f326b4fc96198de7b424e15d8329bde7d7b39cf
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Fixed the problem with calling LsRemoteCommand without a local repository...
Robin Rosenberg [Tue, 10 Jun 2014 19:49:29 +0000 (15:49 -0400)]
Merge "Fixed the problem with calling LsRemoteCommand without a local repository over the ssh and git:// protocols."

10 years agoAdd missing @since to RepoCommand.setInputStream 64/28264/1
Robin Rosenberg [Tue, 10 Jun 2014 07:59:17 +0000 (09:59 +0200)]
Add missing @since to RepoCommand.setInputStream

Change-Id: I2fa1a5c28a1521a837aeaeb994e5cce8d7c4e645

10 years agoAdded setInputStream to RepoCommand. 80/28080/3
Yuxuan 'fishy' Wang [Thu, 5 Jun 2014 20:53:28 +0000 (13:53 -0700)]
Added setInputStream to RepoCommand.

Sometimes an input stream is more useful than the filename of the xml manifest.

Change-Id: Icb09ac751b3d8d7eb14427ad1aac8cee0c371c5f
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
10 years agoMerge "Better way to handle relative URLs in manifest XML"
Dave Borowitz [Mon, 9 Jun 2014 17:26:25 +0000 (13:26 -0400)]
Merge "Better way to handle relative URLs in manifest XML"

10 years agoFixed the problem with calling LsRemoteCommand without a local repository over the... 48/28048/4
Anton Bannykh [Thu, 5 Jun 2014 13:54:01 +0000 (17:54 +0400)]
Fixed the problem with calling LsRemoteCommand without a local repository over the ssh and git:// protocols.

Bug: 436695
Change-Id: Ifd69fbc04156fa4dacdcba6225768f43843eee97
Signed-off-by: Anton Bannykh <anton.bannykh@gmail.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>