Commit Graph

7745 Commits

Author SHA1 Message Date
Jonathan Nieder 6586c171b3 Merge "Revert "RevWalk: stop mixing lines of history in topo sort"" 2020-02-26 17:48:18 -05: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
Matthias Sohn ffb0a64464 Merge branch 'stable-5.6'
* stable-5.6:
  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: I39c936b951870b0cc845e4ab54afdfb45ee65b20
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-12 00:14:02 +01:00
Matthias Sohn 44ad668d93 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>
2020-02-11 23:53:43 +01:00
Matthias Sohn ffe4616b5f 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>
2020-02-11 23:52:50 +01:00
Matthias Sohn 044e70511a 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>
2020-02-11 23:51:38 +01:00
Matthias Sohn 003e4cfc23 Prepare 5.3.8-SNAPSHOT builds
Change-Id: I64ef3b4cf30e87d058001c2c6f1458f4b0c1df00
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:54:11 +01:00
Han-Wen Nienhuys c217d33ff8 Documentation/technical/reftable: improve repo layout
Previously, the list of tables was in .git/refs. This makes
repo detection fail in older clients, which is undesirable.

This is proposal was discussed and approved on the git@vger list at

  https://lore.kernel.org/git/CAFQ2z_PvKiz==GyS6J1H1uG0FRPL86JvDj+LjX1We4-yCSVQ+g@mail.gmail.com/

For backward compatibility, JGit could detect a file under .git/refs and
use it as a reftable list.

Change-Id: Ic0b974fa250cfa905463b811957e2a4fdd7bbc6b
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2020-02-11 11:52:35 +01:00
Matthias Sohn 0c3b425099 JGit v5.3.7.202002110540-r
Change-Id: I3ba41af516b9d3b74ac580b3e170ad0e6e0663d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:37:34 +01:00
Matthias Sohn a3986d944f 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
2020-02-11 11:26:03 +01:00
Matthias Sohn 7c932a557e 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>
2020-02-11 11:18:12 +01:00
Matthias Sohn 425e2607fe Prepare 5.1.14-SNAPSHOT builds
Change-Id: Ic7d6f1a6c3123af1a1fa782f052b0cea3b6f28c6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 11:12:20 +01:00
Matthias Sohn e0abe9e2a7 JGit v5.1.13.202002110435-r
Change-Id: Iedc8699ad1a24efe7ddb47ae919c75b9d36141d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 10:30:36 +01:00
Matthias Sohn e68e0e7f03 Merge branch 'stable-5.6'
* stable-5.6:
  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

Change-Id: I9458a746311984fa687b3da964805e2568ed37f3
2020-02-11 01:39:27 +01:00
Han-Wen Nienhuys 79266a1fe5 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>
2020-02-11 00:03:33 +01:00
Han-Wen Nienhuys 936a031ca3 reftable: clarify comment
Change-Id: I16e32aeb325b604eb31f84db18a214f792395941
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-11 00:03:12 +01:00
Han-Wen Nienhuys 8c9f7656c3 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>
2020-02-11 00:03:09 +01:00
Han-Wen Nienhuys dd203f03c2 reftable: remove outdated comment
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I41a7d9934d53553b5f81f40ff9d663378676ac5d
2020-02-10 12:43:36 +01:00
Han-Wen Nienhuys 0bf2564433 reftable: clarify that LogCursor may return a null ReflogEntry
Change-Id: I1a4d5c262cd196dca37876aec00bb974a45e9fcd
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2020-02-10 12:43:36 +01:00
Matthias Sohn 009674e99f Merge branch 'stable-5.6'
* stable-5.6:
  Restore behavior of CloneCommand

Change-Id: I3092bf214c41436b57e0ede9d2202f8aabf15471
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-02-10 10:48:39 +01:00