Commit Graph

3523 Commits

Author SHA1 Message Date
Matthias Sohn 00802b6317 [cli] Use chaining credentials provider to enable .netrc
If available use credentials in .netrc otherwise prompt the user
if jgit command line needs credentials for remote operations.

Change-Id: Iea1f595618edfb87a37137db08bac8ca2d500ebc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-24 15:27:36 +02:00
Matthias Sohn 3f0d9795ea Add chaining credentials provider
The chaining credentials provider sequentially tries to obtain
credentials from a list of credential providers and returns the
credentials from the first provider which can provide them.

Change-Id: I499f304119d7066d011dbde3556dee6facee8ab0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-24 15:27:35 +02:00
Andrey Loskutov 85b62b4c9c Fixed API violation errors for 3.6 in ConfigConstants
Change-Id: Ibeb09eb23d47412fa93493bb4e81d24d437e31bc
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2014-09-24 11:26:06 +02:00
Matthias Sohn 54dc4b20b3 [Java 8] Configure doclint to accept missing descriptions
We avoid trivial descriptions in JavaDoc. Hence configure
doclint to not fail on missing descriptions.

Change-Id: Iba3d5aec18cc7d7f43e53fa6789f0dede9996fb7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-23 00:32:47 +02:00
Christian Halstrick 227357f929 Add "aggressive" option to GC
JGit should offer the possibility to do a garbage collection in
"aggressive" mode. In this mode garbage collection more aggressively
optimize the repository at the expense of taking much more time.
Technically a aggressive mode garbage collection differs from a
non-aggressive one by:
- not reusing packed objects found in old packs. Recompress every object
- the configuration pack.window is set to 250 (the default is 10)
- the configuration pack.depths is set to 250 (the default is 50)

The associated classes in org.eclipse.jgit.api and the command line
command in org.eclipse.jgit.pgm expose this new option.

The configuration parameters gc.aggressiveDepth and gc.aggressiveWindow
have been introduced to configure this feature.

Bug: 444332
Change-Id: I024101f2810acf6be13ce144c9893d98f5c4ae76
2014-09-19 09:17:41 -04:00
Matthias Sohn 1c0b2a28ac Do not use .netrc implicitly if no CredentialsProvider was set
Do not silently set the NetRCCredentialsProvider if no
CredentialsProvider was set explicitly since applications may want to
have full control which provider should be used.

Bug: 444338
Change-Id: Ie096983bc1caa90443a504d302bfea8f2d26ab9e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-17 15:16:55 +02:00
Marc Strapetz f2ebc8d4c5 PackIndexV1 should check for possible corruption
Change-Id: I1dd741d3e522e396950c30d2f96e9713d0439078
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
2014-09-08 17:12:40 +02:00
Matthias Sohn 66559681dd Prepare post 3.5.0-rc1 builds
Change-Id: Id9e01b867bff0ed10e887c15a12e5399b788b68e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-08 01:01:57 +02:00
Matthias Sohn 48820c7b07 JGit 3.5.0.201409071800-rc1
Change-Id: I59e5e2492820da111df1837fbf3649a2ae03841c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-07 23:58:44 +02:00
Robin Rosenberg bbe99d5b39 Fix the ls-remote command when there is no local repo
Bug: 436695
Change-Id: I567f9a8e355c7624efa3efc9bac4f3b9015afa97
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-07 01:10:51 +02:00
Matthias Sohn 6ccf609e89 Prepare 3.6.0-SNAPSHOT builds
Change-Id: I2d8c3768998c0cfc8d02d11009bc5b7ed1d75778
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-05 14:32:01 +02:00
Shawn Pearce bc90ce7788 PackWriter: Report more stats during partial writes
It can be useful for a server operator to know how long a pack
writer spent writing out objects, even if the request aborts and
never finishes.

Record more of the stats data inside of a finally block, to
ensure these can be included into the server's monitoring.

Change-Id: I00858aa393a948f8e742e64ae4c00953eadaef95
2014-09-04 12:45:18 -07:00
Robin Rosenberg 2475d95374 Update the README with current modules and features
Change-Id: Ic30f55f30ce260dc02c428e1ebf11f01cb790a6e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-04 15:48:00 +02:00
Robin Rosenberg 05896dabfc Drop warnings about unchecked casts in a few stable select places
Change-Id: Ie163a4940f0d13bbdefd8c4643c0944c71800544
2014-09-04 11:35:19 +02:00
Robin Rosenberg 4c6857d1ec Hide warnings about field hiding in the MyersDiff code
Just suppress warning in this stable code rather then fixing names

Change-Id: I07580aa3cbdaa66852a5c919769bbd9020d78703
2014-09-04 11:35:18 +02:00
Robin Rosenberg 409c32b1cf Fix warnings about missing serialVersionUID
Use @SuppressWarnings since these are private classes

