]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoMerge branch 'stable-4.11' into stable-5.0 53/130653/2
Jonathan Nieder [Mon, 8 Oct 2018 23:41:15 +0000 (23:41 +0000)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  SubmoduleValidator: Remove unused import of ConfigConstants
  SubmoduleValidator: Permit missing path or url

Change-Id: Iaf3b994e763bd02054b820cd87fe68ff83675001
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 52/130652/2
Jonathan Nieder [Mon, 8 Oct 2018 23:40:47 +0000 (23:40 +0000)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  SubmoduleValidator: Remove unused import of ConfigConstants
  SubmoduleValidator: Permit missing path or url

Change-Id: Id74c837d6cb728439ccbd6ade71936b493c09e08
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 51/130651/2
Jonathan Nieder [Mon, 8 Oct 2018 23:40:05 +0000 (23:40 +0000)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  SubmoduleValidator: Remove unused import of ConfigConstants
  SubmoduleValidator: Permit missing path or url

Change-Id: Ib3c311f1e8d2db95510292a72f2f49825ffce9d9
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 64/130664/1
Jonathan Nieder [Mon, 8 Oct 2018 23:39:18 +0000 (23:39 +0000)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  SubmoduleValidator: Remove unused import of ConfigConstants

Change-Id: Id01fd9945e23a9343f96c42db89d5a1b302dad33
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 63/130663/1
Jonathan Nieder [Mon, 8 Oct 2018 23:38:59 +0000 (23:38 +0000)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  SubmoduleValidator: Remove unused import of ConfigConstants

Change-Id: I6a7d19602d6d9099928ee52de727743b9717f262
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoSubmoduleValidator: Remove unused import of ConfigConstants 62/130662/1
David Pursehouse [Mon, 8 Oct 2018 23:29:26 +0000 (08:29 +0900)]
SubmoduleValidator: Remove unused import of ConfigConstants

Change-Id: I6afe5690bf9d1f1f4d414aa618daefc8b48d217e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 50/130650/1
Jonathan Nieder [Mon, 8 Oct 2018 21:49:24 +0000 (21:49 +0000)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  SubmoduleValidator: Permit missing path or url

Change-Id: I989ac2c0c124c82385fc7cac7e0544ec225f7589
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 49/130649/1
Jonathan Nieder [Mon, 8 Oct 2018 21:49:09 +0000 (21:49 +0000)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  SubmoduleValidator: Permit missing path or url

Change-Id: I94fdaf45abbf7665f9eddc14b1a7f7144aafeadf
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoSubmoduleValidator: Permit missing path or url 76/130576/2
Jonathan Nieder [Sun, 7 Oct 2018 21:55:52 +0000 (21:55 +0000)]
SubmoduleValidator: Permit missing path or url

A .gitmodules file can include a submodule without a path to configure
the URL for a submodule that is only present on other branches.

A .gitmodules file can include a submodule with no URL and no path to
reserve the name for a submodule that existed in earlier history but
is not available from any URL any more.

"git fsck" permits both of these cases.  Permit them in JGit as well
(instead of throwing NullPointerException).

Change-Id: I3b442639ad79ea7a59227f96406a12e62d3573ae
Reported-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 49/130549/1
Jonathan Nieder [Sun, 7 Oct 2018 03:43:16 +0000 (03:43 +0000)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  ObjectChecker#getGitsubmodules: Fix malformed javadoc

Change-Id: If82e40c5a39b84c6a63e8cc10d168696c4eb3e91
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 48/130548/1
Jonathan Nieder [Sun, 7 Oct 2018 03:40:23 +0000 (03:40 +0000)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  ObjectChecker#getGitsubmodules: Fix malformed javadoc

Change-Id: Id2c8d1d4ffdf7bf18ef64479cfa1e959d9b2c37e
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 47/130547/1
Jonathan Nieder [Sun, 7 Oct 2018 03:39:32 +0000 (03:39 +0000)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  ObjectChecker#getGitsubmodules: Fix malformed javadoc

Change-Id: I847bdb9ef2b9e733c79489577b8b6e852ce6abf3
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 46/130546/1
Jonathan Nieder [Sun, 7 Oct 2018 03:37:46 +0000 (03:37 +0000)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  ObjectChecker#getGitsubmodules: Fix malformed javadoc

Change-Id: Ic73df5571e1ae86e5e026d0bf9d8e9e330cbfa97
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 45/130545/1
David Pursehouse [Sun, 7 Oct 2018 02:04:18 +0000 (11:04 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  ObjectChecker#getGitsubmodules: Fix malformed javadoc

Change-Id: I51ddd8fa1c2fbcabfb010bc4662d2c925563b55a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoObjectChecker#getGitsubmodules: Fix malformed javadoc 30/130530/2
David Pursehouse [Sat, 6 Oct 2018 08:51:28 +0000 (17:51 +0900)]
ObjectChecker#getGitsubmodules: Fix malformed javadoc

The text "<tree, blob>" with angle brackets should not be used in javadoc
since it is interpreted as an HTML tag and then rejected since it's not a
valid HTML tag. Wrap the text in a @literal tag.

Also add a missing space.

Change-Id: Ide045e8c04a39a916f5b2e964e58c151e4555830
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 99/130499/4
Matthias Sohn [Sat, 6 Oct 2018 12:44:12 +0000 (14:44 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.5-SNAPSHOT builds
  JGit v4.11.4.201810060650-r
  Fix configuration of maven-javadoc-plugin
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

* Fix configuration of maven-javadoc-plugin for site generation

Change-Id: Ic6ff8d324867ee41f15a5b890c7eee5092e8453e
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.11.5-SNAPSHOT builds 20/130520/2
Matthias Sohn [Sat, 6 Oct 2018 12:07:37 +0000 (14:07 +0200)]
Prepare 4.11.5-SNAPSHOT builds

Change-Id: Ifbe76e14264e8b547930e2320e8e81d728bd6e38
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.11.4.201810060650-r 19/130519/2 v4.11.4.201810060650-r
Matthias Sohn [Sat, 6 Oct 2018 10:50:29 +0000 (12:50 +0200)]
JGit v4.11.4.201810060650-r

Change-Id: I5700ebd341b6b997a7757b17e7d731c4ce608ec2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 35/130535/1
Matthias Sohn [Sat, 6 Oct 2018 09:00:09 +0000 (11:00 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix configuration of maven-javadoc-plugin

Change-Id: I80db074c45e840f15e227a400ef637b85084e711
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix configuration of maven-javadoc-plugin 31/130531/1
Matthias Sohn [Sat, 6 Oct 2018 08:55:47 +0000 (10:55 +0200)]
Fix configuration of maven-javadoc-plugin

Since maven-javadoc-plugin additionalJOption replaces additionalparam to
pass additional options to JavaDoc.

See https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#additionalJOption

Change-Id: Iddff5873520a181bcb9edf285b0c8db532e930ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 98/130498/3
Matthias Sohn [Sat, 6 Oct 2018 00:25:17 +0000 (02:25 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ibd759f5d425f714e79b3137ff8e5b0f989933de0
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 97/130497/3
Matthias Sohn [Fri, 5 Oct 2018 23:52:38 +0000 (01:52 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.7-SNAPSHOT builds
  JGit v4.9.6.201810051924-r
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ie59e34eb591a827d1ce8e483eec6d390a3c81702
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.9.7-SNAPSHOT builds 18/130518/1
Matthias Sohn [Fri, 5 Oct 2018 23:32:40 +0000 (01:32 +0200)]
Prepare 4.9.7-SNAPSHOT builds

Change-Id: I20e7bd6bdebcdb55a8c771314759bd8f98f04ef6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.9.6.201810051924-r 16/130516/1 v4.9.6.201810051924-r
Matthias Sohn [Fri, 5 Oct 2018 23:24:42 +0000 (01:24 +0200)]
JGit v4.9.6.201810051924-r

Change-Id: Ib39aaae26da17aa37d654b24c1defd45126f4ea2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 96/130496/3
Matthias Sohn [Fri, 5 Oct 2018 23:16:08 +0000 (01:16 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Ia7a826399d8d5b8a0eb7169b40e98a6f5c207a4c
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 95/130495/3
Matthias Sohn [Fri, 5 Oct 2018 23:03:20 +0000 (01:03 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.6-SNAPSHOT builds
  JGit v4.7.5.201810051826-r
  BaseReceivePack: Validate incoming .gitmodules files
  ObjectChecker: Report .gitmodules files found in the pack
  SubmoduleAddCommand: Reject submodule URIs that look like cli options

Change-Id: Id6fabec4d0b682a7e20a46e88cbc05432efca062
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.7.6-SNAPSHOT builds 15/130515/1
Matthias Sohn [Fri, 5 Oct 2018 22:36:30 +0000 (00:36 +0200)]
Prepare 4.7.6-SNAPSHOT builds

Change-Id: I99b59116999742d8d6cdba26287ea7c6eba11a30
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.7.5.201810051826-r 14/130514/1 v4.7.5.201810051826-r
Matthias Sohn [Fri, 5 Oct 2018 22:27:38 +0000 (00:27 +0200)]
JGit v4.7.5.201810051826-r

Change-Id: I60c7a2eff3dab5083f71df0d9465a4e94b5e2513
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoBaseReceivePack: Validate incoming .gitmodules files 94/130494/6
Ivan Frade [Mon, 1 Oct 2018 20:44:00 +0000 (13:44 -0700)]
BaseReceivePack: Validate incoming .gitmodules files

The main concern are submodule urls starting with '-' that could pass as
options to an unguarded tool.

Pass through the parser the ids of blobs identified as .gitmodules
files in the ObjectChecker. Load the blobs and parse/validate them
in SubmoduleValidator.

Change-Id: Ia0cc32ce020d288f995bf7bc68041fda36be1963
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoObjectChecker: Report .gitmodules files found in the pack 93/130493/3
Ivan Frade [Thu, 27 Sep 2018 20:05:13 +0000 (13:05 -0700)]
ObjectChecker: Report .gitmodules files found in the pack

In order to validate .gitmodules files, we first need to find them
in the incoming pack.

Do it in the ObjectChecker stage. Check in the tree objects if they
point to a .gitmodules file and report the tree id and the .gitmodules
blob id.

This can be used later to check if the file is in the root of the
project and if the contents are good.

While we're here, make isMacHFSGit more accurate by detecting variants
of filenames that vary in case.

[jn: tweaked NTFS and HFS+ checking; added more tests]

Change-Id: I70802e7d2c1374116149de4f89836b9498f39582
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSubmoduleAddCommand: Reject submodule URIs that look like cli options 92/130492/3
Ivan Frade [Mon, 24 Sep 2018 23:03:35 +0000 (16:03 -0700)]
SubmoduleAddCommand: Reject submodule URIs that look like cli options

In C git versions before 2.19.1, the submodule is fetched by running
"git clone <uri> <path>". A URI starting with "-" would be interpreted
as an option, causing security problems. See CVE-2018-17456.

Refuse to add submodules with URIs, names or paths starting with "-",
that could be confused with command line arguments.

[jn: backported to JGit 4.7.y, bringing portions of Masaya Suzuki's
 dotdot check code in v5.1.0.201808281540-m3~57 (Add API to specify
 the submodule name, 2018-07-12) along for the ride]

Change-Id: I2607c3acc480b75ab2b13386fe2cac435839f017
Signed-off-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 62/129962/1
David Pursehouse [Tue, 25 Sep 2018 23:18:51 +0000 (08:18 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Icacfa8dcd1ced32715fb772c336574318f28ddd1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 61/129961/1
David Pursehouse [Tue, 25 Sep 2018 23:18:23 +0000 (08:18 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: I2ab21595531bcd487ce6a5cb0a3bc3c6f6f6e518
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 60/129960/1
David Pursehouse [Tue, 25 Sep 2018 23:17:54 +0000 (08:17 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: I3dff04d2ea99e5b6331e45e3ea2ccc78fb2d5a02
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 59/129959/1
David Pursehouse [Tue, 25 Sep 2018 23:17:26 +0000 (08:17 +0900)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Ie3de769209ec8477c97df5f90b8c63c03e023be0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 58/129958/1
David Pursehouse [Tue, 25 Sep 2018 23:16:47 +0000 (08:16 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  ObjectDownloadListener#onWritePossible: Add comment on return statement

Change-Id: Id0833112b0be4e78af375ee1fc78287743d7bc4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoObjectDownloadListener#onWritePossible: Add comment on return statement 98/129898/2
David Ostrovsky [Tue, 25 Sep 2018 06:20:57 +0000 (08:20 +0200)]
ObjectDownloadListener#onWritePossible: Add comment on return statement

It is not obvious why this return statement is needed. Clarify with a
comment that otherwise endless loop may show up when recent versions
of Jetty are used.

Change-Id: I8e5d4de51869fb1179bf599bfb81bcd7d745874b
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
6 years agoMerge branch 'stable-4.11' into stable-5.0 45/129645/1
Matthias Sohn [Tue, 18 Sep 2018 14:50:51 +0000 (16:50 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.4-SNAPSHOT builds
  JGit v4.11.3.201809181037-r
  Prepare 4.9.6-SNAPSHOT builds
  JGit v4.9.5.201809180939-r
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I3f43af45a4c9023f0e8638fa1920db5d69276502
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.11.4-SNAPSHOT builds 44/129644/1
Matthias Sohn [Tue, 18 Sep 2018 14:46:18 +0000 (16:46 +0200)]
Prepare 4.11.4-SNAPSHOT builds

Change-Id: Id2f83eb3b2070637997cfece59f4f15698267908
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.11.3.201809181037-r 43/129643/1 v4.11.3.201809181037-r
Matthias Sohn [Tue, 18 Sep 2018 14:36:53 +0000 (16:36 +0200)]
JGit v4.11.3.201809181037-r

Change-Id: I6b57b02e41f02916127b1866d573a634d6f6d796
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 39/129639/1
Matthias Sohn [Tue, 18 Sep 2018 14:06:26 +0000 (16:06 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.6-SNAPSHOT builds
  JGit v4.9.5.201809180939-r
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I6633f1e147444385c999a6ff1d443b8a07d08bfc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 37/129637/1
Matthias Sohn [Tue, 18 Sep 2018 14:02:22 +0000 (16:02 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I19b9be956b4e9bb1bba303ad879baac250988e8e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.9.6-SNAPSHOT builds 34/129634/1
Matthias Sohn [Tue, 18 Sep 2018 13:55:12 +0000 (15:55 +0200)]
Prepare 4.9.6-SNAPSHOT builds

Change-Id: I9fb8f6cc45409e0884b898187323ac91953754c3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.9.5.201809180939-r 33/129633/1 v4.9.5.201809180939-r
Matthias Sohn [Tue, 18 Sep 2018 13:44:16 +0000 (15:44 +0200)]
JGit v4.9.5.201809180939-r

Change-Id: I36199607f3ec6e8bb841e9d9eade12251312447c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 32/129632/1
Matthias Sohn [Tue, 18 Sep 2018 13:33:00 +0000 (15:33 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: Ic353f93864ca4aec315f398f5c3e047dcda23125
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 26/129626/1
Matthias Sohn [Tue, 18 Sep 2018 13:20:57 +0000 (15:20 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.5-SNAPSHOT builds
  JGit v4.7.4.201809180905-r
  Update API problem filter

Change-Id: I9a9abcd2e48e19295d537241c951308cd0210019
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.7.5-SNAPSHOT builds 23/129623/1
Matthias Sohn [Tue, 18 Sep 2018 13:16:36 +0000 (15:16 +0200)]
Prepare 4.7.5-SNAPSHOT builds

Change-Id: Ifce4311fe9429d751cec5b326b540d6233762153
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.7.4.201809180905-r 22/129622/1 v4.7.4.201809180905-r
Matthias Sohn [Tue, 18 Sep 2018 13:05:11 +0000 (15:05 +0200)]
JGit v4.7.4.201809180905-r

Change-Id: Iceee69df5fd593bece4532d5781e3771f5761ef8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate API problem filter 21/129621/1
Matthias Sohn [Tue, 18 Sep 2018 13:03:40 +0000 (15:03 +0200)]
Update API problem filter

Change-Id: Ie15c7d0b320f75915c362f5bd3bd6b39d84a900a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 87/129587/1
David Pursehouse [Tue, 18 Sep 2018 00:18:34 +0000 (09:18 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Iffe202a412b3bca1c8d8d7dc5dfd646c49838de9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 86/129586/1
David Pursehouse [Tue, 18 Sep 2018 00:16:58 +0000 (09:16 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: I28ebf6138ccd9425fc05319de78c7716f0bdd199
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 85/129585/1
David Pursehouse [Tue, 18 Sep 2018 00:16:26 +0000 (09:16 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Ib7d01cb0ece8b259156855045a53b8baf3fa2968
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 84/129584/1
David Pursehouse [Tue, 18 Sep 2018 00:15:57 +0000 (09:15 +0900)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Id8eb635094336567d9f3c28ec985cd5127d31632
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 81/129581/2
David Pursehouse [Tue, 18 Sep 2018 00:15:02 +0000 (09:15 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Fix ObjectUploadListener#close
  Fix error handling in FileLfsServlet
  ObjectDownloadListener#onWritePossible: Make code spec compatible
  ObjectDownloadListener: Return from onWritePossible when data is written
  Fix IOException when LockToken#close fails

Change-Id: Iad9836811be034cf992ea25dad4409addba75115
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix ObjectUploadListener#close 82/129582/1
Matthias Sohn [Mon, 17 Sep 2018 23:14:34 +0000 (01:14 +0200)]
Fix ObjectUploadListener#close

Do not try to set response status if response is already committed.

Change-Id: I9a7c2871c86eb53416b905324775f3ed961c8ae6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix error handling in FileLfsServlet 02/129502/2
Matthias Sohn [Sun, 16 Sep 2018 22:35:33 +0000 (00:35 +0200)]
Fix error handling in FileLfsServlet

Check in #sendError method if the response was committed already.

If yes we cannot set response status or send an error message, last
resort is to close the outputstream.

If the response wasn't yet committed first reset the response before
using writer to send the error message to the client since mixing STREAM
and WRITE mode (mixing asynchronous and blocking I/O) is illegal in
servlet 3.1.

see the following bugs in the gerrit and jetty issue trackers
https://bugs.chromium.org/p/gerrit/issues/detail?id=9667
https://bugs.chromium.org/p/gerrit/issues/detail?id=9721
https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Ie35563c2e0ac1c5e918185a746622589a880dc7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoObjectDownloadListener#onWritePossible: Make code spec compatible 01/129501/6
David Ostrovsky [Sat, 15 Sep 2018 19:09:51 +0000 (21:09 +0200)]
ObjectDownloadListener#onWritePossible: Make code spec compatible

Current code violates the ServletOutputStream contract. For every
out.isReady() == true either write or close of that ServletOutputStream
should be called.

See also this issue upstream for more context: [1].

[1] https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Ied575f3603a6be0d2dafc6c3329d685fc212c7a3
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoObjectDownloadListener: Return from onWritePossible when data is written 73/129473/3
David Ostrovsky [Sat, 15 Sep 2018 19:09:51 +0000 (21:09 +0200)]
ObjectDownloadListener: Return from onWritePossible when data is written

When buffer was written not only call AsyncContext#complete() but also
return from the ObjectDownloadListener#onWritePossible(). This avoids
endless loop after upgrading from Jetty 9.3.x to 9.4.x lines.

In Jetty example implementation:[1] the return statemnt is also used:

  // If we are at EOF then complete
  if (len < 0)
  {
    async.complete();
    return;
  }

See also this issue upstream: [2].

[1] https://webtide.com/servlet-3-1-async-io-and-jetty
[2] https://github.com/eclipse/jetty.project/issues/2911

Change-Id: Iac73fb25e67d40228a378a8e34103f1d28b72a76
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
6 years agoFix IOException when LockToken#close fails 60/129460/3
Matthias Sohn [Sat, 15 Sep 2018 00:35:03 +0000 (02:35 +0200)]
Fix IOException when LockToken#close fails

This happened if the LockTokens hard link was already deleted earlier.

Bug: 531759
Change-Id: Idc84bd695fac1a763b3cbb797c9c4c636a16e329
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 13/129213/1
David Pursehouse [Wed, 12 Sep 2018 10:03:26 +0000 (19:03 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: Ic7eaa0b6a4e750bc7853eb549a9e126269ae22cf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 99/129199/1
David Pursehouse [Wed, 12 Sep 2018 08:02:09 +0000 (17:02 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I191d56e3c0f11cf53076b06c7e7a05492c7a03f1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 96/129196/1
David Pursehouse [Wed, 12 Sep 2018 07:38:48 +0000 (16:38 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: Ied2d7a70c5544ff012687a1aeb6e07394d9bd6fd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 95/129195/1
David Pursehouse [Wed, 12 Sep 2018 06:55:07 +0000 (15:55 +0900)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I5e6cc35f3673545e7ff857e6ed0bcd2c44e50316
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 86/129186/1
David Pursehouse [Wed, 12 Sep 2018 05:05:46 +0000 (14:05 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Fix NoSuchFileException during directory cleanup in RefDirectory
  Externalize warning message in RefDirectory.delete()
  Suppress warning for trying to delete non-empty directory

Change-Id: I9ec6352b5ff57aa1a3380079dc9165890cc76d49
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix NoSuchFileException during directory cleanup in RefDirectory 84/129184/1
Matthias Sohn [Sun, 26 Aug 2018 23:13:38 +0000 (01:13 +0200)]
Fix NoSuchFileException during directory cleanup in RefDirectory

Bug: 538285
Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 8ab89ef066f91a7d39b705f4e61498f37291ffab)
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoExternalize warning message in RefDirectory.delete() 75/129075/1
Matthias Sohn [Thu, 23 Aug 2018 09:44:28 +0000 (11:44 +0200)]
Externalize warning message in RefDirectory.delete()

Change-Id: Icec16c01853a3f5ea016d454b3d48624498efcce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 5e68fe245fb97f38620ea683dbeab724bf86da4c)
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSuppress warning for trying to delete non-empty directory 74/129074/1
Thomas Wolf [Sun, 19 Aug 2018 18:48:06 +0000 (20:48 +0200)]
Suppress warning for trying to delete non-empty directory

This is actually a fairly common occurrence; deleting the parent
directories can work only if the file deleted was the last one
in the directory.

Bug: 537872
Change-Id: I86d1d45e1e2631332025ff24af8dfd46c9725711
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
(cherry picked from commit d9e767b431eae7978613cc8e0ade7467ec04376c)
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 68/129068/1
Matthias Sohn [Mon, 10 Sep 2018 19:29:46 +0000 (21:29 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.3-SNAPSHOT builds
  JGit v4.11.2.201809100523-r

Change-Id: I8a6f2667f9e43d53e995554224c2a538d1959996
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.11.3-SNAPSHOT builds 35/129035/1
Matthias Sohn [Mon, 10 Sep 2018 11:13:19 +0000 (13:13 +0200)]
Prepare 4.11.3-SNAPSHOT builds

Change-Id: I4f5dda6da3f6ecd9b99c1d9a220844c5402f1988
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.11.2.201809100523-r 34/129034/1 v4.11.2.201809100523-r
Matthias Sohn [Mon, 10 Sep 2018 09:24:32 +0000 (11:24 +0200)]
JGit v4.11.2.201809100523-r

Change-Id: I85dab173a94b3036ccf669c20b9dffb4af0922b4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 5.0.4-SNAPSHOT builds 91/128991/1
Matthias Sohn [Sun, 9 Sep 2018 15:28:59 +0000 (17:28 +0200)]
Prepare 5.0.4-SNAPSHOT builds

Change-Id: Ib9042662c3f2a1544d597d476c5952c61767687b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v5.0.3.201809091024-r 89/128989/1 v5.0.3.201809091024-r
Matthias Sohn [Sun, 9 Sep 2018 14:24:44 +0000 (16:24 +0200)]
JGit v5.0.3.201809091024-r

Change-Id: I9e8e74a10dbb235b08c6a5e1b169c5cae440f129
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 88/128988/1
Matthias Sohn [Sun, 9 Sep 2018 13:49:32 +0000 (15:49 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.9.5-SNAPSHOT builds
  JGit v4.9.4.201809090327-r
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: Ia72fc409f0262565cf31b8bc62737c78fc4c3485
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 87/128987/1
Matthias Sohn [Sun, 9 Sep 2018 13:44:44 +0000 (15:44 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.5-SNAPSHOT builds
  JGit v4.9.4.201809090327-r
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: I8e962758973753fe7baffd959050593a059ee44e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 86/128986/1
Matthias Sohn [Sun, 9 Sep 2018 13:43:04 +0000 (15:43 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.5-SNAPSHOT builds
  JGit v4.9.4.201809090327-r
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: I78099d2a5ba895273ca3ac587c7aa5f3f43fe869
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.9.5-SNAPSHOT builds 78/128978/1
Matthias Sohn [Sun, 9 Sep 2018 07:36:35 +0000 (09:36 +0200)]
Prepare 4.9.5-SNAPSHOT builds

Change-Id: Ie8d2b60be1803399027e1a3e9734625278a63861
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.9.4.201809090327-r 77/128977/1 v4.9.4.201809090327-r
Matthias Sohn [Sun, 9 Sep 2018 07:29:05 +0000 (09:29 +0200)]
JGit v4.9.4.201809090327-r

Change-Id: I13488a915fe0ba871c5f37c6e9efc6f436083171
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 76/128976/1
Matthias Sohn [Sun, 9 Sep 2018 07:23:51 +0000 (09:23 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Fix @since tag for LOCK_SUFFIX
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: Id3c85149316cbe671e55f41438bd3a3a892b4ed0

6 years agoMerge branch 'stable-4.7' into stable-4.8 75/128975/1
Matthias Sohn [Sun, 9 Sep 2018 06:48:59 +0000 (08:48 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.4-SNAPSHOT builds
  JGit v4.7.3.201809090215-r

Change-Id: I980807ad4701f9e510354b505c9556e123f32471
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix @since tag for LOCK_SUFFIX 74/128974/1
Matthias Sohn [Sun, 9 Sep 2018 06:46:11 +0000 (08:46 +0200)]
Fix @since tag for LOCK_SUFFIX

Change-Id: Ia65cf3f12ec6d35a21b4d9332be912f06d8bf834
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.7.4-SNAPSHOT builds 72/128972/1
Matthias Sohn [Sun, 9 Sep 2018 06:24:16 +0000 (08:24 +0200)]
Prepare 4.7.4-SNAPSHOT builds

Change-Id: Ie4d17e1604270946606e75145012c5b7fa1283eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.7.3.201809090215-r 71/128971/1 v4.7.3.201809090215-r
Matthias Sohn [Sun, 9 Sep 2018 06:15:48 +0000 (08:15 +0200)]
JGit v4.7.3.201809090215-r

Change-Id: I1ded7a2b61235509c5a6ba95e7329e288bbfddb1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 50/128950/1
Matthias Sohn [Sat, 8 Sep 2018 09:06:28 +0000 (11:06 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: Ifcc8bfab4fd05c18a08dd82588860dffd0e6d726
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 49/128949/1
Matthias Sohn [Sat, 8 Sep 2018 08:05:36 +0000 (10:05 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: Ie86079d9ad76972306bc80e63d8bfe18ae06a0da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 48/128948/1
Matthias Sohn [Sat, 8 Sep 2018 07:18:19 +0000 (09:18 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: I32dc651870b7ba7c88de448c7984134b7c99e7e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 47/128947/1
Matthias Sohn [Sat, 8 Sep 2018 07:02:08 +0000 (09:02 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: Id7f68f4e8fb07a21737e3b7090f600507a13bbbe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 46/128946/2
Matthias Sohn [Sat, 8 Sep 2018 05:19:13 +0000 (07:19 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Fix atomic lock file creation on NFS
  Use constant for ".lock"
  Fix handling of option core.supportsAtomicCreateNewFile
  GC: Avoid logging errors when deleting non-empty folders

Change-Id: Ia7a18f69eee173aec9e462c16eee2b0ca4565e76
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix atomic lock file creation on NFS 91/128091/8
Matthias Sohn [Sun, 26 Aug 2018 17:44:29 +0000 (19:44 +0200)]
Fix atomic lock file creation on NFS

FS_POSIX.createNewFile(File) failed to properly implement atomic file
creation on NFS using the algorithm [1]:
- name of the hard link must be unique to prevent that two processes
  using different NFS clients try to create the same link. This would
  render nlink useless to detect if there was a race.
- the hard link must be retained for the lifetime of the file since we
  don't know when the state of the involved NFS clients will be
  synchronized. This depends on NFS configuration options.

To fix these issues we need to change the signature of createNewFile
which would break API. Hence deprecate the old method
FS.createNewFile(File) and add a new method createNewFileAtomic(File).

The new method returns a LockToken which needs to be retained by the
caller (LockFile) until all involved NFS clients synchronized their
state. Since we don't know when the NFS caches are synchronized we need
to retain the token until the corresponding file is no longer needed.
The LockToken must be closed after the LockFile using it has been
committed or unlocked. On Posix, if core.supportsAtomicCreateNewFile =
false this will delete the hard link which guarded the atomic creation
of the file. When acquiring the lock fails ensure that the hard link is
removed.

[1] https://www.time-travellers.org/shane/papers/NFS_considered_harmful.html
also see file creation flag O_EXCL in
http://man7.org/linux/man-pages/man2/open.2.html

Change-Id: I84fcb16143a5f877e9b08c6ee0ff8fa4ea68a90d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUse constant for ".lock" 89/128889/2
Matthias Sohn [Fri, 8 Jun 2018 15:22:54 +0000 (17:22 +0200)]
Use constant for ".lock"

(cherry picked from commit 5f27032fb85694a093f827581216d4ffb99db68b)

Change-Id: I6bc0e9a910b110418a82d8e574fb2aecc3a31d6a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix handling of option core.supportsAtomicCreateNewFile 76/128876/1
Christian Halstrick [Fri, 17 Aug 2018 15:46:09 +0000 (17:46 +0200)]
Fix handling of option core.supportsAtomicCreateNewFile

When core.supportsAtomicCreateNewFile was set to false and the
repository was located on a filesystem which doesn't support the file
attribute "unix:nlink" then FS_POSIX#createNewFile may report an error
even if everything was ok. Modify FS_POSIX#createNewFile to silently
ignore this situation. An example of such a filesystem is sshfs where
reading "unix:nlink" always returns 1 (instead of throwing a exception).

Bug: 537969
Change-Id: I6deda7672fa7945efa8706ea1cd652272604ff19
Also-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoGC: Avoid logging errors when deleting non-empty folders 54/128654/2
Hector Caballero [Tue, 4 Sep 2018 15:15:44 +0000 (11:15 -0400)]
GC: Avoid logging errors when deleting non-empty folders

I88304d34c and Ia555bce00 modified the way errors are handled when
trying to delete non-empty reference folders. Before, this error was
silently ignored as it was considered an expected output. Now, every
failed folder delete is logged which can be noisy.

Ignore the DirectoryNotEmptyException but log any other error avoiding
deletion of an eligible folder.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: I194512f67885231d62c03976ae683e5cc450ec7c

6 years agoMerge branch 'stable-4.11' into stable-5.0 07/128407/1
David Pursehouse [Fri, 31 Aug 2018 06:44:15 +0000 (15:44 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I5ebb1058927ea5a478eae9e44b7d96f123a22523
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 04/128404/1
David Pursehouse [Fri, 31 Aug 2018 06:21:10 +0000 (15:21 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I500dd4e63302abb19ad669988b3a427cef8ef3d4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 03/128403/1
David Pursehouse [Fri, 31 Aug 2018 04:57:40 +0000 (13:57 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I37e936de0c06d4b9f17724ac4f1feb83f6c15ae3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 02/128402/1
David Pursehouse [Fri, 31 Aug 2018 04:08:29 +0000 (13:08 +0900)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I17436237cd66ca1c2800ad5ab0142f4a2bc07328
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 01/128401/1
David Pursehouse [Fri, 31 Aug 2018 00:24:57 +0000 (09:24 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I414ade902dc38b696c566dd604000e3d289f3973
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoBazel: Use hyphen instead of underscore in external repository names 54/128354/1
David Pursehouse [Wed, 29 Aug 2018 23:48:41 +0000 (08:48 +0900)]
Bazel: Use hyphen instead of underscore in external repository names

Recent Bazel versions support the hyphen character in external
repository names. On the Gerrit project, the repository names
were harmonized to consistently use hyphen.

As a side effect, it is no longer possible to build jgit from source
in the gerrit tree, due to the different repository names.

Rename the dependencies to use hyphens, consistent with gerrit.

Change-Id: Ideebd858ddd3f0e6f765643001642dfb6c12441f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoBazel: Format all build files with buildifier 0.15.0 53/128353/1
David Pursehouse [Thu, 30 Aug 2018 06:27:20 +0000 (15:27 +0900)]
Bazel: Format all build files with buildifier 0.15.0

Change-Id: I8343b723da6e40d5ae7fc45c84f64c31276bd5dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoChangeIdUtilTest: Remove unused notestCommitDashV 51/128351/1
David Pursehouse [Sat, 30 Sep 2017 09:56:42 +0000 (10:56 +0100)]
ChangeIdUtilTest: Remove unused notestCommitDashV

This test was never being run. Since it was introduced it was
named "notest.." which meant it didn't run with JUnit3, and
since it is not annotated @Test it also doesn't run with JUnit4.

When compiling with Bazel 0.6.0, error-prone raises an error
that the public method is not annotated with @Ignore or @Test.

Given that the test has never been run anyway, we can just
remove it.

Bug: 525415
Change-Id: Ie9a54f89fe42e0c201f547ff54ff1d419ce37864
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFix NoSuchFileException in GC.deleteTempPacksIdx() 95/128095/2
Matthias Sohn [Sun, 26 Aug 2018 23:20:31 +0000 (01:20 +0200)]
Fix NoSuchFileException in GC.deleteTempPacksIdx()

This exception is thrown in GC.deleteTempPacksIdx() if the repository
has no packs.

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