Commit Graph

7763 Commits

Author SHA1 Message Date
Matthias Sohn fb0858e9c9 Merge branch 'stable-5.6'
* stable-5.6:
  Silence API errors introduced by 093fbbd1
  Bump Bazel version to 2.2.0
  Expose FileStoreAttributes.setBackground()
  Update reftable storage repo layout

Change-Id: I237eaaed7991e8bbd56a7624f47bbba985330026
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-03-05 15:44:42 +01:00
Matthias Sohn 2415571370 Silence API errors introduced by 093fbbd1
Change-Id: I1c9d5a25bd06a1152e953c45b683375cb05aa254
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-03-05 13:53:10 +01:00
David Pursehouse 1d41be7c54 Bump Bazel version to 2.2.0
Change-Id: I889052040f31708c6b8de0cf3c171a04722f7c96
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-03-05 13:13:47 +09:00
Michael Dardis d7f304045a Add validation to hex decoder
Does not fix any issue but prevents user from shooting themselves in the
foot with improper configuration.

Suggested by Demetr Starshov at https://git.eclipse.org/r/#/c/157681/

Change-Id: I006d65022f0a7d4066970825d00080c59404fdc3
Signed-off-by: Michael Dardis <git@md-5.net>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-03-04 16:34:01 +01:00
Alex Blewitt 093fbbd11e 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>
2020-03-04 15:59:53 +01:00
Han-Wen Nienhuys 30fb4808f2 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>
2020-03-04 15:45:01 +01:00
Matthias Sohn 95fd662dd3 Add 4.14 and 4.15-staging target platforms
- copy old 4.14-staging to 4.14 target platform
- create 4.15-staging target platform from former 4.14-staging

Change-Id: I874f552205f1bc419334e4f66ebfef4cbc8cb4ff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-03-02 22:29:03 +01:00
Matthias Sohn e9852c1597 Update Orbit to R20200224183213 for final 2020-03
Change-Id: I00eb77ec4c055de0e5900a2c4ed82770e2031dab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-03-02 22:07:14 +01:00
Jonathan Nieder fb45137a7c Merge "ObjectWalk: Add null check before skip tree." 2020-03-02 13:37:59 -05:00
Matthias Sohn 8f961240f1 Update Orbit to S20200224183213 for 2020-03 RC1
Change-Id: Ic37b1b8dc62de0bb30fa50562bed428f49d404bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-29 00:07:39 +01:00
Matthias Sohn 2161c1e5e4 Merge branch 'stable-5.6'
* stable-5.6:
  Cygwin expects forward slashes for commands to be run via sh.exe
  Make Logger instances final
  Move array designators from the variable to the type

Change-Id: I9a5dc570deb478525bf48ef526d8cba5b19418bf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-28 23:53:32 +01:00
Thomas Wolf 6f268f8ceb 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>
2020-02-28 17:18:23 -05:00
David Pursehouse 8244aa5faf Merge "[releng] Update year in copyright notices for features" 2020-02-28 08:40:40 -05:00
Thomas Wolf c2066bd071 [releng] Update year in copyright notices for features
Bump upper end of range to 2020.

These copyright notices are user-facing; they're visible in several
dialogs in Eclipse. It is strange or even misleading to see a copyright
notice for JGit saying "2005, 2010" when there have been *many*
developments in the past ten years.

Change-Id: Idaa6244b2b3d9cecb29cc690085f8d008195cf12
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-02-28 09:53:17 +01:00
Lars Vogel 512ffc9e7f Using for-each loop in jdt
Running the JDT cleanup action for using a for-each loop on jgit

Change-Id: Ie724d8bbdff786ab0167089e90a9914a8135103c
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
2020-02-28 02:39:12 -05:00
David Pursehouse 14a157dff6 Make Logger instances final
Change-Id: Ibb997952917e47bc31a8cbe3863623bc959a8100
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-27 20:32:29 +09:00
David Pursehouse 5a6b6eee35 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>
2020-02-27 20:27:31 +09:00
Jonathan Nieder 6586c171b3 Merge "Revert "RevWalk: stop mixing lines of history in topo sort"" 2020-02-26 17:48:18 -05:00
Yunjie Li 7ba261fb5f ObjectWalk: Add null check before skip tree.
currVisit could be null if a blob is marked as start point in
ObjectWalk. Add null check before skipping current tree.

Change-Id: Ic5d876fe2800f3373d136979be6c27d1bbd38dc1
Signed-off-by: Yunjie Li <yunjieli@google.com>
2020-02-26 12:03:58 -08:00
Alex Spradlin e40c38ab08 Revert "RevWalk: stop mixing lines of history in topo sort"
This reverts commit b5e764abd2.

PlotWalk uses the TopoSortGenerator, which is causing problems for EGit users
who rely on the emission of commits being somewhat based on date as in the
previous topo-sort algorithm.