Change-Id: Ic8e4c08b70627a3f9b031e2474092e1ce8116f22
2014-09-04 11:35:18 +02:00
Robin Rosenberg 1bb72eb758 Fix warning about missing serialVersionUID
Change-Id: Ia9532d1aaf92df9073c85c44ff2ca94796deefc2
2014-09-04 11:35:17 +02:00
Robin Rosenberg 2f6372337c Rename local variables/parameters to remove warnings about hiding
Change-Id: I73f38492b6a2e7fd6e77005efd0a8a8c65763e74
2014-09-04 11:35:16 +02:00
Robin Rosenberg 547f05d675 Remove non-existing source directories from Java 7 test build
This was a copy-artifact when the bundle was created. This chanhe
removed some warnings in Eclipse.

Change-Id: I32acdf4b60bf5528566e66b1fd82113b1343ed37
2014-09-04 11:28:03 +02:00
Robin Rosenberg 0bc98f17b2 Eliminate warnings for non-nls strings that will never be translated
Some of these eliminations just reduces the number of warnings on
lines where messages are constructed that can/will be translated.

Change-Id: I6eddb39ccc8f2488741bb58540d9ec5f5665e2c4
2014-09-04 11:28:03 +02:00
Robin Rosenberg 00c4a73fbc Windows: Hide the .git directory if hidedotfiles is set to non-false
Other .git files are not hidden with this patch

Change-Id: Idf63ca08d08f3a77c33f5848d02074f8d6a75758
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-04 11:24:54 +02:00
Robin Rosenberg 348dd52ef1 Add the resources directory to the Eclipse classpath
This removes a warning in Eclipse.

Change-Id: I5961ebf2052aff3e5d853451f69c7d75890ac53a
2014-09-04 11:05:38 +02:00
Konrad Kügler 9ac59efbbd PlotCommitList: Close plot lanes at root commits
Bug: 443006
Change-Id: I40b1eb044fa2d9e6c5d4b956c17e32ca6c1bd39f
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
2014-09-02 07:57:04 -04:00
Matthias Sohn 3885ce2a94 Prevent NPE if no CredentialsProvider is registered
If the git server requires authentication and no CredentialsProvider is
registered TransportHttp.connect() would throw an NPE since it tries to
reset the credentials provider. Instead throw a TransportException
explaining the problem.

Change-Id: Ib274e7d9c43bba301089975423de6a05ca5169f6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-09-01 11:27:17 +02:00
Axel Richard 46f3007b52 Handle -m option for Merge command
Set the commit message to be used for the merge commit (in case one is
created)

Bug: 442886
Change-Id: Ie5ecc13822faa366f00b3daa07f74c8441cae195
Signed-off-by: Axel Richard <axel.richard@obeo.fr>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-08-30 01:17:24 +02:00
Shawn Pearce 7b7d033ee1 UploadPack: Always make PackWriter.Statistics available
If the packer fails, still obtain the stats and make them available
to the logger and the caller. Failures can frequently happen when
a client disconnects in the middle of a pack stream. Server admins
may still want to examine the timing metrics from counting and
compressing phases.

Change-Id: Iceae4f68b5473f4223d85c9edfb57837fc818eed
2014-08-29 12:56:17 -07:00
Marc Strapetz 6be184e15c PackIndexV2 should check for possible corruption
Change-Id: I1803ec6d8141f07dd4085778da6461abe81c30a9
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
2014-08-29 10:08:42 +02:00
Yuxuan 'fishy' Wang 9ea357f336 Allow projects without path attribute in manifest.
In such case, we use the name attribute as the default value of path.

Change-Id: I53fa312d6b64c6eb2240f08af7d1d60cea99192a
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-08-28 21:16:56 -07:00
Shawn Pearce 7b28130758 Merge "PackIndexV2: fix possibly wrong check" 2014-08-28 19:53:36 -04:00
Saša Živkov c4797fe986 Let ObjectWalk.markUninteresting also mark the root tree as
uninteresting

Using the ObjectWalk and marking a commit as uninteresting didn't mark
its root tree as uninteresting. This caused the "missing tree ..."
error in Gerrit under special circumstances. For example, if the
patch-set 2 changes only the commit message then the patch-set 1
and patch-set 2 share the same root-tree:

  ps1 -> o   o <- ps2
          \ /
           o root-tree

The transported pack will contain the ps2 commit but not the root-tree
object.

When using the BaseReceivePack.setCheckReferencedObjectsAreReachable
JGit will check the reachability of all referenced objects not provided
in the transported pack. Since the ps1 was advertised it will properly
be marked as uninteresting. However, the root-tree was reachable because
the ObjectWalk.markUninteresting missed to mark it as uninteresting.
JGit was then rejecting the pack with the "missing tree ..." exception.

