]> source.dussan.org Git - jgit.git/log
jgit.git
3 years agoRemove texts which were added by mistake in 00386272 87/180487/1
Matthias Sohn [Tue, 11 May 2021 16:37:37 +0000 (18:37 +0200)]
Remove texts which were added by mistake in 00386272

Change-Id: Iaed25dac0bc9af8f3fda6138a5f9fe553bff5d39
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFix formatting which was broken in 00386272 86/180486/1
Matthias Sohn [Tue, 11 May 2021 16:36:05 +0000 (18:36 +0200)]
Fix formatting which was broken in 00386272

Change-Id: I10a3e2b117e790f64386a8e9e7663db8e59230d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoLockFile: create OutputStream only when needed 32/180432/1
Thomas Wolf [Tue, 4 May 2021 21:48:56 +0000 (23:48 +0200)]
LockFile: create OutputStream only when needed

Don't create the stream eagerly in lock(); that may cause JGit to
exceed OS or JVM limits on open file descriptors if many locks need
to be created, for instance when creating many refs. Instead create
the output stream only when one really needs to write something.

Bug: 573328
Change-Id: If9441ed40494d46f594a896d34a5c4f56f91ebf4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.5' into stable-5.6 31/173231/1
Matthias Sohn [Wed, 2 Dec 2020 14:21:10 +0000 (15:21 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Prepare 5.3.10-SNAPSHOT builds
  JGit v5.3.9.202012012026-r
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: I986029816ef66fbfae1a59bd97179392320a485c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 30/173230/1
Matthias Sohn [Wed, 2 Dec 2020 14:15:58 +0000 (15:15 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.3.10-SNAPSHOT builds
  JGit v5.3.9.202012012026-r
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: Iede8686198332d6271771bef6eb00c25f1103979
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.3' into stable-5.4 27/173227/1
Matthias Sohn [Wed, 2 Dec 2020 13:26:26 +0000 (14:26 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.10-SNAPSHOT builds
  JGit v5.3.9.202012012026-r
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: I319b54ceffe095add60420c6ae83eac0ba9c14b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.3.10-SNAPSHOT builds 25/173225/1
Matthias Sohn [Wed, 2 Dec 2020 12:09:57 +0000 (13:09 +0100)]
Prepare 5.3.10-SNAPSHOT builds

Change-Id: I6f131ad04574bd0d569ae6a59c29ea987be0efb2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.3.9.202012012026-r 89/173189/1 v5.3.9.202012012026-r
Matthias Sohn [Wed, 2 Dec 2020 01:27:44 +0000 (02:27 +0100)]
JGit v5.3.9.202012012026-r

Change-Id: I75e03ef8630d7a369e97be0f797253b968575354
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.2' into stable-5.3 88/173188/1
Matthias Sohn [Wed, 2 Dec 2020 01:18:51 +0000 (02:18 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: If1d8034b5e0cbc004a11a31b228cb5732efb390d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.1' into stable-5.2 87/173187/1
Matthias Sohn [Wed, 2 Dec 2020 01:17:27 +0000 (02:17 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently

Change-Id: Id83e29e567646a3945a5b817860ea8f7c3e6e5cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.1.16-SNAPSHOT builds 86/173186/1
Matthias Sohn [Wed, 2 Dec 2020 01:02:48 +0000 (02:02 +0100)]
Prepare 5.1.16-SNAPSHOT builds

Change-Id: I50e59e1e73a92fa4fe366398fb8141f5e2e289c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.1.15.202012011955-r 85/173185/1 v5.1.15.202012011955-r
Matthias Sohn [Wed, 2 Dec 2020 00:53:39 +0000 (01:53 +0100)]
JGit v5.1.15.202012011955-r

Change-Id: Icb4f04a40ab366cbacbb3fdf0db1748f27277fda
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFix PackInvalidException when fetch and repack run concurrently 40/173040/4
Petr Hrebejk [Mon, 30 Nov 2020 19:19:53 +0000 (20:19 +0100)]
Fix PackInvalidException when fetch and repack run concurrently

We are running several servers with jGit. We need to run repack from
time to time to keep the repos performant. I.e. after push we test how
many small packs are in the repo and when a threshold is reached we run
the repack.

After upgrading jGit version we've found that if someone does the clone
at the time repack is running the clone sometimes (not always) fails
because the repack removes .pack file used by the clone. Server
exception and client error attached.

I've tracked down the cause and it seems to be introduced between jGit
5.2 (which we upgraded from) and 5.3 and being caused by this commit:
Move throw of PackInvalidException outside the catch -
https://github.com/eclipse/jgit/commit/afef866a44cd65fef292c174cad445b3fb526400

The problem is that when the throw was inside of the try block the last
catch block catched the exception and called openFailed(false) method.
It is true that it called it with invalidate = false, which is wrong.
The real problem though is that with the throw outside of the try block
the openFail is not called at all and the fields activeWindows and
activeCopyRawData are not set to 0. Which affects the later called tests
like: if (++activeCopyRawData == 1 && activeWindows == 0).

The fix for this is relatively simple keeping the throw outside of the
try block and still having the invalid field set to true. I did
exhaustive testing of the change running concurrent clones and pushes
indefinitely and with the patch applied it never fails while without the
patch it takes relatively short to get the error.

See: https://www.eclipse.org/lists/jgit-dev/msg04014.html

Bug: 569349
Change-Id: I9dbf8801c8d3131955ad7124f42b62095d96da54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 12/172912/1
Matthias Sohn [Fri, 27 Nov 2020 02:04:00 +0000 (03:04 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Remove unused imports
  Silence API warnings
  Remove erraneously merged source features

Change-Id: Ifb6ebe56577719c0dfc6425557130b91e510d5c7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 11/172911/1
Matthias Sohn [Fri, 27 Nov 2020 01:37:17 +0000 (02:37 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Remove unused imports
  Silence API warnings
  Remove erraneously merged source features

Change-Id: I25eff574e4c1cd0aef7cf2c685aade2f87fb0409
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove unused imports 05/172905/1
Matthias Sohn [Fri, 27 Nov 2020 01:27:25 +0000 (02:27 +0100)]
Remove unused imports

Change-Id: Id78f4fd7d11a8908f41160a2ab9f3d81b7f771da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoSilence API warnings 04/172904/1
Matthias Sohn [Fri, 27 Nov 2020 01:26:23 +0000 (02:26 +0100)]
Silence API warnings

Change-Id: I5de476935e79f8f0beefc27885cbc3ffe31c0aed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove erraneously merged source features 03/172903/1
Matthias Sohn [Fri, 27 Nov 2020 01:20:00 +0000 (02:20 +0100)]
Remove erraneously merged source features

In 5.4 source features were combined into a single feature.

Change-Id: I4055ec805bb036d0f445c8b9b0bb670495a32cc0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 97/172897/1
Matthias Sohn [Fri, 27 Nov 2020 00:01:17 +0000 (01:01 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: I00c8ddad0059a20a978743dfb7ad1b513dc7fef6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.4' into stable-5.5 96/172896/1
Matthias Sohn [Thu, 26 Nov 2020 23:40:00 +0000 (00:40 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: Icc34f809a3bb019d8d640b9bdb71363e617942e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.3' into stable-5.4 95/172895/1
Matthias Sohn [Thu, 26 Nov 2020 23:29:39 +0000 (00:29 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.9-SNAPSHOT builds
  JGit v5.3.8.202011260953-r
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: I82576ad0f61cf3ff11b54691b32666c61401ad9b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.3.9-SNAPSHOT builds 94/172894/1
Matthias Sohn [Thu, 26 Nov 2020 15:30:32 +0000 (16:30 +0100)]
Prepare 5.3.9-SNAPSHOT builds

Change-Id: I69f181453c79cef2b4f43fac38d9836917cdc973
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.3.8.202011260953-r 81/172881/1 v5.3.8.202011260953-r
Matthias Sohn [Thu, 26 Nov 2020 14:52:53 +0000 (15:52 +0100)]
JGit v5.3.8.202011260953-r

Change-Id: I7b128942ef224335f415f867c2d9d5da7498ed8b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.2' into stable-5.3 80/172880/1
Matthias Sohn [Thu, 26 Nov 2020 14:37:19 +0000 (15:37 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: Id9386846a202b5ae98dd602744963f8897ddaa8c

3 years agoMerge branch 'stable-5.1' into stable-5.2 74/172874/1
Matthias Sohn [Thu, 26 Nov 2020 14:34:08 +0000 (15:34 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.15-SNAPSHOT builds
  JGit v5.1.14.202011251942-r
  GC#deleteOrphans: log warning for deleted orphaned files
  GC#deleteOrphans: handle failure to list files in pack directory
  Ensure that GC#deleteOrphans respects pack lock
  Update API warning filters
  Remove unused imports

Change-Id: I91cfe2820c40d2d773cbf018cc2a6c36b062801e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.1.15-SNAPSHOT builds 73/172873/1
Matthias Sohn [Thu, 26 Nov 2020 14:02:01 +0000 (15:02 +0100)]
Prepare 5.1.15-SNAPSHOT builds

Change-Id: I70246b66c76e865aef4e3adada3a507750ca7c63
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.1.14.202011251942-r 62/172862/1 v5.1.14.202011251942-r
Matthias Sohn [Thu, 26 Nov 2020 00:42:17 +0000 (01:42 +0100)]
JGit v5.1.14.202011251942-r

Change-Id: Ibe124988be39feaa029c3770777126dd87b18abc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoGC#deleteOrphans: log warning for deleted orphaned files 61/172861/4
Matthias Sohn [Wed, 25 Nov 2020 23:58:03 +0000 (00:58 +0100)]
GC#deleteOrphans: log warning for deleted orphaned files

Change-Id: Ie245bf5c8c924dfb1f0f40b8bcdcb1e6f5815526
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoGC#deleteOrphans: handle failure to list files in pack directory 60/172860/3
Matthias Sohn [Wed, 25 Nov 2020 23:24:56 +0000 (00:24 +0100)]
GC#deleteOrphans: handle failure to list files in pack directory

- log an error
- either there is no list or it is incomplete hence return immediately

Change-Id: Ieee5378ca06304056b9ccc30c1acd5f52360052d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoEnsure that GC#deleteOrphans respects pack lock 29/172829/8
Matthias Sohn [Wed, 25 Nov 2020 16:00:09 +0000 (17:00 +0100)]
Ensure that GC#deleteOrphans respects pack lock

If pack or index files are guarded by a pack lock (.keep file)
deleteOrphans() should not touch the respective files protected by the
lock file. Otherwise it may interfere with PackInserter concurrently
inserting a new pack file and its index.

The problem was caused by the following race.

All mentioned files are located in  "objects/pack/".
File endings relevant in "pack" dir:
  .pack
  .keep
  .idx
  .bitmap

When ReceivePack receives a pack file it executes the following steps:

ReceivePack.service():
  receivePackAndCheckConnectivity():
    receivePack():
      receive the pack
      parse the pack, returns packLock (.keep file)
      PackInserter.flush():
        write tmpPck file:  "insert_<random>.pack"
        write tmpIdx file:  "insert_<random>.idx"
        real pack name: "pack-<SHA1>.pack"
        real index name: "pack-<SHA1>.idx"
        atomic rename tmpPack to realPack
        atomic rename tmpIdx to tmpIdx
  execute commands
  unlock pack by removing .keep file
  trigger auto gc if enabled

When PackInserter.flush() renames the temporary pack to the final
"pack-xxx.pack" file  the temporary pack index file "insert_xxx.idx"
has no matching .pack file with the same base name for a short interval.
If deleteOrphans() ran during that interval it deduced the pack index
file was orphaned. Subsequently the missing pack index caused
MissingObjectExceptions since objects contained in the pack couldn't be
looked up anymore.

Bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=13544
Change-Id: I559c81e4b1d7c487f92a751bd78b987d32c98719
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoUpdate API warning filters 53/166553/1
Matthias Sohn [Sun, 19 Jul 2020 10:03:14 +0000 (12:03 +0200)]
Update API warning filters

Change-Id: I0fa9c7725ee15da9a932dab0abfb2525d2401149
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove unused imports 52/166552/1
Matthias Sohn [Sun, 19 Jul 2020 10:00:35 +0000 (12:00 +0200)]
Remove unused imports

Change-Id: I7c44e3603df2dd368cb7c0ba0072413b887b6903
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoBump Bazel version to 3.1.0 99/161699/1
David Pursehouse [Wed, 29 Apr 2020 04:53:45 +0000 (13:53 +0900)]
Bump Bazel version to 3.1.0

Change-Id: Id58d1603846a88be3493165583adca481c026eed
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoRemove double blank from sentence start 14/161114/1
Michael Keppler [Tue, 14 Apr 2020 07:31:50 +0000 (09:31 +0200)]
Remove double blank from sentence start

Multiple whitespaces are not normalized when reading properties files,
therefore leading to unwanted space/indentation in console or UI output.

Change-Id: I1f5224fe359e0cac493e0237872afc75dc8b9fbe
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit ebbc3efce73278d6e0dbb1acd099db2446b1bed9)

4 years agoBump Bazel version to 3.0.0 67/160567/1
David Pursehouse [Tue, 7 Apr 2020 07:11:42 +0000 (16:11 +0900)]
Bump Bazel version to 3.0.0

Change-Id: I3866b58d3d288f37b1818be5b56d05e8be6ecb0f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoFS.runInShell(): handle quoted filters and hooksPath containing blanks 05/160405/2
Thomas Wolf [Thu, 2 Apr 2020 19:15:18 +0000 (21:15 +0200)]
FS.runInShell(): handle quoted filters and hooksPath containing blanks

Revert commit 2323d7a. Using $0 in the shell command call results in
the command string being taken literally. That was introduced to fix
a problem with backslashes, but is actually not correct.

First, the problem with backslashes occurred only on Win32/Cygwin,
and has been properly fixed in commit 6f268f8.

Second, this is used only for hooks (which don't have backslashes in
their names) and filter commands from the git config, where the user
is responsible for properly quoting or escaping such that the commands
work.

Third, using $0 actually breaks correctly quoted filter commands
like in the bug report. The shell really takes the command literally,
and then doesn't find the command because of quotes.

So revert this change.

At the same time there's a related problem with hooks. If the path to
the hook contains blanks, runInShell() would also fail to find the
hook. In this case, the command doesn't come from user input but is
just a Java File object with an absolute path containing blanks. (Can
occur if core.hooksPath points to such a path with blanks, or if the
repository has such a path.)

The path to the hook as obtained from the file system must be quoted.

Add a test for a hook path with a blank.

This reverts commit 2323d7a1ef909f9deb3f21329cf30bd1173ee9cf.

Bug: 561666
Change-Id: I4d7df13e6c9b245fe1706e191e4316685a8a9d59
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoHandle non-normalized index also for executable files 80/159980/1
Thomas Wolf [Wed, 25 Mar 2020 08:13:20 +0000 (09:13 +0100)]
Handle non-normalized index also for executable files

Commit 60cf85a4 corrected the handling of check-in for files where
the index version is non-normalized, i.e., contains CR-LF line endings.
However, it did so only for regular files, not executable files.

Bug: 561438
Change-Id: I372cc990c5efeb00315460f36459c0652d5d1e77
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoSilence API errors introduced by 093fbbd1 51/158851/1
Matthias Sohn [Thu, 5 Mar 2020 12:53:10 +0000 (13:53 +0100)]
Silence API errors introduced by 093fbbd1

Change-Id: I1c9d5a25bd06a1152e953c45b683375cb05aa254
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoBump Bazel version to 2.2.0 34/158834/1
David Pursehouse [Thu, 5 Mar 2020 04:13:47 +0000 (13:13 +0900)]
Bump Bazel version to 2.2.0

Change-Id: I889052040f31708c6b8de0cf3c171a04722f7c96
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoExpose FileStoreAttributes.setBackground() 53/158353/3
Alex Blewitt [Tue, 25 Feb 2020 21:14:59 +0000 (21:14 +0000)]
Expose FileStoreAttributes.setBackground()

The FS.setAsyncFileStoreAttributes() static method calls
FileStoreAttributes.setBackground() as its implementation, but there are
other public attributes on this inner class already and there isn't a
real reason why this needs to be private.

By making it public we allow callers to be able to invoke it directly.
Although it doesn't appear that it would make a difference, by calling a
static method on the FS class, all static fields and the transitive
closure of class dependencies must be loaded and initialised, which can
be non-trivial.

Callers referring to FS.setAsyncFileStoreAttributes() may be replaced
with FS.FileStoreAttributes.setBackground() with no change of behaviour
other than improved performance due to less class loading required.

Bug: 560527
Change-Id: I9538acc90da8d18f53fd60d74eb54496857f93a5
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
4 years agoUpdate reftable storage repo layout 90/157990/9
Han-Wen Nienhuys [Tue, 18 Feb 2020 19:44:10 +0000 (20:44 +0100)]
Update reftable storage repo layout

The change Ic0b974fa (c217d33, "Documentation/technical/reftable:
improve repo layout") defines a new repository layout, which was
agreed with the git-core mailing list.

It addresses the following problems:

* old git clients will not recognize reftable-based repositories, and
  look at encompassing directories.

* Poorly written tools might write directly into
  .git/refs/heads/BRANCH.

Since we consider JGit reftable as experimental (git-core doesn't
support it yet), we have no backward compatibility. If you created a
repository with reftable between mid-Nov 2019 and now, you can do the
following to convert:

  mv .git/refs .git/reftable/tables.list
  git config core.repositoryformatversion 1
  git config extensions.refStorage reftable

Change-Id: I80df35b9d22a8ab893dcbe9fbd051d924788d6a5
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoCygwin expects forward slashes for commands to be run via sh.exe 38/158538/2
Thomas Wolf [Thu, 27 Feb 2020 19:04:47 +0000 (20:04 +0100)]
Cygwin expects forward slashes for commands to be run via sh.exe

FS_Win32_Cygwin replaces backslashes by / as a side-effect of
relativize(). When support for core.hooksPath was added, paths were
relativized in a different place using Path.resolve(), which doesn't
do that transformation. As a result hooks could not be run on Cygwin
in some cases.

Do the transformation in FS_Win32_Cygwin.runInShell(). In all other
places, File or Path objects are used, which give no guarantee about
the file separator (typically the system-dependent default separator),
so doing the transformation earlier still wouldn't guarantee that
sh.exe indeed gets a command string using forward slashes.

Bug: 558577
Change-Id: I3c07eb85f0ac7c5628a2e92f990e5cdb7ecf532f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoMake Logger instances final 96/158496/1
David Pursehouse [Thu, 27 Feb 2020 11:32:29 +0000 (20:32 +0900)]
Make Logger instances final

Change-Id: Ibb997952917e47bc31a8cbe3863623bc959a8100
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoMove array designators from the variable to the type 95/158495/1
David Pursehouse [Thu, 27 Feb 2020 11:27:31 +0000 (20:27 +0900)]
Move array designators from the variable to the type

As reported by Sonar Lint:

Array designators should always be located on the type for better code
readability. Otherwise, developers must look both at the type and the
variable name to know whether or not a variable is an array.

Change-Id: If6b41fed3483d0992d402d8680552ab4bef89ffb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoRevert "Prepend hostname to subsection used to store file timestamp resolution" 38/158138/1
Matthias Sohn [Sat, 22 Feb 2020 21:51:32 +0000 (22:51 +0100)]
Revert "Prepend hostname to subsection used to store file timestamp resolution"

This reverts commit e102bbed995f0e6d3a1a8e5db6d08f9804fd3260.

Resolving the hostname comes with a performance penalty. We no longer
store the timestamp resolution in the global git config which might be
copied around to other machines but in a dedicated jgit config meant for
automatically determined options like timestamp resolution. Hence there
is no strong reason anymore to have a hardware specific identifier in
the subsection name of file timestamp resolution options.

Bug: 560414
Change-Id: If8dcabe981eb1792db84643850faa6033f14b1cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSimilarityRenameDetector: Fix inconsistent indentation 73/157973/1
David Pursehouse [Wed, 19 Feb 2020 11:34:13 +0000 (20:34 +0900)]
SimilarityRenameDetector: Fix inconsistent indentation

Replace space indentation with tab indentation

Change-Id: Ic130d3bde5d3a73d8f5c6225974153573722d05b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoUse indexOf(char) and lastIndexOf(char) rather than String versions 49/157949/1
David Pursehouse [Wed, 19 Feb 2020 04:23:14 +0000 (13:23 +0900)]
Use indexOf(char) and lastIndexOf(char) rather than String versions

An indexOf or lastIndexOf call with a single letter String can be
made more performant by switching to a call with a char argument.

Found with SonarLint.

As a side-effect of this change, we no longer need to suppress the
NON-NLS warnings.

Change-Id: Id44cb996bb74ed30edd560aa91fd8525aafdc8dd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoReorder modifiers to follow Java Language Specification 48/157948/1
David Pursehouse [Wed, 19 Feb 2020 04:15:43 +0000 (13:15 +0900)]
Reorder modifiers to follow Java Language Specification

The Java Language Specification recommends listing modifiers in
the following order:

1. Annotations
2. public
3. protected
4. private
5. abstract
6. static
7. final
8. transient
9. volatile
10. synchronized
11. native
12. strictfp

Not following this convention has no technical impact, but will reduce
the code's readability because most developers are used to the standard
order.

This was detected using SonarLint.

Change-Id: I9cddecb4f4234dae1021b677e915be23d349a380
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoGitmoduleEntry: Remove redundant import of class from same package 47/157947/1
David Pursehouse [Wed, 19 Feb 2020 04:06:18 +0000 (13:06 +0900)]
GitmoduleEntry: Remove redundant import of class from same package

Change-Id: I613489a937dd53780b0abfd6b1bd0ed964a5ddd8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoRemove redundant "static" qualifier from enum declarations 46/157946/1
David Pursehouse [Wed, 19 Feb 2020 04:04:08 +0000 (13:04 +0900)]
Remove redundant "static" qualifier from enum declarations

Nested enum types are implicitly static.

Change-Id: Id3d7886087494fb67bc0d080b4a3491fb4baac19
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoUpdate API problem filter 96/157696/1
Matthias Sohn [Fri, 14 Feb 2020 08:17:07 +0000 (09:17 +0100)]
Update API problem filter

Change-Id: Iced4e3cc68cc9c2a75f9bf5befd6db7ce2fb1374
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.6.2-SNAPSHOT builds 78/157678/1
Matthias Sohn [Thu, 13 Feb 2020 23:15:39 +0000 (00:15 +0100)]
Prepare 5.6.2-SNAPSHOT builds

Change-Id: Ie04d749bf16eea6db5e5c98be54ba093ca249d05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.6.1.202002131546-r 70/157670/1 v5.6.1.202002131546-r
Matthias Sohn [Thu, 13 Feb 2020 20:45:37 +0000 (21:45 +0100)]
JGit v5.6.1.202002131546-r

Change-Id: I2807b9a9f7e8b877b72702ebd1f70c4f9f223481
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSimplify ReftableCompactor 81/156281/6
Han-Wen Nienhuys [Tue, 21 Jan 2020 18:06:30 +0000 (19:06 +0100)]
Simplify ReftableCompactor

The ReftableCompactor supported a byteLimit, but this is currently
unused. The FileReftableStack has a more sophisticated strategy that
amortizes compaction costs.

Rename min/maxUpdateIndex to reflogExpire{Min,Max}UpdateIndex to
reflect their purpose  more accurately.

Since reflogs are generally pruned chronologically (oldest entries are
expired first), one can only prune entries on full compaction, so they
should not be set by default.

Rephrase the function Reader#minUpdateIndex and maxUpdateIndex. These
vars are documented to affect log entries, but semantically, they are
about ref entries. Since ref entries have their timestamps
delta-compressed, it is important for the min/maxUpdateIndex values to
be coherent between different tables.

The logical timestamps for log entries do not have to be coherent in
different tables, as the timestamps of a log entry is part of the key.
For example, a table written at update index 20 may contain a tombstone
log entry at timestamp 1.

Therefore, we set ReftableWriter's min/maxUpdateIndex from the merged
tables we are compacting, rather than from the compaction settings
(which should only control reflog expiry.)

The previous behavior could drop log entries erroneously, especially
in the presence of tombstone log entries. Unfortunately, testing this
properly requires both an API for adding log tombstones, and a more
refined API for controlling automatic compaction. Hence, no test.

Change-Id: I2f4eb7866f607fddd0629809e8e61f0b9097717f
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
4 years agoBump required Bazel version to 2.1.0 52/157552/1
David Pursehouse [Wed, 12 Feb 2020 09:40:45 +0000 (18:40 +0900)]
Bump required Bazel version to 2.1.0

Change-Id: I2e4f44a8d591ba26c14189fc46ead0feaef187c3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoUpgrade bazlets to the latest master revision 51/157551/1
David Pursehouse [Wed, 12 Feb 2020 09:42:12 +0000 (18:42 +0900)]
Upgrade bazlets to the latest master revision

Includes "Use now mandatory https protocol for MAVEN_CENTRAL".

Change-Id: I4e83bf9a01f1d2a3bea4ce855709fd33e624fe9a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoChange the wildcard import to explicit ones. 50/157550/1
Yunjie Li [Mon, 9 Dec 2019 22:34:16 +0000 (14:34 -0800)]
Change the wildcard import to explicit ones.

Change-Id: Ia7bc1c4b6b82c127e1e4e0e657f69d249684e8e6
Signed-off-by: Yunjie Li <yunjieli@google.com>
4 years agoMerge branch 'stable-5.5' into stable-5.6 31/157531/1
Matthias Sohn [Tue, 11 Feb 2020 22:53:24 +0000 (23:53 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I67e7b9994aff40b05792bee2306476cf749723e0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.4' into stable-5.5 30/157530/1
Matthias Sohn [Tue, 11 Feb 2020 22:52:16 +0000 (23:52 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I44b39161f775a52795f6bff312a27227e893651e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.3' into stable-5.4 29/157529/1
Matthias Sohn [Tue, 11 Feb 2020 22:51:38 +0000 (23:51 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I075f8b8f97a5e97602c058770fe12164af2ce66a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.3.8-SNAPSHOT builds 82/157482/1
Matthias Sohn [Tue, 11 Feb 2020 10:54:11 +0000 (11:54 +0100)]
Prepare 5.3.8-SNAPSHOT builds

Change-Id: I64ef3b4cf30e87d058001c2c6f1458f4b0c1df00
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.3.7.202002110540-r 81/157481/1 v5.3.7.202002110540-r
Matthias Sohn [Tue, 11 Feb 2020 10:37:34 +0000 (11:37 +0100)]
JGit v5.3.7.202002110540-r

Change-Id: I3ba41af516b9d3b74ac580b3e170ad0e6e0663d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.2' into stable-5.3 79/157479/1
Matthias Sohn [Tue, 11 Feb 2020 10:26:03 +0000 (11:26 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I78cbed22c0f0f5872fa44b9a564f6d31dcace582

4 years agoMerge branch 'stable-5.1' into stable-5.2 78/157478/1
Matthias Sohn [Tue, 11 Feb 2020 10:18:12 +0000 (11:18 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r

Change-Id: I57fc818e719bc94f90ab1aeb34016eea74d84719
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoPrepare 5.1.14-SNAPSHOT builds 77/157477/1
Matthias Sohn [Tue, 11 Feb 2020 10:12:20 +0000 (11:12 +0100)]
Prepare 5.1.14-SNAPSHOT builds

Change-Id: Ic7d6f1a6c3123af1a1fa782f052b0cea3b6f28c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJGit v5.1.13.202002110435-r 75/157475/1 v5.1.13.202002110435-r
Matthias Sohn [Tue, 11 Feb 2020 09:30:36 +0000 (10:30 +0100)]
JGit v5.1.13.202002110435-r

Change-Id: Iedc8699ad1a24efe7ddb47ae919c75b9d36141d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoreftable: don't check deadline on the first try 31/156831/5
Han-Wen Nienhuys [Wed, 29 Jan 2020 18:12:06 +0000 (19:12 +0100)]
reftable: don't check deadline on the first try

This helps debug stepping.

Change-Id: I020dafab4ffac75e6df0dbcde0ed4805c7867f72
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
4 years agoreftable: clarify comment 30/156830/5
Han-Wen Nienhuys [Wed, 29 Jan 2020 18:11:22 +0000 (19:11 +0100)]
reftable: clarify comment

Change-Id: I16e32aeb325b604eb31f84db18a214f792395941
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoreftable: clear cache on full compaction 29/156829/5
Han-Wen Nienhuys [Wed, 29 Jan 2020 18:11:00 +0000 (19:11 +0100)]
reftable: clear cache on full compaction

The merged table contains handles to open files. A full compaction
causes those files to be closed, and so further lookups would fail
with EBADF.

Change-Id: I7bb74f7228ecc7fec9535b00e56a617a9c18e00e
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoreftable: remove outdated comment 28/156828/3
Han-Wen Nienhuys [Wed, 29 Jan 2020 17:56:12 +0000 (18:56 +0100)]
reftable: remove outdated comment

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

4 years agoreftable: clarify that LogCursor may return a null ReflogEntry 27/156827/3
Han-Wen Nienhuys [Wed, 29 Jan 2020 17:55:43 +0000 (18:55 +0100)]
reftable: clarify that LogCursor may return a null ReflogEntry

Change-Id: I1a4d5c262cd196dca37876aec00bb974a45e9fcd
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
4 years agoRestore behavior of CloneCommand 84/157084/2
Thomas Wolf [Mon, 3 Feb 2020 20:00:46 +0000 (21:00 +0100)]
Restore behavior of CloneCommand

Commit 6216b0de changed the behavior of the setMirror(),
setCloneAllBranches(), and setBranchesToClone() operations. Before
that commit, these could be set and reset independently and only in
call() it would be determined what exactly to do. Since that commit,
the last of these calls would determine the operation. This means
that the sequence

  cloneCommand.setCloneAllBranches(true);
  cloneCommand.setBranchesToClone(/* some list of refs */);

would formerly do a "clone all" giving a fetch refspec with wildcards

  +refs/heads/*:refs/remotes/origin/*

which picks up new upstream branches, whereas since commit 6216b0de
individual non-wildcard fetch refspecs would be generated and new
upstream branches would not be fetched anymore.

Undo this behavioral change. Make the operations independently settable
and resettable again, and determine the exact operation only in call():
mirror=true > cloneAll=true > specific refs, where ">" means "takes
precedence over", and if none is set assume cloneAll=true.

Note that mirror=true implies setBare(true).

Bug: 559796
Change-Id: I7162b60e99de5e3e512bf27ff4113f554c94f5a6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoMerge branch 'stable-5.5' into stable-5.6 98/156998/1
Matthias Sohn [Sat, 1 Feb 2020 00:57:03 +0000 (01:57 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I73d16b53df02bf735c2431588143efe225a4b5b4

4 years agoMerge branch 'stable-5.4' into stable-5.5 97/156997/1
Matthias Sohn [Sat, 1 Feb 2020 00:41:52 +0000 (01:41 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I76a62da98182f0c504b1ea8b7d37cecdf4eea7e0

4 years agoMerge branch 'stable-5.3' into stable-5.4 96/156996/1
Matthias Sohn [Sat, 1 Feb 2020 00:28:40 +0000 (01:28 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I12002dbfed9dff14fc6d2df9787d92eab5b1fa78

4 years agoMerge branch 'stable-5.2' into stable-5.3 95/156995/1
Matthias Sohn [Sat, 1 Feb 2020 00:14:01 +0000 (01:14 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I790098be00ff3f9b8278d54ae4fb7c11311816e9

4 years agoMerge branch 'stable-5.1' into stable-5.2 19/156919/2
David Pursehouse [Fri, 31 Jan 2020 00:12:08 +0000 (09:12 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix string format parameter for invalidRefAdvertisementLine
  WindowCache: add metric for cached bytes per repository
  pgm daemon: fallback to user and system config if no config specified
  WindowCache: add option to use strong refs to reference ByteWindows

Change-Id: I741059a1d0d5950ab5bc16ec70352655ee926a24
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix string format parameter for invalidRefAdvertisementLine 18/156918/1
David Pursehouse [Thu, 30 Jan 2020 23:38:24 +0000 (08:38 +0900)]
Fix string format parameter for invalidRefAdvertisementLine

The externalized error message added in f4fc640 ("BasePackConnection:
Check for expected length of ref advertisement", Dec 18, 2019) uses a
malformed string format. Since there is only one formatting argument,
it should be referenced with '{0}' rather than '{1}'.

Change-Id: Ibda864dfb0bb902fe07ae4bba73117b212046e8a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
4 years agoWindowCache: add metric for cached bytes per repository 73/155173/7
Matthias Sohn [Fri, 3 Jan 2020 17:16:42 +0000 (18:16 +0100)]
WindowCache: add metric for cached bytes per repository

Since ObjectDatabase and PackFile don't know their repository use the
packfile's grand-grand-parent directory as an identifier for the
repository the packfile resides in.

Remove metric for a repository if the number of cached bytes for the
repository drops to 0 in order to ensure the map of cached bytes per
repository doesn't contain repositories which have no data cached in the
WindowCache.

Change-Id: I969ab8029db0a292e7585cbb36ca0baa797da20b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agopgm daemon: fallback to user and system config if no config specified 83/156683/2
Matthias Sohn [Mon, 27 Jan 2020 22:00:57 +0000 (23:00 +0100)]
pgm daemon: fallback to user and system config if no config specified

If a config file is passed via option --config-file then use only the
options defined in that file. This helps to concisely configure the
daemon without side effects from global and system level git configs.

Otherwise fallback to user and system level configs.

Change-Id: I242de248f257579874ad0bfe4882a22502353b1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoWindowCache: add option to use strong refs to reference ByteWindows 49/155149/5
Matthias Sohn [Fri, 13 Dec 2019 00:18:12 +0000 (01:18 +0100)]
WindowCache: add option to use strong refs to reference ByteWindows

Java GC evicts all SoftReferences when the used heap size comes close to
the maximum heap size. This means peaks in heap memory consumption can
flush the complete WindowCache which was observed to have negative
impact on performance of upload-pack in Gerrit.

Hence add a boolean option core.packedGitUseStrongRefs to allow using
strong references to reference packfile pages cached in the WindowCache.

If this option is set to true Java gc can no longer flush the
WindowCache to free memory if the used heap comes close to the maximum
heap size. On the other hand this provides more predictable performance.

Bug: 553573
Change-Id: I9de406293087ab0fa61130c8e0829775762ece8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 12/155912/2
David Pursehouse [Wed, 15 Jan 2020 11:03:28 +0000 (20:03 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Replace usage of ArrayIndexOutOfBoundsException in treewalk
  Add config constants for WindowCache configuration options

Change-Id: I17da3c5183eca536aa2be3972bc5df45c9d75f1b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoReplace usage of ArrayIndexOutOfBoundsException in treewalk 32/155532/3
Patrick Hiesel [Thu, 9 Jan 2020 09:23:12 +0000 (10:23 +0100)]
Replace usage of ArrayIndexOutOfBoundsException in treewalk

Using exceptions during normal operations - for example with the
desire of expanding an array in the failure case - can have a
severe performance impact. When exceptions are instantiated,
a stack trace is collected. Generating stack trace can be expensive.

Compared to that, checking an array for length - even if done many
times - is cheap since this is a check that can run in just a
handful of CPU cycles.

Change-Id: Ifaf10623f6a876c9faecfa44654c9296315adfcb
Signed-off-by: Patrick Hiesel <hiesel@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.5' into stable-5.6 51/155551/1
Matthias Sohn [Thu, 9 Jan 2020 12:14:38 +0000 (13:14 +0100)]
Merge branch 'stable-5.5' into stable-5.6

* stable-5.5:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I11f9a387ac3dc7d22a4f2e70bb8d89169b4e9afe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.4' into stable-5.5 38/155538/1
Matthias Sohn [Thu, 9 Jan 2020 11:32:03 +0000 (12:32 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I78902d5feecb2c09134b64ec2f3b48b2c3bab37d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.3' into stable-5.4 36/155536/1
Matthias Sohn [Thu, 9 Jan 2020 10:38:28 +0000 (11:38 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I1b560b36d169cfa02cc5450ad0fa0bd85f9f42d8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.2' into stable-5.3 24/155524/1
Matthias Sohn [Thu, 9 Jan 2020 01:19:03 +0000 (02:19 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix API problem filters
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: I67a07d92718188bdf7f8a13b83e9f538ecf4b22f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoMerge branch 'stable-5.1' into stable-5.2 23/155523/1
Matthias Sohn [Thu, 9 Jan 2020 01:03:45 +0000 (02:03 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix unclosed resource warning in SmartOutputStream
  JschConfigSessionFactory: fix boxing warning
  SshSupport#runSshCommand: don't throw exception in finally block
  Don't override already managed maven-compiler-plugin version
  Remove unused import from CreateFileSnapshotBenchmark
  Remove duplicate ignore_optional_problems entry in .classpath
  Update maven-site-plugin used by benchmark module to 3.8.2
  Add dependency to enable site generation for benchmark module
  Ignore warnings for generated source code in
org.eclipse.jgit.benchmark
  Fix MBean registration
  Enhance WindowCache statistics

Change-Id: Ic90aacf1ea40e13dc564d4d659e79535e86d0300
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix API problem filters 22/155522/1
Matthias Sohn [Sat, 4 Jan 2020 12:01:39 +0000 (13:01 +0100)]
Fix API problem filters

Change-Id: Icc78570f949ad64beb58caa192c829e536aa8dad
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd config constants for WindowCache configuration options 48/155148/2
Matthias Sohn [Thu, 2 Jan 2020 23:52:37 +0000 (00:52 +0100)]
Add config constants for WindowCache configuration options

Change-Id: Icc5265f87ae58aa1e667ed1827075c4a30f75c32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoFix unclosed resource warning in SmartOutputStream 12/155212/2
Matthias Sohn [Sat, 4 Jan 2020 16:03:52 +0000 (17:03 +0100)]
Fix unclosed resource warning in SmartOutputStream

Change-Id: Ia4b96ae1c2cc9357802487384ee32a80ed40334b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoJschConfigSessionFactory: fix boxing warning 11/155211/2
Matthias Sohn [Sat, 4 Jan 2020 15:06:54 +0000 (16:06 +0100)]
JschConfigSessionFactory: fix boxing warning

Change-Id: I1735033c56b444a9a7160cb7df89292a228d5b34
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoSshSupport#runSshCommand: don't throw exception in finally block 10/155210/2
Matthias Sohn [Sat, 4 Jan 2020 14:44:19 +0000 (15:44 +0100)]
SshSupport#runSshCommand: don't throw exception in finally block

The CommandFailedException which was thrown in finally block is silently
discarded [1]. Refactor this method to throw the exception after the
finally block.

This fixes the warning "Null comparison always yields false: The
variable failure can only be null at this location".

[1] https://wiki.sei.cmu.edu/confluence/display/java/ERR04-J.+Do+not+complete+abruptly+from+a+finally+block
https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.20.2

Change-Id: Idbfc303d9c9046ab9a43e0d4c6d65d325bdaf0ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoDon't override already managed maven-compiler-plugin version 09/155209/1
Matthias Sohn [Sat, 4 Jan 2020 12:15:37 +0000 (13:15 +0100)]
Don't override already managed maven-compiler-plugin version

Change-Id: Ie2cb178cf8d805aadc76a2096bcdde95a146d07c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove unused import from CreateFileSnapshotBenchmark 08/155208/1
Matthias Sohn [Sat, 4 Jan 2020 12:11:06 +0000 (13:11 +0100)]
Remove unused import from CreateFileSnapshotBenchmark

Change-Id: Iad0bcc01ada4252e9ab4f60d4375f98f084f6a5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoRemove duplicate ignore_optional_problems entry in .classpath 07/155207/1
Matthias Sohn [Sat, 4 Jan 2020 12:10:00 +0000 (13:10 +0100)]
Remove duplicate ignore_optional_problems entry in .classpath

Change-Id: I326377c90af59ecaada7f5185a638726a8e909b7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoHooks: avoid problems with backslashes in paths 14/155014/1
Thomas Wolf [Tue, 24 Dec 2019 11:13:29 +0000 (12:13 +0100)]
Hooks: avoid problems with backslashes in paths

Calling sh -c with a script path containing backslashes may fail since
the shell may try to process them as escape characters.

Instead of calling

  sh.exe -c 'C:\path\script "$@"' 'C:\path\script' other args

call

  sh.exe -c '$0 "$@"' 'C:\path\script' other args

which avoids this escape processing.

Note that this is not specific to Windows. If the path or the script
name contain backslashes, this also occurs on Unix.

Bug: 558577
Change-Id: I47d63db6f8644f956c55c42b07dbcad7d7f305aa
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
4 years agoUpdate maven-site-plugin used by benchmark module to 3.8.2 69/154769/1
Matthias Sohn [Wed, 18 Dec 2019 14:50:35 +0000 (15:50 +0100)]
Update maven-site-plugin used by benchmark module to 3.8.2

The benchmark module currently has no parent, adjust the version used
here to the one used by all the other jgit Maven modules.

Change-Id: I8807a694fe23f8f131d1d22a58a3e18874d756cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoAdd dependency to enable site generation for benchmark module 68/154768/1
Matthias Sohn [Wed, 18 Dec 2019 14:49:18 +0000 (15:49 +0100)]
Add dependency to enable site generation for benchmark module

Change-Id: Iae4524ddc730d57993e9c6d6807282e4b07d1336
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
4 years agoIgnore warnings for generated source code in org.eclipse.jgit.benchmark 38/154638/1
Matthias Sohn [Mon, 16 Dec 2019 14:22:08 +0000 (15:22 +0100)]
Ignore warnings for generated source code in org.eclipse.jgit.benchmark

The source code in the folder .apt_generated is generated by the JMH
code generator, so there's no point in raising any warnings as this
could only be fixed in the upstream code generator.

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