Bug: 560529
Change-Id: I3dbd3598a7aeb960de3fc39352699b4f11a8c226
Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
2020-02-26 14:47:20 -05:00
Lajos Olah 61ec1455c0 Do not fail if known hosts file does not contain valid host key
KnownHosts (implementing HostKeyRepository) in Jsch can return null
which could cause NullPointerException in Stream.of(...)

Change-Id: Iddcf5f34f8c8475a85ca7ae018bbe48d1b3fbbc0
Signed-off-by: Lajos Olah <lajos.olah.jr@gmail.com>
2020-02-26 03:57:59 -05:00
Matthias Sohn f63583928f Update Orbit to S20200219023850 for 2012-03 M3
Change-Id: I7b216fa9a4d0724fa7723713b6dd57e269a5e8fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-23 23:51:53 +01:00
Matthias Sohn 25a6bd4d61 Merge branch 'stable-5.6'
* stable-5.6:
  Revert "Prepend hostname to subsection used to store file timestamp resolution"
  SimilarityRenameDetector: Fix inconsistent indentation
  Use indexOf(char) and lastIndexOf(char) rather than String versions
  Reorder modifiers to follow Java Language Specification
  GitmoduleEntry: Remove redundant import of class from same package
  Remove redundant "static" qualifier from enum declarations

Change-Id: Ibb66bef7e8373f81e3e653c9843d986243446d68
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-22 23:36:08 +01:00
Matthias Sohn abb461533f Revert "Prepend hostname to subsection used to store file timestamp resolution"
This reverts commit e102bbed99.

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>
2020-02-22 22:57:12 +01:00
Michael Dardis 67b9effc65 Remove use of org.bouncycastle.util.encoders.Hex
Change-Id: I5c1ed0397ef99eb5d4f120da331b66c2d0f1707a
Signed-off-by: Michael Dardis <git@md-5.net>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-22 00:12:20 +01:00
Michael Dardis 4055522359 Remove use of org.bouncycastle.util.io.TeeOutputStream
Bug: 559106
Change-Id: Ife06f21a00d258780a2030745738194098c631cf
Signed-off-by: Michael Dardis <git@md-5.net>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-21 23:45:43 +01:00
Thomas Wolf f2b67be62a Make the IMatcher public API
Provide a static factory method to create a PathMatcher.

Bug: 559526
Change-Id: Ib7a4a1bcc658ac2f2a09d365b5b891669dfd7570
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-02-20 10:40:33 +01:00
David Pursehouse fdabbe67e2 SimilarityRenameDetector: Fix inconsistent indentation
Replace space indentation with tab indentation

Change-Id: Ic130d3bde5d3a73d8f5c6225974153573722d05b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-19 20:34:15 +09:00
David Pursehouse 6a72f2943d 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>
2020-02-19 13:24:01 +09:00
David Pursehouse 064834d350 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>
2020-02-19 13:15:43 +09:00
David Pursehouse 2d1acae6d8 GitmoduleEntry: Remove redundant import of class from same package
Change-Id: I613489a937dd53780b0abfd6b1bd0ed964a5ddd8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-19 13:06:18 +09:00
David Pursehouse 9be93b7991 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>
2020-02-19 13:04:43 +09:00
Matthias Sohn 9e4781878b Merge branch 'stable-5.7'
* stable-5.7:
  Update API problem filter
  Prepare 5.6.2-SNAPSHOT builds
  JGit v5.6.1.202002131546-r
  Simplify ReftableCompactor

Change-Id: I1aa650e030fbaa7a1c898eef1836de529e0c30db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-19 01:45:18 +01:00
Matthias Sohn 7a940542ee Merge branch 'stable-5.6' into stable-5.7
# By Matthias Sohn (3) and Han-Wen Nienhuys (1)
* stable-5.6:
  Update API problem filter
  Prepare 5.6.2-SNAPSHOT builds
  JGit v5.6.1.202002131546-r
  Simplify ReftableCompactor

Change-Id: I16ed174f9fc662934c3ebaea85a60690efbed1c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-19 01:44:18 +01:00
Jonathan Tan deab5e1a43 Merge "RevWalk: stop mixing lines of history in topo sort" 2020-02-18 18:41:03 -05:00
Alex Spradlin b5e764abd2 RevWalk: stop mixing lines of history in topo sort
The topological sort algorithm in TopoSortGenerator for RevWalk may mix
multiple lines of history, producing results that differ from C git's
git log whose man page states: "Show no parents before all of its
children are shown, and avoid showing commits on multiple lines of
history intermixed." Lines of history are mixed because
TopoSortGenerator merely delays a commit until all of its children have
been produced; it does not immediately produce a commit after its last
child has been produced.

Therefore, when the last child of a commit has been produced, unpop the
commit so that it will be returned upon the subsequent call to next() in
TopoSortGenerator. To avoid producing duplicates, mark commits that
have not yet been produced as TOPO_QUEUED so that when a commit is
popped, it is produced if and only if TOPO_QUEUED is set.

To support nesting with other generators that may produce the same
commit multiple times like DepthGenerator (for example, StartGenerator
does this), do not increment parent inDegree for the same child commit
more than once.