Gerrit-issue: https://code.google.com/p/gerrit/issues/detail?id=1582
Change-Id: Iff2de8810f14ca304e6655fc8debeb8f3e20712b
Signed-off-by: Saša Živkov <sasa.zivkov@sap.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-08-28 18:05:59 -04:00
Yuxuan 'fishy' Wang 684a2a058a Handles repo manifest file without default remote.
Change-Id: Ic45919a0b695e8a6f4ed47cc060e0c41f1d7e7ea
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-08-27 16:29:19 -07:00
Shawn Pearce 49305cde19 Merge "ReceivePack: Accept shallow lines from Git >= 1.9" 2014-08-27 16:56:16 -04:00
Shawn Pearce 199dd4a9a9 ReceivePack: Accept shallow lines from Git >= 1.9
In Git 1.9 (5dbd767601 "support pushing from a shallow clone")
the git-core project intentionally broke the existing send-pack
protocol from shallow clients.

Shallow clients now transmit their shallow information during push,
ahead of the old-new command sequence. JGit must accept these lines
when presented.

To protect the server against clients sending partial history,
require the connectivity check when pushed to by a shallow client.

Change-Id: I46639366b0900052c376091e1688f07def44ab79
2014-08-27 12:45:17 -07:00
Robin Rosenberg 82f74e490a Merge "Strip "<", ">", and "\n" from name/email in UserConfig" 2014-08-22 09:19:49 -04:00
Robin Rosenberg 5797dbe9a7 Merge "Throw URISyntaxException for incorrect percent-encoding" 2014-08-21 17:47:51 -04:00
Robin Stocker ce312d8afb Strip "<", ">", and "\n" from name/email in UserConfig
This matches what C Git does, see "stripped" in `man git-commit-tree`.

It also fixes the bug of the user where an user.email like "<>" would
show up as "<<>>" in EGit.

Bug: 439844
Change-Id: I567a3c620e191ce9d37d318417e63cb5d4483419
Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-21 23:21:27 +10:00
Yi EungJun da6e729086 Throw URISyntaxException for incorrect percent-encoding
URIish.unescape() threw an ArrayIndexOutOfBoundsException if the given
url has incorrect percent-encoding (e.g. http://example.com/%gg). But an
URISyntaxException is much better to know the reason of the failure.

Change-Id: I3f40a26d43cd2eb4e32c11aba7dc2594bc1f98e2
Signed-off-by: Yi EungJun <eungjun.yi@navercorp.com>
2014-08-21 00:45:39 +09:00
Robin Stocker 30953bbb67 Merge "Fix minor spelling error in comment" 2014-08-19 10:28:46 -04:00
Robin Rosenberg a0752f71fc Fix minor spelling error in comment
Change-Id: I320b5cd526827844d4fe0cbc0f32551010e98090
2014-08-19 16:21:59 +02:00
Christian Halstrick a086582ef2 Merge "cleanup: Remove no-longer needed API compatibility warning filters" 2014-08-19 09:57:28 -04:00
Yuxuan 'fishy' Wang 66fc834530 Support remote aliases in repo manifest.
Change-Id: Icbe5761b9d8a4ae5305bfe45b2d042f214156fc8
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-08-18 11:12:08 -07:00
Yuxuan 'fishy' Wang 5a26c538b3 Support non-default remotes in project tag.
Change-Id: I3c730a1ce379d142d3ed81dda4a73f86f1f9c3eb
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-08-18 10:57:09 -07:00
Robin Stocker 8e19fea1a9 Add tests for checking out tags with CheckoutCommand
Change-Id: Ifec3ac59264c91e154b832fdd907736faf8a8412
Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-17 19:12:04 -04:00
Robin Stocker 4bdd0037aa Add toString to Git with repository path
Useful for debugging.

Change-Id: I78b92ccbcc099370fc99a1d2fa2cf60d5f5892e6
Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-17 17:48:05 +10:00
Shawn Pearce 9bb891e44d 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
2014-08-15 10:27:31 -07:00
Marc Strapetz ce48fba05e PackIndexV2: fix possibly wrong check
According to http://stackoverflow.com/a/8381338, the maximum array
size is not Integer.MAX_VALUE, but Integer.MAX_VALUE - 8

Change-Id: I6ddc7470368acd20abf0885c53c89a982bb0f176
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
2014-08-15 14:01:09 +02:00
Shawn Pearce 94c4d7eee8 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
2014-08-14 12:36:43 -07:00
Shawn Pearce 861f5f649f Add missing @since 3.5 tag to RepoCommand.setIncludedFileReader
Change-Id: Ib5d24f8dafacc0d12c36927c2bbc3ebef2fff7b2
2014-08-13 15:28:24 -07:00
Yuxuan 'fishy' Wang 34dd64f6fe Add support to <include> tag in repo manifest xml.
Change-Id: I32d468f92e24701ea680435bf3417e3850857303
Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
2014-08-13 13:04:28 -07:00
Shawn Pearce b1bea54113 Merge "Tweak the handling of remote url in jgit repo." 2014-08-13 16:02:57 -04:00