]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoSet parameter name in parameterized http tests 20/149120/2
Matthias Sohn [Sun, 8 Sep 2019 10:34:27 +0000 (12:34 +0200)]
Set parameter name in parameterized http tests

This shows the class name of the HTTP factory used in each test run.

Change-Id: I7c1df20f0e138dc7e3120fe87e80d40ab17dd8c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate Orbit to R20190827152740 for 2019-09 48/148948/1
Matthias Sohn [Thu, 5 Sep 2019 08:27:51 +0000 (10:27 +0200)]
Update Orbit to R20190827152740 for 2019-09

Change-Id: I31d0ba525990cd391b704431212d98ce8b8b3970
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.5.0-SNAPSHOT builds 09/148909/1
Matthias Sohn [Wed, 4 Sep 2019 16:00:19 +0000 (18:00 +0200)]
Prepare 5.5.0-SNAPSHOT builds

Change-Id: I96bbefd698c74e450d05d21572d4769c6c5aaea6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.5.0.201909041048-rc1 00/148900/1 v5.5.0.201909041048-rc1
Matthias Sohn [Wed, 4 Sep 2019 14:47:57 +0000 (16:47 +0200)]
JGit v5.5.0.201909041048-rc1

Change-Id: I77a8c73cfd0a27b1242eddf32da513ce0148260e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 60/148860/1
Matthias Sohn [Wed, 4 Sep 2019 00:20:44 +0000 (02:20 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.4.4-SNAPSHOT builds
  JGit v5.4.3.201909031940-r
  Prepare 5.3.6-SNAPSHOT builds
  JGit v5.3.5.201909031855-r
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Icd6630db6458971f840c3ab4553e00f6c775ede0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.4.4-SNAPSHOT builds 59/148859/1
Matthias Sohn [Tue, 3 Sep 2019 23:48:25 +0000 (01:48 +0200)]
Prepare 5.4.4-SNAPSHOT builds

Change-Id: I64c03436c285bd8eb5e87abe560417402b60e695
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.4.3.201909031940-r 58/148858/1 v5.4.3.201909031940-r
Matthias Sohn [Tue, 3 Sep 2019 23:40:09 +0000 (01:40 +0200)]
JGit v5.4.3.201909031940-r

Change-Id: I48ff1d51122ff73e0561f1fcf52a532221810e5d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 57/148857/1
Matthias Sohn [Tue, 3 Sep 2019 23:28:05 +0000 (01:28 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.6-SNAPSHOT builds
  JGit v5.3.5.201909031855-r
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Icfd5a612055feeff04733c0d2c44837ab554a2c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.3.6-SNAPSHOT builds 56/148856/1
Matthias Sohn [Tue, 3 Sep 2019 23:03:41 +0000 (01:03 +0200)]
Prepare 5.3.6-SNAPSHOT builds

Change-Id: I4d57f8ea0ab1f8fbd73fd75861f2f751c4aba0a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.3.5.201909031855-r 55/148855/1 v5.3.5.201909031855-r
Matthias Sohn [Tue, 3 Sep 2019 22:54:34 +0000 (00:54 +0200)]
JGit v5.3.5.201909031855-r

Change-Id: I7f5dcebc2e5816c845fa63046c67bc2301926e2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 54/148854/1
Matthias Sohn [Tue, 3 Sep 2019 22:32:42 +0000 (00:32 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: I7e88c7c7d202f1e3fb8e143277650aa5fefff439
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 51/148851/2
Matthias Sohn [Tue, 3 Sep 2019 21:41:03 +0000 (23:41 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Iac5dc9683cea97db04d20f27c10f2e103d3ae7b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.12-SNAPSHOT builds 49/148849/1
Matthias Sohn [Tue, 3 Sep 2019 20:56:39 +0000 (22:56 +0200)]
Prepare 5.1.12-SNAPSHOT builds

Change-Id: I353ac3f23024063722abc7340bc9a6df3c615741
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.11.201909031202-r 21/148821/1 v5.1.11.201909031202-r
Matthias Sohn [Tue, 3 Sep 2019 16:01:55 +0000 (18:01 +0200)]
JGit v5.1.11.201909031202-r

Change-Id: I288acf670160b9bcd2d04f572a902b5838b4d4f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.0' into stable-5.1 06/148806/2
Matthias Sohn [Tue, 3 Sep 2019 14:02:44 +0000 (16:02 +0200)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: I172136a031ff0730e575327cafb3527c9650a71d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.11' into stable-5.0 97/148797/2 stable-5.0
Matthias Sohn [Tue, 3 Sep 2019 13:54:54 +0000 (15:54 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Ifb6a4dbea2f48fd2ffa66eb737d61920aefedfbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 4.11.10-SNAPSHOT builds 94/148794/1 stable-4.11
Matthias Sohn [Tue, 3 Sep 2019 12:49:20 +0000 (14:49 +0200)]
Prepare 4.11.10-SNAPSHOT builds

Change-Id: Ic98bd87d96ce627d38e1ecc2c3cb28b517ab489e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v4.11.9.201909030838-r 87/148787/1 v4.11.9.201909030838-r
Matthias Sohn [Tue, 3 Sep 2019 12:37:49 +0000 (14:37 +0200)]
JGit v4.11.9.201909030838-r

Change-Id: Ie60468569074197d49e19cbd0ffaedfe88f3d74e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.10' into stable-4.11 86/148786/1
Matthias Sohn [Tue, 3 Sep 2019 12:23:29 +0000 (14:23 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: If672b4f0c350f4e8ff7e1e706485cffd8137236d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 80/148780/2 stable-4.10
Matthias Sohn [Tue, 3 Sep 2019 12:21:04 +0000 (14:21 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file

Change-Id: I8bb74aacc1c010cfed9a0c8acffb520724f0e395
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-4.9' into stable-4.10 79/148779/2
Matthias Sohn [Tue, 3 Sep 2019 11:24:28 +0000 (13:24 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Id5bf44645655fca40ad22bb1f1ad20a7c2e8f6db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Update bazlets to the latest master revision 78/148778/1 stable-4.9
David Pursehouse [Tue, 3 Sep 2019 11:35:47 +0000 (20:35 +0900)]
Bazel: Update bazlets to the latest master revision

The latest revision includes various fixes to allow the build
to work with recent versions of Bazel.

Change-Id: I72c100b99762010946d9b2784286af560bbdf185
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Remove FileTreeIteratorWithTimeControl from BUILD file 77/148777/1
David Pursehouse [Tue, 16 Jul 2019 02:19:09 +0000 (11:19 +0900)]
Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file

FileTreeIteratorWithTimeControl was deleted in a024759, but was
not removed from the BUILD file, thus causing the bazel build to
fail.

Change-Id: I892c0ffcac947298d0d6009374ee2c5d9afefb66
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit e54fde8616f53a6fab5201db4a0c7e67dd0145c5)

5 years agoBatchRefUpdate: repro racy atomic update, and fix it 06/148706/8
Han-Wen Nienhuys [Sat, 31 Aug 2019 19:33:58 +0000 (21:33 +0200)]
BatchRefUpdate: repro racy atomic update, and fix it

PackedBatchRefUpdate was creating a new packed-refs list that was
potentially unsorted. This would be papered over when the list was
read back from disk in parsePackedRef, which detects unsorted ref
lists on reading, and sorts them. However, the BatchRefUpdate also
installed the new (unsorted) list in-memory in
RefDirectory#packedRefs.

With the timestamp granularity code committed to stable-5.1, we can
more often accurately decide that the packed-refs file is clean, and
will return the erroneous unsorted data more often. Unluckily timed
delays also cause the file to be clean, hence this problem was
exacerbated under load.

The symptom is that refs added by a BatchRefUpdate would stop being
visible directly after they were added. In particular, the Gerrit
integration tests uses BatchRefUpdate in its setup for creating the
Admin group, and then tries to read it out directly afterward.

The tests recreates one failure case. A better approach would be to
revise RefList.Builder, so it detects out-of-order lists and
automatically sorts them.

Fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=548716 and
https://bugs.chromium.org/p/gerrit/issues/detail?id=11373.

Bug: 548716
Change-Id: I613c8059964513ce2370543620725b540b3cb6d1
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDelete unused FileTreeIteratorWithTimeControl 65/148765/1
Matthias Sohn [Thu, 11 Jul 2019 08:00:23 +0000 (10:00 +0200)]
Delete unused FileTreeIteratorWithTimeControl

The only usage of this test iterator was removed in df637928d. Hence
delete this iterator and associated test.

Change-Id: I47710133ec3edc675c21db210960c024982668c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit a024759cf5bf1cd6b9beb4f790d484943761a7e1)

5 years agoFix RacyGitTests#testRacyGitDetection 64/148764/1
Matthias Sohn [Tue, 18 Jun 2019 09:32:59 +0000 (11:32 +0200)]
Fix RacyGitTests#testRacyGitDetection

This test case assumed file system timestamp resolution of 1 second. On
filesystems with a finer resolution this test fails since the index
entry is only smudged if the file index entry's lastModified and the
lastModified of the git index itself are within the same filesystem
timer tick. Fix this by ensuring that these timestamps are identical
which should work for any filesystem timer resolution.

Bug: 548188
Change-Id: Id84d59e1cfeb48fa008f8f27f2f892c4f73985de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
(cherry picked from commit 1159f9dd7c80a53c2509cd75d997a6afed37f9a6)

5 years agoChange RacyGitTests to create a racy git situation in a stable way 63/148763/1
Masaya Suzuki [Mon, 24 Dec 2018 03:31:10 +0000 (19:31 -0800)]
Change RacyGitTests to create a racy git situation in a stable way

By using File#setLastModified, we can create a racy git situation
stably.

Tested with --runs_per_test=100

Bug: 526111
Change-Id: I60b3632d353e19f335668325aa603640be423f58
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
(cherry picked from commit df637928d2ef4b9ee06af7e37344c7848f870ce4)

5 years agoSilence API warnings 42/148742/2
Matthias Sohn [Mon, 2 Sep 2019 23:27:02 +0000 (01:27 +0200)]
Silence API warnings

Change-Id: I27fd62de51ca0eedcc7e2e256487bda1e18bce8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agosshd: fix proxy connections with the DefaultProxyDataFactory 93/145493/5
Thomas Wolf [Thu, 4 Jul 2019 18:00:48 +0000 (20:00 +0200)]
sshd: fix proxy connections with the DefaultProxyDataFactory

The java.net.ProxySelector is quite a bit different from the one
in Eclipse. Eclipse (and the OS) uses "socks" as URI scheme to
look up a SOCKS proxy. java.net.ProxySelector needs "socket" as
scheme (and internally maps that to "socks" if and when it asks
the OS about the proxies).

Moreover, java.net.ProxySelector may return unresolved addresses,
whereas the Eclipse proxy selector always returns resolved addresses.

Fix both by explicitly resolving unresolved proxy addresses and using
scheme "socket" in the DefaultProxyDataFactory.

Tested manually with the jgit command-line tool using ssh -vvv -D7020
localhost and 3proxy as SOCKS5 proxies on localhost (3proxy with
user/password authentication). Start jgit with _JAVA_OPTIONS set to
"-DsocksProxyHost=<host> -DsocksProxyPort=<port>
-Djava.net.useSystemProxies=false" to test manually.

Bug: 548965
Change-Id: Ib81ae8255ac2f9c48268f172e7d8ebb4a792b66d
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agosshd: support the HashKnownHosts configuration 65/144665/7
Thomas Wolf [Fri, 21 Jun 2019 20:39:19 +0000 (22:39 +0200)]
sshd: support the HashKnownHosts configuration

Add the constant, and implement hashing of known host names in
OpenSshServerKeyDatabase. Add a test verifying that the hashing
works.

Bug: 548492
Change-Id: Iabe82b666da627bd7f4d82519a366d166aa9ddd4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agosshd: configurable server key verification 73/144573/8
Thomas Wolf [Thu, 20 Jun 2019 17:43:49 +0000 (19:43 +0200)]
sshd: configurable server key verification

Provide a wrapper interface and change the implementation such that
a client can substitute its own database of known hosts keys instead
of the default file-based mechanism.

Bug: 547619
Change-Id: Ifc25a4519fa5bcf7bb8541b9f3e2de15215e3d66
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agosshd: allow setting a null ssh config 72/144572/4
Thomas Wolf [Thu, 20 Jun 2019 17:42:21 +0000 (19:42 +0200)]
sshd: allow setting a null ssh config

The same effect could already be obtained if the ~/.ssh/config file
did not exist. But that is more difficult to control by clients,
since JGit would pick up the config if it was then created. Therefore
allow specifying a null config explicitly to permanently switch off
config file handling.

Change-Id: Iedf8a7f4d5c1ca08e0a513ed28301d8e5261b22a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agosshd: simplify OpenSshServerKeyVerifier 71/144571/4
Thomas Wolf [Thu, 20 Jun 2019 17:41:33 +0000 (19:41 +0200)]
sshd: simplify OpenSshServerKeyVerifier

Reduce the dependency on the ClientSession in preparation to
remove it altogether. Remove the internal helper, re-implement
the needed bits. We have not implemented any configuration
possibility in JGit for creating hashed host names in known hosts
files, so we don't need the sshd code that theoretically would
enable this.

Change-Id: I295f5106b60e1cc3a9d085b0cb7ff747daae88be
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agosshd: simplify ServerKeyLookup interface 70/144570/4
Thomas Wolf [Thu, 20 Jun 2019 17:40:45 +0000 (19:40 +0200)]
sshd: simplify ServerKeyLookup interface

We're actually interested only in the known public keys, we don't need
the corresponding host entry from the config.

Change-Id: Ibde6dffe9e3f87bfbb7c70d1f733b2b0e28cad71
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUse https in update site URLs 25/148625/1
Matthias Sohn [Fri, 30 Aug 2019 09:12:15 +0000 (11:12 +0200)]
Use https in update site URLs

Bug: 450485
Change-Id: I4fc288fbea2e8186d20295e9fadec721641e779b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 04/148604/1
Jonathan Nieder [Fri, 30 Aug 2019 01:16:52 +0000 (18:16 -0700)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Return a new instance from openSystemConfig and openUserConfig

Change-Id: If576513ebbd80c7f01b83be5ab2edd436f5739e3
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 02/148602/1
Jonathan Nieder [Fri, 30 Aug 2019 01:16:39 +0000 (18:16 -0700)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Return a new instance from openSystemConfig and openUserConfig

Change-Id: I5f2f957ff27b7941ab29b2dc1c885fbf0093705a
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 01/148601/1
Jonathan Nieder [Fri, 30 Aug 2019 01:16:29 +0000 (18:16 -0700)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Return a new instance from openSystemConfig and openUserConfig

Change-Id: I6491549ab13aad2a4c3f8444a090a94a378eccdb
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 00/148600/1
Jonathan Nieder [Fri, 30 Aug 2019 01:15:23 +0000 (18:15 -0700)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Return a new instance from openSystemConfig and openUserConfig

Change-Id: I93afa16b14e3e2d127705e3378fb703d6c329694
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoReturn a new instance from openSystemConfig and openUserConfig 73/148373/4
Matthias Sohn [Mon, 26 Aug 2019 20:43:11 +0000 (22:43 +0200)]
Return a new instance from openSystemConfig and openUserConfig

Move the handling of cached user and system config to getSystemConfig
and getUserConfig methods and revert the implementation of
openSystemConfig and openUserConfig to the old stateless
implementation.

This ensures the open methods respect the passed-in parent config, which
may be different on each invocation. Additionally, returning a new
instance matches the behavior of the previous implementation of the
default system reader, which downstream callers may be depending on.

Move the implementation of the new caching methods getSystemConfig and
getUserConfig up to SystemReader. This avoids that we break the ABI for
subclasses of SystemReader.

Also see [1] which fixed a similar problem with Gerrit's custom
SystemReader.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/225458

Change-Id: If54a2491932d8fc914d4649cb73c9e837c5b8ad0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate Orbit to S20190827152740 for 2019-09 RC1 52/148552/1
Matthias Sohn [Thu, 29 Aug 2019 07:41:27 +0000 (09:41 +0200)]
Update Orbit to S20190827152740 for 2019-09 RC1

Change-Id: I9cdd53de2d4045f96cfa8a1cb715401bb051bf44
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSilence warnings for non-externalized strings 51/148551/1
Matthias Sohn [Thu, 29 Aug 2019 07:21:04 +0000 (09:21 +0200)]
Silence warnings for non-externalized strings

These warnings were missed to address in a0048208 which introduced them.

Change-Id: Ia2d15fdce72c10378d020682b80fe7fc548c0d4c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.5.0-SNAPSHOT builds 40/148540/1
Matthias Sohn [Wed, 28 Aug 2019 19:14:09 +0000 (21:14 +0200)]
Prepare 5.5.0-SNAPSHOT builds

Change-Id: Ib498303c8787a5fbee89377eaed332a5a6b4f3b0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.5.0.201908280940-m3 20/148520/1 v5.5.0.201908280940-m3
Matthias Sohn [Wed, 28 Aug 2019 13:40:54 +0000 (15:40 +0200)]
JGit v5.5.0.201908280940-m3

Change-Id: I0920767979d7927bc18f3e395963aeebae5ea540
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "JGit pgm: make Blame more robust against bogus input"
David Pursehouse [Tue, 27 Aug 2019 02:14:05 +0000 (22:14 -0400)]
Merge "JGit pgm: make Blame more robust against bogus input"

5 years agoMerge "Apache HTTP: run more tests"
David Pursehouse [Mon, 26 Aug 2019 23:30:42 +0000 (19:30 -0400)]
Merge "Apache HTTP: run more tests"

5 years agoMerge "RevWalk: Traverse all parents of UNINTERESTING commits"
Jonathan Tan [Mon, 26 Aug 2019 23:05:41 +0000 (19:05 -0400)]
Merge "RevWalk: Traverse all parents of UNINTERESTING commits"

5 years agoRevWalk: Traverse all parents of UNINTERESTING commits 59/147659/10
Alex Spradlin [Tue, 13 Aug 2019 22:20:07 +0000 (15:20 -0700)]
RevWalk: Traverse all parents of UNINTERESTING commits

When firstParent is set, RevWalk traverses only the first parent of a
commit, even though that commit is UNINTERESTING. Since we want the
maximal UNINTERESTING set, we shouldn't prune any parents here. This
issue is apparent only when some of the commits being traversed are
unparsed, since walker.carryFlagsImpl() propagates the UNINTERESTING
flag to all parsed ancestors, masking the issue.

Therefore teach RevWalk to traverse all parents when a commit is
UNINTERESTING and not only the first parent. Since this issue is
masked by commit parsing, also test situations when the commits
involved are unparsed.

Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
Change-Id: I95e2ad9ae8f1f50fbecae674367ee7e0855519b1

5 years agoApache HTTP: run more tests 17/147517/3
Thomas Wolf [Sun, 11 Aug 2019 20:37:48 +0000 (22:37 +0200)]
Apache HTTP: run more tests

Factor out the test parameterization to use both connection factories
into a common super class and use it in more tests.

This made HttpClientTests.testV2HttpSubsequentResponse() fail for
Apache HTTP. The test used the pattern

  - create POST connection
  - setDoOutput(true)
  - connect()
  - write output stream
  - get & read input stream

This pattern is never used in JGit, which actually calls connect() only
in one case in LFS, and that's on a HEAD request.

The above pattern works on JDK, but fails on Apache HTTP because with
Apache HTTP a connect() actually executes the full request including
writing the entity. To work with Apache HTTP, the pattern would need
to be

  - create POST connection
  - setDoOutput(true)
  - write output stream
  - connect()
  - get & read input stream

which is fine for both. JDK connects implicitly in getOutputStream()
and treats the later explicit connect() as a no-op, and Apache works
because the entity is written when connect() is called.

Because JDK connects implicitly on getOutputStream(), the following
pattern also works with JDK:

  - create POST connection
  - setDoOutput(true)
  - write output stream
  - get & read input stream

Support this with Apache HTTP too: let getInputStream() execute
the request if it wasn't executed already.

Remove explicit connect() calls from test code, since JGit doesn't do
those either.

Change-Id: Ica038c00a7b8edcc01d5660d18e961146305b87f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoJGit pgm: make Blame more robust against bogus input 30/146930/3
Thomas Wolf [Thu, 1 Aug 2019 19:04:31 +0000 (21:04 +0200)]
JGit pgm: make Blame more robust against bogus input

Make the command die with proper messages when the revision
cannot be resolved or the file doesn't exist in the repository.
Previously the command would throw NPEs in these cases.

Bug: 490798
Change-Id: Ia457347aa22cf6bd2c2b6e7b9d705a66b3826307
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpdate Jetty to 9.4.20.v20190813 12/148312/1
Matthias Sohn [Sun, 25 Aug 2019 22:46:22 +0000 (00:46 +0200)]
Update Jetty to 9.4.20.v20190813

Bug: 550094
Change-Id: I2148f5ff7e60450dc7e023257560e2a77ce5c85a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDelete outdated Orbit target platform definitions 07/148307/2
Matthias Sohn [Sun, 25 Aug 2019 21:05:25 +0000 (23:05 +0200)]
Delete outdated Orbit target platform definitions

Keep the last release and the latest snapshot only.

Change-Id: I48dcc76e1b536f402e41c69fabb5ab46096f6c0a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate target platform to S20190819183153 (2019-09 M3) 06/148306/2
Matthias Sohn [Sun, 25 Aug 2019 21:01:38 +0000 (23:01 +0200)]
Update target platform to S20190819183153 (2019-09 M3)

* rename 4.12 staging to 4.12
* verified there are no version number changes between 4.12-staging and
new 4.12 final
* create 4.13-staging from former 4.12-staging
* update orbit to latest snapshot
* sort entries in S20190819183153.tpd

Change-Id: I1c3992b1dae2282a8c057e1453a6b63664d09207
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoExclude SecurityManagerTest from bazel test run 11/148311/1
Matthias Sohn [Sun, 25 Aug 2019 22:48:49 +0000 (00:48 +0200)]
Exclude SecurityManagerTest from bazel test run

Bazel uses a security manager to sandbox tests, it cannot handle another
security manager.

Change-Id: Id7dd11073178e5e65337414681c1c6e74e14cba7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' 88/148288/1
Matthias Sohn [Sun, 25 Aug 2019 09:58:14 +0000 (11:58 +0200)]
Merge branch 'stable-5.4'

* stable-5.4:
  Fix generation of surefire report during site generation

Change-Id: I2054dc67fc001910b66f395200c6796d4cef8ef3

5 years agoFix generation of surefire report during site generation 87/148287/1
Matthias Sohn [Sat, 24 Aug 2019 00:32:13 +0000 (02:32 +0200)]
Fix generation of surefire report during site generation

Change-Id: I29b1bcfe6cb1714e3dd0e8f5aa47c7f34f1d2fc9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAdd missing package dependency to org.junit.runners.model 86/148286/1
Matthias Sohn [Sun, 25 Aug 2019 09:35:34 +0000 (11:35 +0200)]
Add missing package dependency to org.junit.runners.model

b9d2926d missed to add this dependency used in
SeparateClassloaderTestRunner which broke the build in Eclipse.

Change-Id: I7ef79021ad41cabc9f2fa10ac6916eed2745d2c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "Fix error occurring when SecurityManager is enabled"
Matthias Sohn [Fri, 23 Aug 2019 20:59:03 +0000 (16:59 -0400)]
Merge "Fix error occurring when SecurityManager is enabled"

5 years agoMerge branch 'stable-5.4' 54/148254/2
Matthias Sohn [Fri, 23 Aug 2019 20:14:55 +0000 (22:14 +0200)]
Merge branch 'stable-5.4'

* stable-5.4:
  Prepare 5.4.3-SNAPSHOT builds
  JGit v5.4.2.201908231537-r
  Prepare 5.3.5-SNAPSHOT builds
  JGit v5.3.4.201908231101-r
  Prepare 5.1.11-SNAPSHOT builds
  JGit v5.1.10.201908230655-r
  Use AtomicReferences to cache user and system level configs
  Fix copy-paste typo in CloneCommand#cleanup
  SystemReader: Use correct constructor of FileBasedConfig

Change-Id: I241dd1314f5535147ad641576a25f49cae6fe62d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.4.3-SNAPSHOT builds 53/148253/2
Matthias Sohn [Fri, 23 Aug 2019 19:59:44 +0000 (21:59 +0200)]
Prepare 5.4.3-SNAPSHOT builds

Change-Id: Iaf5140446dcf86a50bdb1a30860dfd624d3ec337
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.4.2.201908231537-r 52/148252/1 v5.4.2.201908231537-r
Matthias Sohn [Fri, 23 Aug 2019 19:36:24 +0000 (21:36 +0200)]
JGit v5.4.2.201908231537-r

Change-Id: I1d808c63db81435173987c399c90bda7bc5c8d9d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix error occurring when SecurityManager is enabled 91/147791/8
Nail Samatov [Thu, 15 Aug 2019 17:15:40 +0000 (20:15 +0300)]
Fix error occurring when SecurityManager is enabled

It's expected that jgit should work without native git installation.
In such case Security Manager can be configured to deny access to the
files outside of git repository. JGit tries to find cygwin
installation. If Security manager restricts access to some folders
in PATH, it should be considered that those folders are absent
for jgit.
Also JGit tries to detect if symbolic links are supported by OS. If
security manager forbids creation of symlinks, it should be assumed
that symlinks aren't supported.

Bug: 550115
Change-Id: Ic4b243cada604bc1090db6cc1cfd74f0fa324b98
Signed-off-by: Nail Samatov <sanail@yandex.ru>
5 years agoMerge branch 'stable-5.3' into stable-5.4 46/148246/3
Matthias Sohn [Fri, 23 Aug 2019 15:55:14 +0000 (17:55 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.5-SNAPSHOT builds
  JGit v5.3.4.201908231101-r
  Prepare 5.1.11-SNAPSHOT builds
  JGit v5.1.10.201908230655-r
  Use AtomicReferences to cache user and system level configs
  Fix copy-paste typo in CloneCommand#cleanup
  SystemReader: Use correct constructor of FileBasedConfig

Change-Id: I4422632766fc5554a20f75346c5480b7fb611484
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.3.5-SNAPSHOT builds 45/148245/1
Matthias Sohn [Fri, 23 Aug 2019 15:38:11 +0000 (17:38 +0200)]
Prepare 5.3.5-SNAPSHOT builds

Change-Id: Ic0b9dfcac814ac7584e5eb19105f46344a10465a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.3.4.201908231101-r 44/148244/1 v5.3.4.201908231101-r
Matthias Sohn [Fri, 23 Aug 2019 15:01:29 +0000 (17:01 +0200)]
JGit v5.3.4.201908231101-r

Change-Id: Ia98f47d9a10d6b8cccca6b697230dad4f350d720
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 40/148240/2
Matthias Sohn [Fri, 23 Aug 2019 14:52:03 +0000 (16:52 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.11-SNAPSHOT builds
  JGit v5.1.10.201908230655-r
  Use AtomicReferences to cache user and system level configs
  Fix copy-paste typo in CloneCommand#cleanup

Change-Id: I3ababc0f9b540cf1785925395d32a85d30aed40d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 35/148235/1
Matthias Sohn [Fri, 23 Aug 2019 14:00:38 +0000 (16:00 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.11-SNAPSHOT builds
  JGit v5.1.10.201908230655-r
  Use AtomicReferences to cache user and system level configs
  Fix copy-paste typo in CloneCommand#cleanup

Change-Id: Ie383633de334e65901ed4c6deb2d59cfcce98e16

5 years agoPrepare 5.1.11-SNAPSHOT builds 31/148231/1
Matthias Sohn [Fri, 23 Aug 2019 13:47:03 +0000 (15:47 +0200)]
Prepare 5.1.11-SNAPSHOT builds

Change-Id: I8608580424d0e523dcace63f83ae530ba78dbb15
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.10.201908230655-r 18/148218/2 v5.1.10.201908230655-r
Matthias Sohn [Fri, 23 Aug 2019 10:52:08 +0000 (12:52 +0200)]
JGit v5.1.10.201908230655-r

Change-Id: I68d15ebd6054bdeaf62e14cddb87724828db7943
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUse AtomicReferences to cache user and system level configs 12/148112/6
Matthias Sohn [Thu, 22 Aug 2019 08:23:50 +0000 (10:23 +0200)]
Use AtomicReferences to cache user and system level configs

This ensures that only one instance of user and one instance of system
config is set.

Change-Id: Idd00150f91d2d40af79499dd7bf8ad5940f87c4e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix copy-paste typo in CloneCommand#cleanup 48/148148/3
Adrien Bustany [Thu, 22 Aug 2019 15:11:45 +0000 (17:11 +0200)]
Fix copy-paste typo in CloneCommand#cleanup

deleteChildren was called on directory instead of gitDir, leading to a
potential null pointer exception if the git directory existed initially.

Bug: 550340
Change-Id: Iafc3b2961253a99862a59e81c7371f7bc564b412
Signed-off-by: Adrien Bustany <adrien-xx-eclipse@bustany.org>
5 years agoSystemReader: Use correct constructor of FileBasedConfig 22/148122/1
David Pursehouse [Thu, 22 Aug 2019 10:23:55 +0000 (19:23 +0900)]
SystemReader: Use correct constructor of FileBasedConfig

The merge done in change If0c5010a2 resolved a conflict incorrectly
and reverted the fix that was done in change Id0bcdc93b.

Change-Id: I0f5fde33d1f366817f2b966eb42535f7bd3b063e
Reported-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.4' 91/148091/1
Matthias Sohn [Wed, 21 Aug 2019 20:39:34 +0000 (22:39 +0200)]
Merge branch 'stable-5.4'

* stable-5.4:
  Prepare 5.4.2-SNAPSHOT builds
  JGit v5.4.1.201908211225-r
  Prepare 5.3.4-SNAPSHOT builds
  JGit v5.3.3.201908210735-r
  Add missing @since tag on FileTreeIterator#getLastModifiedInstant
  Prepare 5.1.10-SNAPSHOT builds
  JGit v5.1.9.201908210455-r
  Avoid sign extension when comparing mtime with Instant#getEpochSecond
  Fix deprecation in DirCache caused by Instant based DirCacheEntry

Change-Id: I63156d6b73044d5d8820869a397a0aa94e607b50
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.4.2-SNAPSHOT builds 75/148075/1
Matthias Sohn [Wed, 21 Aug 2019 16:26:36 +0000 (18:26 +0200)]
Prepare 5.4.2-SNAPSHOT builds

Change-Id: I5b2fde2d69ef1cc11b085874ab783ba48e070470
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.4.1.201908211225-r 73/148073/1 v5.4.1.201908211225-r
Matthias Sohn [Wed, 21 Aug 2019 16:17:59 +0000 (18:17 +0200)]
JGit v5.4.1.201908211225-r

Change-Id: Ifa99b930bd20a9bc10696c414c73ebde0cd4b0c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 72/148072/1
Matthias Sohn [Wed, 21 Aug 2019 16:16:09 +0000 (18:16 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.4-SNAPSHOT builds
  JGit v5.3.3.201908210735-r
  Add missing @since tag on FileTreeIterator#getLastModifiedInstant
  Prepare 5.1.10-SNAPSHOT builds
  JGit v5.1.9.201908210455-r
  Avoid sign extension when comparing mtime with Instant#getEpochSecond
  Fix deprecation in DirCache caused by Instant based DirCacheEntry

Change-Id: Ic3c8d3adf522b73f87c713538a14697eb690f508
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.3.4-SNAPSHOT builds 71/148071/1
Matthias Sohn [Wed, 21 Aug 2019 15:45:59 +0000 (17:45 +0200)]
Prepare 5.3.4-SNAPSHOT builds

Change-Id: I1ccfeb28e87d13b25a8892947e62f1151130b6a6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.3.3.201908210735-r 70/148070/1 v5.3.3.201908210735-r
Matthias Sohn [Wed, 21 Aug 2019 11:30:43 +0000 (13:30 +0200)]
JGit v5.3.3.201908210735-r

Change-Id: I799859e47616af0ac5ee3a982cb9350d141681d7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 42/148042/1
Matthias Sohn [Wed, 21 Aug 2019 10:13:08 +0000 (12:13 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Add missing @since tag on FileTreeIterator#getLastModifiedInstant
  Prepare 5.1.10-SNAPSHOT builds
  JGit v5.1.9.201908210455-r
  Avoid sign extension when comparing mtime with Instant#getEpochSecond
  Fix deprecation in DirCache caused by Instant based DirCacheEntry

Change-Id: If6d5f4dfd9fc8e8c09e29aa11b1004057eafeb9f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 41/148041/1
Matthias Sohn [Wed, 21 Aug 2019 10:02:22 +0000 (12:02 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Add missing @since tag on FileTreeIterator#getLastModifiedInstant
  Prepare 5.1.10-SNAPSHOT builds
  JGit v5.1.9.201908210455-r
  Avoid sign extension when comparing mtime with Instant#getEpochSecond
  Fix deprecation in DirCache caused by Instant based DirCacheEntry

Change-Id: Id824c0b8b14dad5947ae9da1f90c3471e07b400f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAdd missing @since tag on FileTreeIterator#getLastModifiedInstant 37/148037/1
Matthias Sohn [Wed, 21 Aug 2019 09:52:20 +0000 (11:52 +0200)]
Add missing @since tag on FileTreeIterator#getLastModifiedInstant

Change-Id: I809399e6a71e0079d2f0007b0d3f00b531d451bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.10-SNAPSHOT builds 36/148036/2
Matthias Sohn [Wed, 21 Aug 2019 09:36:51 +0000 (11:36 +0200)]
Prepare 5.1.10-SNAPSHOT builds

Change-Id: If10afc8e663299a15db8c5fd0574fb51bf7e7ae9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.9.201908210455-r 29/148029/1 v5.1.9.201908210455-r
Matthias Sohn [Wed, 21 Aug 2019 08:52:10 +0000 (10:52 +0200)]
JGit v5.1.9.201908210455-r

Change-Id: Iaade207292acb8b27e01aca7e1af97ad7db1e854
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAvoid sign extension when comparing mtime with Instant#getEpochSecond 14/148014/1
Matthias Sohn [Tue, 20 Aug 2019 22:29:45 +0000 (00:29 +0200)]
Avoid sign extension when comparing mtime with Instant#getEpochSecond

Ensure we use the same type when comparing seconds since the epoch.

This does not prevent that in 2038 timestamps in seconds since the epoch
stored in a 32 bit integer will overflow. Integer.MAX_VALUE translates
to 2038-01-19T03:14:07Z. After this date we'll have an issue since we
store seconds since the epoch in a 32 bit integer in some places.

Bug: 319142
Change-Id: If0c03003d40b480f044686e2f7a2f62c9f4e2fe1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix deprecation in DirCache caused by Instant based DirCacheEntry 96/147996/2
Michael Keppler [Tue, 20 Aug 2019 14:09:12 +0000 (16:09 +0200)]
Fix deprecation in DirCache caused by Instant based DirCacheEntry

Replace the two int variables smudge_s and smudge_ns by an Instant and
use the new method DirCacheEntry.mightBeRacilyClean(Instant).

Change-Id: Id70adbb0856a64909617acf65da1bae8e2ae934a
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "UploadPack: support custom packfile-to-URI mapping"
Jonathan Tan [Tue, 20 Aug 2019 18:47:35 +0000 (14:47 -0400)]
Merge "UploadPack: support custom packfile-to-URI mapping"

5 years agoUploadPack: support custom packfile-to-URI mapping 93/139993/19
Jonathan Tan [Tue, 2 Apr 2019 17:08:24 +0000 (10:08 -0700)]
UploadPack: support custom packfile-to-URI mapping

Teach UploadPack to take a provider of URIs corresponding to cached
packs. When fetching, if the client supports the packfile-uri feature,
and if such a cached pack were to be streamed, instead send the
corresponding URI.

This packfile-uri feature is implemented in the jt/fetch-cdn-offload
branch of Git. There is interest in this feature [1], but it is not yet
merged.

[1] https://public-inbox.org/git/cover.1552073690.git.jonathantanmy@google.com/

Change-Id: I9a32dae131c9c56ad2ff4a8a9638ae3b5e44dc15
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
5 years agoExternalize error message in ReftableWriter#throwIllegalEntry 51/147951/1
Matthias Sohn [Mon, 19 Aug 2019 22:35:51 +0000 (00:35 +0200)]
Externalize error message in ReftableWriter#throwIllegalEntry

Also use MessageFormat as done elsewhere.

Change-Id: I36a4df9002310fa28321de9d325ee213f3cbd433
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' 50/147950/1
Matthias Sohn [Mon, 19 Aug 2019 22:15:58 +0000 (00:15 +0200)]
Merge branch 'stable-5.4'

* stable-5.4:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Upgrade tycho-extras to 1.4.0
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I709de5edb626536529a99220aae7751b127c9bff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 49/147949/1
Matthias Sohn [Mon, 19 Aug 2019 22:10:01 +0000 (00:10 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I43c2ab8b44c3e87d48e4072907ad169c81e3ffe0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 48/147948/1
Matthias Sohn [Mon, 19 Aug 2019 21:41:04 +0000 (23:41 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: If0c5010a2cf151ebebb2f2088fac3ee02c5007b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 35/147935/3
Matthias Sohn [Mon, 19 Aug 2019 15:52:02 +0000 (17:52 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix NPE in RebaseTodoFile#parseComments
  Fix NPE in ObjectIdOwnerMap#get
  Fix NPE in CommitOnlyTest#getHead
  FileUtils#lastModifiedInstant should not log error if path doesn't exist
  Cache user global and system-wide git configurations
  Avoid setup and saving FileStoreAttributes compete for ~/.gitconfig lock
  Add missing dependencies for running FS_POSIXTest in Eclipse
  Fix javadoc for SystemReader#getInstance
  Improve retry handling when saving FileStoreAttributes fails
  Ensure FSTest uses MockSystemReader
  Make supportsAtomicCreateNewFile return true as default
  Update orbit to R20190602212107-2019-06 to enable backports from master
  Handle InvalidPathException in FS_POSIX#createNewFileAtomic
  Ensure root cause of lock creation failures is logged
  Implement toString in MockSystemReader and MockConfig
  LocalDiskRefTreeDatabaseTest shall use MockSystemReader
  Ensure LocalDiskRepositoryTestCase#setup fully uses MockSystemReader
  Ensure we use MockSystemReader in tests
  Override FileBasedConfig's save method in MockConfig
  Remove FileBasedConfig.load(boolean) introduced in d45219ba
  Disable debug log for FS in org.eclipse.jgit.test
  Bazel: enable logging for tests in org.eclipse.jgit.test
  LockFile: log exception if creation of lock file failed
  Stop using deprecated Constants.CHARACTER_ENCODING

Change-Id: I48c585f3c9287be7d6ddb6b01a1955444e13fa31
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoreftable: increment pointer *after* reading uint16 81/147281/10
Han-Wen Nienhuys [Wed, 7 Aug 2019 21:28:32 +0000 (23:28 +0200)]
reftable: increment pointer *after* reading uint16

This fixes timezone reads out of the reflog.

Change-Id: I126d8742e5e904a074c544514180720466164f7c
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: test absense of prefix matching in Reflog 14/146814/15
Han-Wen Nienhuys [Tue, 30 Jul 2019 17:26:34 +0000 (19:26 +0200)]
reftable: test absense of prefix matching in Reflog

Change-Id: I6705e6c57a8c080b17c7b93fdd598cf44a9d91c2
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: enforce ordering for ref and log writes 99/146799/19
Han-Wen Nienhuys [Tue, 30 Jul 2019 14:54:31 +0000 (16:54 +0200)]
reftable: enforce ordering for ref and log writes

Previously, the API did not enforce ordering of writes.  Misuse of
this API would lead to data effectively being lost.

Guard against that with IllegalArgumentException, and add a test.

Change-Id: I04f55c481d60532fc64d35fa32c47037a03988ae
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: add some more comments 88/146788/13
Han-Wen Nienhuys [Mon, 19 Aug 2019 09:25:58 +0000 (11:25 +0200)]
reftable: add some more comments

Change-Id: I95208f7a05919b5019895cf41ae378c97da6e680
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: fix seeking to refs in reflog implementation 87/146787/8
Han-Wen Nienhuys [Mon, 29 Jul 2019 08:58:50 +0000 (10:58 +0200)]
reftable: fix seeking to refs in reflog implementation

Small reftables omit the log index. Currently,
ReftableWriter#shouldHaveIndex does this if there is a single-block
log, but other writers could decide on different criteria.

In the case that the log index is missing, we have to linearly search
for the right block. It is never appropriate to use binary search on
blocks for log data, as the blocks are compressed and therefore
irregularly sized.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: Id59874edf6bf45c7dec502d9465888e077ffe198

5 years agoFix NPE in RebaseTodoFile#parseComments 64/147864/10
Matthias Sohn [Fri, 16 Aug 2019 22:20:01 +0000 (00:20 +0200)]
Fix NPE in RebaseTodoFile#parseComments

Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix ApplyCommand which doesn't work if patch adds empty file 72/144072/6
Anton Khodos [Fri, 14 Jun 2019 15:16:15 +0000 (17:16 +0200)]
Fix ApplyCommand which doesn't work if patch adds empty file

Bug: 548219
Change-Id: Ibb32132a38e54508a24489322da58ddfd80a1d9a
Signed-off-by: Anton Khodos <khodosanton@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix NPE in ObjectIdOwnerMap#get 63/147863/8
Matthias Sohn [Fri, 16 Aug 2019 22:18:50 +0000 (00:18 +0200)]
Fix NPE in ObjectIdOwnerMap#get

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