Modify tests that assert that TopoSortGenerator mixes lines of commit
history.

Change-Id: I4ee03c7a8e5265d61230b2a01ae3858745b2432b
Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
2020-02-18 15:17:23 -08:00
Jonathan Nieder 5c6e6f608d Merge "Documentation/technical/reftable: improve repo layout" 2020-02-18 13:08:26 -05:00
David Pursehouse fa227ede55 Upgrade plexus-compiler-{eclipse|javac|javac-errorprone} to 2.8.6
Change-Id: Ie49e487a2bc10b62db623f2e128fa063bfbc77bf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-17 20:26:12 +09:00
David Pursehouse cc8f02de13 Upgrade maven-shade-plugin to 3.2.2
Change-Id: I63bdd436f04690028ecb493efc92c603a8049eb8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-17 20:26:12 +09:00
Andrey Loskutov 5f53de2bf1 Removed unused imports
This fixes compilation errors in 4.15 M3

Bug: 560210
Change-Id: I7f36edc7fb83c66c8889d7573b4439d5a52334e4
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2020-02-17 09:05:53 +01:00
Thomas Wolf dab029f115 Merge branch 'master' into stable-5.7
* master:
  Use lambdas where possible
  Upgrade maven-pmd-plugin to 3.13.0
  Include org.apache.commons.codec 1.13 in the JGit http.apache.feature
  Update Maven plugins
  AmazonS3: Speed up fetch, try recent packs first
  Update orbit to S20200128200239 for 2020-03 M2
  FS: re-order fields and use all uppercase for true constants
  FS: Don't use innocuous threads for CompletableFuture
  ErrorProne: Enable and fix UnusedException check
  Update Orbit to I20200126235943 and org.junit to 4.13.0.v20200126-2018
  Fix SshSessionFactory#setInstance to use service loader
  Use ServiceLoader to define the default SSH session factory.
  Remove Error-Prone ExpectedExceptionChecker
  ReceivePack: enable overriding filterCommands and executeCommands
  Replace ExpectedException which was deprecated in junit 4.13
  Add org.assertj 3.14.0.v20200120-1926 to target platform
  Replace deprecated junit assertion methods with hamcrest
  Update to Orbit I20200120214610 and JUnit to 4.13
  Update to Tycho 1.6.0
  Extract method refactoring in class DirCacheCheckout
  Update Orbit to I20200115225246 and update dependencies
  Update bazlets and bazel version

Change-Id: Ib6cd6593484cd79def9d5298181411189575c9f7
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2020-02-16 18:44:09 +01:00
Matthias Sohn bc98a597ff Update API problem filter
Change-Id: Iced4e3cc68cc9c2a75f9bf5befd6db7ce2fb1374
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-14 09:17:07 +01:00
Matthias Sohn 2899483e96 Prepare 5.6.2-SNAPSHOT builds
Change-Id: Ie04d749bf16eea6db5e5c98be54ba093ca249d05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-14 00:15:39 +01:00
Matthias Sohn 1b44f0e4a6 JGit v5.6.1.202002131546-r
Change-Id: I2807b9a9f7e8b877b72702ebd1f70c4f9f223481
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-13 21:45:37 +01:00
David Pursehouse 6f80775518 Merge branch 'stable-5.7'
* stable-5.7:
  Bump required Bazel version to 2.1.0
  Upgrade bazlets to the latest master revision
  Change the wildcard import to explicit ones.

Change-Id: I5aeaad53ac729e2dcfa67c6830accee749cd21cd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-13 20:06:42 +09:00
David Pursehouse eb7d335ee7 Merge branch 'stable-5.6' into stable-5.7
* stable-5.6:
  Bump required Bazel version to 2.1.0
  Upgrade bazlets to the latest master revision
  Change the wildcard import to explicit ones.
  Prepare 5.3.8-SNAPSHOT builds
  JGit v5.3.7.202002110540-r
  Prepare 5.1.14-SNAPSHOT builds
  JGit v5.1.13.202002110435-r
  reftable: don't check deadline on the first try
  reftable: clarify comment
  reftable: clear cache on full compaction
  reftable: remove outdated comment
  reftable: clarify that LogCursor may return a null ReflogEntry
  Restore behavior of CloneCommand

Change-Id: Ifc30b40ef58d5cda4b1cf3694488424beb182cfc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-13 09:02:50 +09:00
Han-Wen Nienhuys 753fbaf11a 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>
2020-02-12 23:08:20 +01:00
David Pursehouse 5fd922dfd4 Bump required Bazel version to 2.1.0
Change-Id: I2e4f44a8d591ba26c14189fc46ead0feaef187c3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-02-12 18:45:26 +09:00
David Pursehouse 34c4ffff2d 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>
2020-02-12 18:45:26 +09:00
Yunjie Li 34cf825ba6 Change the wildcard import to explicit ones.
Change-Id: Ia7bc1c4b6b82c127e1e4e0e657f69d249684e8e6
Signed-off-by: Yunjie Li <yunjieli@google.com>
2020-02-12 18:45:26 +09:00