]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoUploadPackTest: Fix unused parameter in checkUnadvertisedIfUnallowed 83/153283/1
David Pursehouse [Mon, 25 Nov 2019 00:31:49 +0000 (09:31 +0900)]
UploadPackTest: Fix unused parameter in checkUnadvertisedIfUnallowed

Change-Id: I6042c401fff55325128d47e7e9098fc7e60d501d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBitmappedReachabilityChecker: Use only one bitmap for the whole check 02/152702/16
Ivan Frade [Thu, 14 Nov 2019 21:56:27 +0000 (13:56 -0800)]
BitmappedReachabilityChecker: Use only one bitmap for the whole check

The checker is creating a new bitmap per branch leading to excessive
memory consumption. For the reachability check one bitmap with the
reachability of all branches aggregated is enough.

Build the reachability bitmap with a filter. The filter itself uses it
to emit only commits not reached before and the caller to check what
targets have been reached already.

BitmapCalculator is not required anymore.

Change-Id: Ic5c62f77fe0f188913215b7eaa51d849a9aae6a5
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agocheckNotAdvertisedWants: Be lazy converting Ref to RevCommit 89/152989/8
Ivan Frade [Tue, 19 Nov 2019 20:08:53 +0000 (12:08 -0800)]
checkNotAdvertisedWants: Be lazy converting Ref to RevCommit

The ref points to an ObjectId that then is translated into a RevCommit.
This translation can be costly and with the incremental reachability
check is probably not needed for most of the elements.

Delay the translation from ObjectId to RevCommit to when it is needed.
Use Streams, that have the laziness built-in, all the way from Ref to
RevCommit.

This should reduce the latency for reachability checks over big sets of
references.

Change-Id: I28693087321b2beff3eaa1f3d2e7840ab0eedc6d
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoReachabilityChecker: Receive a Stream instead of a Collection 88/152988/6
Ivan Frade [Tue, 19 Nov 2019 18:40:21 +0000 (10:40 -0800)]
ReachabilityChecker: Receive a Stream instead of a Collection

Preparatory change. Converting ObjectIds to RevCommits is potentially
expensive and in the incremental reachability check, it is probably not
required for all elements in the collection.

Pass a Stream to the reachability checker. In the follow up we make
the conversion from ObjectId to RevCommit in the stream (i.e. on
demand). This should reduce the latency of reachability checks over big
sets of references.

Change-Id: I9f310e331de5b0bf8de34143bd7dcd34316d2fba
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoUploadPack: Prioritize references for non-advertised wants checks 32/152532/6
Ivan Frade [Tue, 12 Nov 2019 22:33:29 +0000 (14:33 -0800)]
UploadPack: Prioritize references for non-advertised wants checks

UploadPack needs to check if object ids that weren't advertised before
are reachable from the references visible to the user. In the
bitmap-based reachability check, this is done incrementally: checking
against one reference, if anything remaining adding a second and so on.
It is more efficient to check first more common references (e.g. refs/heads/*)

Sort the references for the reachability checker. This should solve the
connectivity earlier and require less bitmap creation and less memory.

Change-Id: I48ac10d71e29fab2d346479802401eaea4aacb5c
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoReceivePack: Fix name hiding of 'atomic' member 32/152832/1
David Pursehouse [Sun, 17 Nov 2019 18:30:46 +0000 (10:30 -0800)]
ReceivePack: Fix name hiding of 'atomic' member

Change-Id: Ia357d49ca793ff1cb86e7130bc1a5f59590496a9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoReceivePack: Remove unnecessarily nested else-clause 31/152831/1
David Pursehouse [Sun, 17 Nov 2019 18:27:05 +0000 (10:27 -0800)]
ReceivePack: Remove unnecessarily nested else-clause

Change-Id: I604ea76e03503300a381eca9c213f73677b5e21f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSimplify comparator code 28/152828/1
Michael Keppler [Sun, 17 Nov 2019 17:07:09 +0000 (18:07 +0100)]
Simplify comparator code

Use lambda style comparators where possible. They are easier to read.

Change-Id: I5b80cfcd90909c94286742fa83af71015532809f
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
5 years agoFix typo in Javadoc 27/152827/1
Michael Keppler [Sun, 17 Nov 2019 17:05:46 +0000 (18:05 +0100)]
Fix typo in Javadoc

No functional changes.

Change-Id: Ic7f9bb85806eca2788303c2f808d003cdfc7cc7c
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
5 years agopgm: add write stats to BenchmarkReftable 07/152607/21
Han-Wen Nienhuys [Wed, 13 Nov 2019 23:23:01 +0000 (15:23 -0800)]
pgm: add write stats to BenchmarkReftable

Usage:

  git ls-remote https://gerrit.googlesource.com/gerrit > lsr

  bazel build org.eclipse.jgit.pgm:jgit && rm -rf /tmp/reftable* && \
    ./bazel-bin/org.eclipse.jgit.pgm/jgit debug-benchmark-reftable \
    --test write_stack lsr /tmp/reftable

On my Lenovo x250 laptop, this yields about 1ms per ref write.

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

5 years agopgm: add command to convert repo to reftable 35/148735/57
Han-Wen Nienhuys [Thu, 29 Aug 2019 18:18:10 +0000 (20:18 +0200)]
pgm: add command to convert repo to reftable

Change-Id: I2f870699995da164a3e7adec430301ac7a53c425
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agofile: implement FileReftableDatabase 68/146568/92
Han-Wen Nienhuys [Mon, 12 Aug 2019 15:33:51 +0000 (17:33 +0200)]
file: implement FileReftableDatabase

Reftable is a binary, block-based storage format for the ref-database.
It provides several advantages over the traditional packed + loose
storage format:

 * O(1) write performance, even for deletions and transactions.

 * atomic updates to the ref database.

 * O(log N) lookup and prefix scans

 * free from restrictions imposed by the file system: it is
   case-sensitive even on case-insensitive file systems, and has
   no inherent limitations for directory/file conflicts

 * prefix compression reduces space usage for repetitive ref names,
   such as gerrit's refs/changes/xx/xxxxx format.

FileReftableDatabase is based on FileReftableStack, which does
compactions inline. This is simple, and has good median performance,
but every so often it will rewrite the entire ref database.

For testing, a FileReftableTest (mirroring RefUpdateTest) is added to
check for Reftable specific behavior. This must be done separately, as
reflogs have different semantics.

Add a reftable flavor of BatchRefUpdateTest.

Add a FileReftableStackTest to exercise compaction.

Add FileRepository#convertToReftable so existing testdata can be
reused.

CQ: 21007
Change-Id: I1837f268e91c6b446cb0155061727dbaccb714b8
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix Maven missing version warning 92/152792/1
Michael Keppler [Sat, 16 Nov 2019 15:49:38 +0000 (16:49 +0100)]
Fix Maven missing version warning

[WARNING] Some problems were encountered while building the effective
model for org.eclipse.jgit:org.eclipse.jgit.benchmarks:jar:5.6.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for
org.apache.maven.plugins:maven-shade-plugin is missing. @ line 131,
column 15

Change-Id: Id25916c460bc4a10d0f797779d24f53292df2b77
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
5 years agoUse Java 8 source and target in Maven 90/152790/1
Michael Keppler [Sat, 16 Nov 2019 15:23:34 +0000 (16:23 +0100)]
Use Java 8 source and target in Maven

Building the jgit aggregator with Maven leads to a compiler level 1.6
for me, thereby failing the build. Multiple profiles specify
source/target level separately, but there seems no global setting.
Adding the global properties makes the jgit aggregator compile on my
system.

Change-Id: Ia5613cc0fcf6085265a9e48f940e5a7d3f998608
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
5 years agoReceivePack: Reduce visibility of methods 26/152626/7
David Pursehouse [Thu, 14 Nov 2019 00:40:14 +0000 (16:40 -0800)]
ReceivePack: Reduce visibility of methods

Several methods were protected when they were defined in BaseReceivePack
which has since been squashed into ReceivePack. Those methods no longer
need to be protected, and can now be private instead.

Change-Id: Ic6bb5e66f353fcbdc7919847423234af398c88b4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSuppress API error raised for constant added in 345e2648 70/152770/1
Matthias Sohn [Sat, 16 Nov 2019 08:17:32 +0000 (00:17 -0800)]
Suppress API error raised for constant added in 345e2648

Change-Id: I29fb091f27f38c74843d50c2602164fc63ab8a16
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoTopoSortGenerator: simplify first-parent handling 61/151661/3
Thomas Wolf [Sat, 26 Oct 2019 17:46:31 +0000 (19:46 +0200)]
TopoSortGenerator: simplify first-parent handling

Change-Id: I74b40f1a2f81911c1d5ac5ae93b4a160fccf8f73
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRewriteGenerator: avoid adding null parent 57/151657/4
Thomas Wolf [Fri, 25 Oct 2019 23:00:16 +0000 (01:00 +0200)]
RewriteGenerator: avoid adding null parent

Prevent adding a null parent to a commit's parent array. Doing so
can cause NPEs later on.

Bug: 552160
Change-Id: Ib24b7b9b7b08e0b6f246006b4a4cade7eeb830b9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoDiffFormatter: support core.quotePath = false 10/151710/4
Thomas Wolf [Mon, 28 Oct 2019 17:11:57 +0000 (18:11 +0100)]
DiffFormatter: support core.quotePath = false

core.quotePath = false means that "bytes higher than 0x80 are not
considered "unusal" anymore"[1], i.e., they are not escaped. In
essence this preserves non-ASCII characters in path names in output.

Note that control characters and other special characters in the
ASCII range will still be escaped.

Add a new QuotedString.GIT_PATH_MINIMAL singleton implementing this.
Change the normal GIT_PATH algorithm to use bytes instead of characters
so it can be re-used. Provide a setter in DiffFormatter for the quoting
style so that an application can override the default, which is the
setting from the git config (and by default "true"). Use the new
QuotedString.GIT_PATH_MINIMAL when core.quotePath == false.

[1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath

Bug: 552467
Change-Id: Ifcb233e7d10676333bf42011e32d01a4e1138059
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoIndexDiff/SubmoduleWalk: make the RepositoryBuilder configurable 60/151660/6
Thomas Wolf [Sat, 26 Oct 2019 17:58:07 +0000 (19:58 +0200)]
IndexDiff/SubmoduleWalk: make the RepositoryBuilder configurable

Some applications using JGit use their own repository caching. In
such applications, it may be needlessly inefficient to create new
submodule repositories from a SubmoduleWalk or in an IndexDiff. It
can be much more efficient to use an already cached repository
instance.

Provide a way to configure a SubmoduleWalk with a factory to create
BaseRepositoryBuilders to use to create repositories, and use it in
IndexDiff. Provide new IndexDiff.diff() operations that take such an
additional factory as parameter.

An application that caches Repository instances (for instance EGit)
can use a factory that provides builders that don't create a new
Repository instance but that return the already cached instance, if
one is available. Note that in such a case, the application may need
to be prepared to deal with IndexDiff.diff() also _closing_ the
obtained repository; if the application expects its cached Repository
instances to remain open while being cached, it'll have to use
Repository.incrementOpen() to prevent that the repository instance
gets closed.

Bug: 550878
Change-Id: Icc1b34dfc4cebd8ed4739dd09d37744d41adf711
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoIndexDiff/SubmoduleWalk: handle submodule.<name>.ignore correctly 07/151407/4
Thomas Wolf [Mon, 21 Oct 2019 20:28:50 +0000 (22:28 +0200)]
IndexDiff/SubmoduleWalk: handle submodule.<name>.ignore correctly

IndexDiff would apply ignore mode ALL from .gitmodules to all remaining
submodules, and would ignore other settings from .gitignore and always
apply the setting defined on the IndexDiff instead. Correct that.

In canonical git the ignore setting from .gitmodules can also be
overridden by .git/config.[1] Implement that override in SubmoduleWalk.

[1] https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtignore

Bug: 521613
Change-Id: I9199fd447e41c7838924856dce40678370b66395
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge changes I583491f6,Idd44e3bb
Jonathan Nieder [Thu, 14 Nov 2019 23:21:04 +0000 (18:21 -0500)]
Merge changes I583491f6,Idd44e3bb

* changes:
  Run Eclipse formatter on BatchRefUpdateTest
  Move KetchSystem.delay to FileUtils.

5 years agoRun Eclipse formatter on BatchRefUpdateTest 00/152700/1
Han-Wen Nienhuys [Thu, 14 Nov 2019 21:48:28 +0000 (13:48 -0800)]
Run Eclipse formatter on BatchRefUpdateTest

Change-Id: I583491f621e54401c60150efb285fcc7243a9355
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoSuppress the API errors introduced by 3e9a5f99 85/152685/1
Matthias Sohn [Thu, 14 Nov 2019 18:08:24 +0000 (10:08 -0800)]
Suppress the API errors introduced by 3e9a5f99

I1ce92869435d5eebb7d671be44561e69c6233134 merged BaseReceivePack into
ReceivePack which breaks API but is only affecting the few jgit based
servers out in the wild.

Change-Id: Iad856a2afaf3cad95d01ad81a0116cebcd9de2d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoReceivePack: Remove unused getLockMessageProcessName method 25/152625/1
David Pursehouse [Thu, 14 Nov 2019 00:33:34 +0000 (16:33 -0800)]
ReceivePack: Remove unused getLockMessageProcessName method

Change-Id: I85a0c3e3a53f87ad6f6eda41c7c6cb41b403b3bb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoReceivePack: Remove unnecessary ReceivePack. prefix on static call 24/152624/1
David Pursehouse [Thu, 14 Nov 2019 00:31:48 +0000 (16:31 -0800)]
ReceivePack: Remove unnecessary ReceivePack. prefix on static call

Change-Id: I2d9a95266f5baa5a2298451adbd9ca0259b26c4b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agotransport: Merge BaseReceivePack into ReceivePack 36/146536/6
Masaya Suzuki [Tue, 23 Jul 2019 19:54:43 +0000 (12:54 -0700)]
transport: Merge BaseReceivePack into ReceivePack

Move the BaseReceivePack implementation back into ReceivePack. This is a
backward-incompatible change. For example, BaseReceivePack.FirstLine no
longer exists and cannot be referenced.  However, most of the code
should just work by replacing BaseReceivePack with ReceivePack.

Although this is an API change, it only affects callers using JGit as a
server, and there are very few of those in the wild.

Change-Id: I1ce92869435d5eebb7d671be44561e69c6233134
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
5 years agoMove KetchSystem.delay to FileUtils. 88/152588/5
Han-Wen Nienhuys [Wed, 13 Nov 2019 15:12:05 +0000 (07:12 -0800)]
Move KetchSystem.delay to FileUtils.

This will provide exponential backoff with jitter to other JGit
components too.

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

5 years agoBaseReceivePack: Add hasReceivedPack method 97/152597/2
David Pursehouse [Wed, 13 Nov 2019 18:16:25 +0000 (10:16 -0800)]
BaseReceivePack: Add hasReceivedPack method

The getPackSize method will throw IllegalStateException if it is
called when the pack size is not set. This is the case for example
when the received commands are all DELETE and there is no pack.

Add a new method hasReceivedPack that can be called prior to calling
getPackSize, to avoid causing the IllegalStateException.

See [1] for context.

[1] https://bugs.chromium.org/p/gerrit/issues/detail?id=11918

Change-Id: I56397256a05e92c8398e65c07a859cee59b46317
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSilence API errors for new API introduced in 5.5.2 09/152509/1
Matthias Sohn [Tue, 12 Nov 2019 17:51:22 +0000 (18:51 +0100)]
Silence API errors for new API introduced in 5.5.2

Change-Id: I9fee5138ea8f407d9d34cad4659c3a2d4f3ebf35
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade wagon-ssh to 3.3.4 03/152503/1
David Pursehouse [Tue, 12 Nov 2019 16:08:51 +0000 (08:08 -0800)]
Upgrade wagon-ssh to 3.3.4

Change-Id: I6162b72fc06376f33fe34b9fef1c106800e3a920
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.5' 84/152484/1
Thomas Wolf [Tue, 12 Nov 2019 08:43:30 +0000 (09:43 +0100)]
Merge branch 'stable-5.5'

* stable-5.5:
  Fix NPE in SystemReader in tests

Change-Id: I8500caeca99fe05ce9a80b54330b72e23670a46b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoFix NPE in SystemReader in tests 67/152467/1
Thomas Wolf [Tue, 12 Nov 2019 08:38:04 +0000 (09:38 +0100)]
Fix NPE in SystemReader in tests

SystemReader.updateAll() must _not_ test whether the file exists. In
tests at least there are FileBasedConfigs with a null file. Test
configs should (and do) override isOutdated() to deal with this case.

Change-Id: I56303fe0d56afeb9f2203ee807a92c5dcf3809e9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge branch 'stable-5.5' 52/152452/1
Matthias Sohn [Mon, 11 Nov 2019 19:07:01 +0000 (11:07 -0800)]
Merge branch 'stable-5.5'

* stable-5.5:
  BaseReceivePack: Fix the format
  Prepend hostname to subsection used to store file timestamp resolution
  Store filesystem timestamp resolution in extra jgit config
  SystemReader: extract updating config and its parents if outdated

Change-Id: Iecfddce8081303af29badcdcd3d72a0da50c964f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBaseReceivePack: Fix the format 55/152355/2
Masaya Suzuki [Fri, 8 Nov 2019 01:17:21 +0000 (17:17 -0800)]
BaseReceivePack: Fix the format

Change-Id: I6136ef5318f81a6feb1267338ca76e60122fd15b
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
5 years agoPrepend hostname to subsection used to store file timestamp resolution 40/150740/9
Matthias Sohn [Mon, 7 Oct 2019 17:05:07 +0000 (19:05 +0200)]
Prepend hostname to subsection used to store file timestamp resolution

This ensures the measured filesystem timestamp resolution will be only
used on the machine where it was measured and avoid errors in case the
~/.jgitconfig file is copied to another machine.

Bug: 551850
Change-Id: Iff2a11be62ca94c3bbe4a955182988dc50852f9f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoStore filesystem timestamp resolution in extra jgit config 39/150739/9
Matthias Sohn [Mon, 7 Oct 2019 15:58:56 +0000 (17:58 +0200)]
Store filesystem timestamp resolution in extra jgit config

This avoids polluting hand-crafted user level config with
auto-configured options which might disturb in environments where
the user level config is replicated between different machines.

Add a jgit config as parent of the system level config. Persist
measured timestamp resolutions always in this jgit config and read it
via the user global config. This has the effect that auto-configured
timestamp resolution will be used by default and can be overridden in
either the system level or user level config.

Store the jgit config under the XDG_CONFIG_HOME directory following the
XDG base directory specification [1] in order to ensure that we have
write permissions to persist the file. This has the effect that each OS
user will use its jgit config since they typically use different
XDG_CONFIG_HOME directories.

If the environment variable XDG_CONFIG_HOME is defined the jgit config
file is located at $XDG_CONFIG_HOME/jgit/config otherwise the default is
~/.config/jgit/config.

If you want to avoid redundant measurement for different OS users
manually copy the values measured and auto-configured for one OS user to
the system level git config.

[1] https://wiki.archlinux.org/index.php/XDG_Base_Directory

Bug: 551850
Change-Id: I0022bd40ae62f82e5b964c2ea25822eb55d94687
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate bouncycastle version to 1.64 and Orbit to I20191106190530 95/151295/6
David Ostrovsky [Fri, 18 Oct 2019 08:21:27 +0000 (04:21 -0400)]
Update bouncycastle version to 1.64 and Orbit to I20191106190530

The recent versions fixed number of defects and added new features: [1].
Use Orbit I20191106190530 until a S-build is available.

[1] https://www.bouncycastle.org/releasenotes.html

Change-Id: I0f2fd3a218ea31f6f6b58b1816af9361e4de54e4
Signed-off-by: David Ostrovsky <d.ostrovsky@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSystemReader: extract updating config and its parents if outdated 47/149947/8
Thomas Wolf [Sat, 21 Sep 2019 12:38:22 +0000 (14:38 +0200)]
SystemReader: extract updating config and its parents if outdated

Change-Id: Ia77f442e47c5670c2d6d279ba862044016aabd86
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade maven-jar-plugin to 3.2.0 36/152036/2
David Pursehouse [Tue, 5 Nov 2019 13:49:48 +0000 (22:49 +0900)]
Upgrade maven-jar-plugin to 3.2.0

Change-Id: I74fc2a6b1a79f1433914b909e92e524668817081
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUpgrade maven-source-plugin to 3.2.0 35/152035/2
David Pursehouse [Tue, 5 Nov 2019 13:49:16 +0000 (22:49 +0900)]
Upgrade maven-source-plugin to 3.2.0

Change-Id: I0c683e100b64f6d66e2598cb06970a547aaeaed6
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.5' 83/152183/1
Matthias Sohn [Wed, 6 Nov 2019 20:07:09 +0000 (21:07 +0100)]
Merge branch 'stable-5.5'

* stable-5.5:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Ife566e83777e3282892d6f7a90400b00e9065292

5 years agoMerge branch 'stable-5.4' into stable-5.5 82/152182/1
Matthias Sohn [Wed, 6 Nov 2019 20:05:07 +0000 (21:05 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: I1863f641880e8d9fbd26c02ede6bf5d773e8c8a0

5 years agoMerge branch 'stable-5.3' into stable-5.4 81/152181/1
Matthias Sohn [Wed, 6 Nov 2019 20:02:14 +0000 (21:02 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Ib4eed75cc8c5146884ce1461e98564de1c759bba

5 years agoMerge branch 'stable-5.2' into stable-5.3 80/152180/1
Matthias Sohn [Wed, 6 Nov 2019 20:00:07 +0000 (21:00 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: Icda57b0045ba87d9424615713d7d706697e5c236

5 years agoMerge branch 'stable-5.1' into stable-5.2 79/152179/1
Matthias Sohn [Wed, 6 Nov 2019 19:57:46 +0000 (20:57 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix benchmark pom.xml to include distribution managment config

Change-Id: I20e8b7155397771b1bc77e628f535f27458a24bb

5 years agoFix benchmark pom.xml to include distribution managment config 64/152164/2
Matthias Sohn [Wed, 6 Nov 2019 16:49:48 +0000 (17:49 +0100)]
Fix benchmark pom.xml to include distribution managment config

Also fix indentation.

Change-Id: I6d223c493d537bb8aac23c7ddf0a602aff22a3c2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.5' 14/152114/1
Matthias Sohn [Tue, 5 Nov 2019 15:28:06 +0000 (16:28 +0100)]
Merge branch 'stable-5.5'

* stable-5.5:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: If87a13d0f809d9968ad2921b786f4b18e1b494d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 59/152059/1
Matthias Sohn [Tue, 5 Nov 2019 15:10:48 +0000 (16:10 +0100)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: I071536d630a95e89f5bbbf965a1571b9f5eb81ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 56/152056/1
Matthias Sohn [Tue, 5 Nov 2019 14:42:14 +0000 (15:42 +0100)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: Ib735c4039e24ec8b045ae2cc81df1e9e5c9fa996
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 50/152050/1
Matthias Sohn [Tue, 5 Nov 2019 14:24:54 +0000 (15:24 +0100)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: I00615958ab6fbdff601e87a9792aba5606cda12a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 73/151973/2
Matthias Sohn [Tue, 5 Nov 2019 14:07:39 +0000 (15:07 +0100)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: If91c55a192d3b2c441d9c8d414f2e24a7261b1b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoRun JMH benchmarks using bazel 23/147023/12
Matthias Sohn [Sun, 4 Aug 2019 17:04:41 +0000 (19:04 +0200)]
Run JMH benchmarks using bazel

The benchmarks can be built and run using bazel by running:

$ bazel run //org.eclipse.jgit.benchmarks:benchmarks

Change-Id: I6679750eaa0f2be30ed9d45036e013b0ea4fcc86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBenchmark for creating files and FileSnapshots 71/147171/7
Matthias Sohn [Wed, 7 Aug 2019 09:51:30 +0000 (11:51 +0200)]
Benchmark for creating files and FileSnapshots

Change-Id: I953fd8b6b9743b0b9cada244331253eb2121784d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoImplement benchmark for looking up FileStore of a given Path 66/147066/7
Matthias Sohn [Mon, 5 Aug 2019 14:26:20 +0000 (16:26 +0200)]
Implement benchmark for looking up FileStore of a given Path

Results on Mac OS 10.14.6 using APFS:

Result "org.eclipse.jgit.benchmarks.LookupFileStoreBenchmark.testLookupFileStore":
  44583.277 Â±(99.9%) 2666.096 ns/op [Average]
  (min, avg, max) = (43707.073, 44583.277, 45320.685), stdev = 692.377
  CI (99.9%): [41917.181, 47249.373] (assumes normal distribution)

Secondary result
"org.eclipse.jgit.benchmarks.LookupFileStoreBenchmark.testLookupFileStore:·stack":
Stack profiler:

....[Thread state
distributions]........................................................
100.0%         RUNNABLE

....[Thread state:
RUNNABLE].............................................................
 42.5%  42.5% sun.nio.fs.UnixNativeDispatcher.realpath0
 37.9%  37.9% sun.nio.fs.UnixNativeDispatcher.stat0
 11.0%  11.0% sun.nio.fs.BsdNativeDispatcher.getfsstat
  7.6%   7.6% sun.nio.fs.BsdNativeDispatcher.fsstatEntry
  0.7%   0.7% sun.nio.fs.BsdNativeDispatcher.endfsstat
  0.1%   0.1% sun.nio.fs.UnixPath.initOffsets
  0.0%   0.0% sun.nio.fs.UnixFileAttributes.get
  0.0%   0.0% java.util.zip.Inflater.inflateBytes
  0.0%   0.0% sun.misc.Unsafe.compareAndSwapInt
  0.0%   0.0% sun.nio.fs.BsdFileStore.findMountEntry

This shows that FS.attrCacheByPath should be useful to reduce overhead
of looking up the FileStore of a given file.

Change-Id: I7213086b42e0453f0ee149660d507dac2a4644cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJMH benchmark for SimpleLruCache 22/147022/10
Matthias Sohn [Sat, 3 Aug 2019 10:02:34 +0000 (12:02 +0200)]
JMH benchmark for SimpleLruCache

See [1] for JMH documentation and [2] how to use JMH in Eclipse.

The benchmarks pom currently cannot use the JGit parent pom due to an
ecj bug [3] regarding annotation processing. Hence for now do not
inherit from the JGit parent pom and copy the compiler plugin
configuration for javac from the parent pom.

After running the Maven build the benchmark can be run using Maven:

$ java -jar org.eclipse.jgit.benchmarks/target/benchmarks.jar

or in Eclipse by running the main method of the SimpleLruCacheBenchmark
class.

[1] https://openjdk.java.net/projects/code-tools/jmh/
[2] http://alblue.bandlem.com/Page/3/index.html
[3] https://eclip.se/532029

CQ: 20517
CQ: 20518
Change-Id: Idca8a9e0980f0b8a9c741c4c9e97d03c62f07c8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate API problem filters 72/151972/1
Matthias Sohn [Mon, 4 Nov 2019 15:24:55 +0000 (16:24 +0100)]
Update API problem filters

- filter errors for new APIs added in service release
- remove unused filters

Change-Id: Ifbf532b8a3c46d4ed78a38f6c75073a072b7f669
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoRemove unused API problem filters 48/151948/1
Matthias Sohn [Mon, 4 Nov 2019 12:28:23 +0000 (13:28 +0100)]
Remove unused API problem filters

Change-Id: I0ae0fd4919b7ccc5218c6eb0fab22350bb9c9714
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSilence API errors for new API added since 5.1.0 47/151947/1
Matthias Sohn [Mon, 4 Nov 2019 12:25:37 +0000 (13:25 +0100)]
Silence API errors for new API added since 5.1.0

Change-Id: I92a7c1b0319d61aeb25f58048bd07c144068c3db
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoDirCacheCheckout: don't use deprecated method 18/151918/1
Thomas Wolf [Sun, 3 Nov 2019 09:14:40 +0000 (10:14 +0100)]
DirCacheCheckout: don't use deprecated method

Pass the CheckoutMetadata to checkoutEntry(), otherwise cr-lf settings
and smudge filters would be ignored.

Change-Id: Ifb1c4cb098a0b47c9752d0231d530db6a92b25a4
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoWorkingTreeModifiedEvent: must be fired explicitly after merge 10/151910/2
Thomas Wolf [Sat, 2 Nov 2019 18:26:42 +0000 (19:26 +0100)]
WorkingTreeModifiedEvent: must be fired explicitly after merge

A merge may write files to the working tree. After a successful
merge one must fire a WorkingTreeModifiedEvent explicitly if
getModifiedFiles() is not empty.

Also, any touched files must be reported by the
WorkingTreeModifiedEvent fired by DirCacheCheckout.checkout().

Bug: 552636
Change-Id: I5fab8279ed8be8a4ae34cddfa726836b9277aea6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge "HttpSupport.proxyFor(): use only scheme, host, and port"
David Pursehouse [Wed, 30 Oct 2019 23:20:30 +0000 (19:20 -0400)]
Merge "HttpSupport.proxyFor(): use only scheme, host, and port"

5 years agoreftable: enforce ascending order in sortAndWriteRefs 61/151061/8
Han-Wen Nienhuys [Sun, 13 Oct 2019 16:14:17 +0000 (18:14 +0200)]
reftable: enforce ascending order in sortAndWriteRefs

MergedReftableTest#scanDuplicates tests whether we can write duplicate
keys in a merged reftable. Apparently, the first key appearing should
get precedence, and this works because the sort() algorithm on ordered
collections is stable.

This is potentially confusing behavior, because you can write data
into the table that cannot be retrieved (Merged table can only have
one entry per key), and the APIs such as exactRef() only return a
single value.

Make this consistent with behavior introduced in I04f55c481 "reftable:
enforce ordering for ref and log writes" by considering a duplicate key
in sortAndWriteRefs as a fatal runtime error.

Change-Id: I1eedd18f028180069f78c5c467169dcfe1521157
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoHttpSupport.proxyFor(): use only scheme, host, and port 84/146884/2
Thomas Wolf [Wed, 31 Jul 2019 17:40:40 +0000 (19:40 +0200)]
HttpSupport.proxyFor(): use only scheme, host, and port

Some URLs cannot be converted via URL.toURI(). So don't convert
the full URL but only the bits that are needed to find a proxy
via java.net.ProxySelector.

Bug: 549690
Change-Id: I55b5ecee70c6b52f72f9bdba9ce552fde7f33976
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoDocumentation/technical/reftable: change suggested file names 42/148142/5
Han-Wen Nienhuys [Thu, 22 Aug 2019 13:47:17 +0000 (15:47 +0200)]
Documentation/technical/reftable: change suggested file names

By using ${min_update}-${max_update} as file name template, we
guarantee that each file has a unique name.
This allows data from open files to be cached across reloads of the
stack.

This is in anticipation of Change I1837f268e
("file: implement FileReftableDatabase"), which is the first
implementation of reftable on a filesystem.

Change-Id: I7ef0610eb60c494165382d0c372afcf41f074393
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoUpdate Orbit to S20191025144108 and Ant to 1.10.7.v20190926-0324 42/151742/2
Matthias Sohn [Tue, 29 Oct 2019 11:17:04 +0000 (12:17 +0100)]
Update Orbit to S20191025144108 and Ant to 1.10.7.v20190926-0324

This is the Orbit version for 2019-12 M2.

We tried earlier to update to Ant 1.10.7 but had to revert this since
there were issues with the previous artefact version in Orbit.

See platform bug 550793 for the list of changes since 1.10.6.

Change-Id: Ifb3212d4420e3656083784e842da2bd9bf750911
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate Tycho to 1.5.1 38/151738/1
Matthias Sohn [Tue, 29 Oct 2019 10:43:16 +0000 (11:43 +0100)]
Update Tycho to 1.5.1

This release fixes bug 552346 [1].

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=552346

Change-Id: I53be02c3702e62d3b5ceb85141b9798571a8ca0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade Jetty to 9.4.22.v20191022 06/151606/3
Michael Keppler [Fri, 25 Oct 2019 11:20:05 +0000 (13:20 +0200)]
Upgrade Jetty to 9.4.22.v20191022

Change-Id: Ie2ee0a978949f9cf70833645132eedf26c3cf1c8
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "[errorprone] Don't throw exception in finally"
David Pursehouse [Sat, 26 Oct 2019 01:56:06 +0000 (21:56 -0400)]
Merge "[errorprone] Don't throw exception in finally"

5 years agoMerge "[errorprone] Add parenthesis to clarify operator precedence"
David Pursehouse [Sat, 26 Oct 2019 01:55:33 +0000 (21:55 -0400)]
Merge "[errorprone] Add parenthesis to clarify operator precedence"

5 years agoReplace "Rebase interactive" with "Interactive rebase" 52/151552/2
Matthias Sohn [Thu, 24 Oct 2019 22:28:42 +0000 (00:28 +0200)]
Replace "Rebase interactive" with "Interactive rebase"

The RepositoryState's description is shown in EGit's interactive rebase
view. Use the grammatically correct form.

Bug: 552359
Change-Id: I860ef730a67f2b34d7fabbfbda5ea65ead9270d2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years ago[errorprone] Don't throw exception in finally 29/151629/1
Matthias Sohn [Fri, 25 Oct 2019 13:11:42 +0000 (15:11 +0200)]
[errorprone] Don't throw exception in finally

Instead log the problem. There is no reason to panic when we fail to
delete a single temporary file in java.io.tmpdir.

Change-Id: Idb867b3f07b090c7453ccd3688e94097df3b2672
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years ago[errorprone] Add parenthesis to clarify operator precedence 28/151628/1
Matthias Sohn [Fri, 25 Oct 2019 13:15:03 +0000 (15:15 +0200)]
[errorprone] Add parenthesis to clarify operator precedence

This fixes OperatorPrecedence error raised by errorprone on FS#findHook.

Change-Id: Ia15f61902c7deff7328c1afa066fc53152949bbf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoGPG: implement more OpenPGP UserId matching formats 54/151454/2
Thomas Wolf [Tue, 22 Oct 2019 22:55:28 +0000 (00:55 +0200)]
GPG: implement more OpenPGP UserId matching formats

Instead of just looking for a substring match of user.signingKey
in a key's user ID implement the GPG matching formats[1] for:

'=' Full exact match
'<' Full exact match of the e-mail address
'@' Substring match within the e-mail address only
'*' General case-insensitive substring match (default)

When user.signingKey is not set, the committer's e-mail address is
used by default. In that case, use '<', i.e., require an exact match
on the OpenPGP e-mail address.

Also handle the optional "0x" prefix for (partial) key fingerprints.

[1] https://www.gnupg.org/documentation/manuals/gnupg/Specify-a-User-ID.html

Bug: 550335
Change-Id: I6ce482a099ff1a0dc9de45435cd4d3ec5b504f12
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge "reftable: remove assert calls"
Jonathan Tan [Tue, 22 Oct 2019 21:06:59 +0000 (17:06 -0400)]
Merge "reftable: remove assert calls"

5 years agoMerge "TreeRevFilterTest: Simplify filter used"
Jonathan Tan [Tue, 22 Oct 2019 17:36:46 +0000 (13:36 -0400)]
Merge "TreeRevFilterTest: Simplify filter used"

5 years agoTreeRevFilterTest: Simplify filter used 11/151411/2
Jonathan Tan [Tue, 22 Oct 2019 00:26:22 +0000 (17:26 -0700)]
TreeRevFilterTest: Simplify filter used

TreeRevFilterTest uses an unncessarily complicated TreeFilter - an
AndTreeFilter - when it should be as simple as possible because this
class tests TreeRevFilter, not AndTreeFilter. Replace the filter with a
simpler one.

Change-Id: I3256a65f6e0042d32fd76a9224b79a835674ff3a
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
5 years agoreftable: remove assert calls 26/151426/2
Han-Wen Nienhuys [Tue, 22 Oct 2019 09:56:45 +0000 (11:56 +0200)]
reftable: remove assert calls

The effect of assert is defined by compiler flags, so this code
introduced a potential vector for corruption.

Change-Id: I12197432e4351a5bd4aa24d352a19937721845c3
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoMerge "GpgKeyLocator: Return a signing key for a user instead of the master key"
Gunnar Wagenknecht [Tue, 22 Oct 2019 05:22:26 +0000 (01:22 -0400)]
Merge "GpgKeyLocator: Return a signing key for a user instead of the master key"

5 years agoMerge "GpgKeyLocator: Return subkeys instead of the first key for subkeys"
Gunnar Wagenknecht [Tue, 22 Oct 2019 05:21:34 +0000 (01:21 -0400)]
Merge "GpgKeyLocator: Return subkeys instead of the first key for subkeys"

5 years agoGpgKeyLocator: Return a signing key for a user instead of the master key 13/151413/1
Roan Hofland [Tue, 22 Oct 2019 00:16:43 +0000 (02:16 +0200)]
GpgKeyLocator: Return a signing key for a user instead of the master key

Currently when a GPG key is looked up using a user identity the first
key from the keyring that has this user identity is returned.
The code was changed to instead return the first signing [S] key in this
keyring and only return the master key if no such signing key was found.
If the master key also does not have the signing flag set null is
returned instead.

Bug: 552288
Change-Id: I194862991d13c2c7ff34a60a54a227167f88f53b
Signed-off-by: Roan Hofland <roan.hofland@hotmail.com>
5 years agoGpgKeyLocator: Return subkeys instead of the first key for subkeys 12/151412/1
Roan Hofland [Tue, 22 Oct 2019 00:06:31 +0000 (02:06 +0200)]
GpgKeyLocator: Return subkeys instead of the first key for subkeys

Currently when a subkey is configured for signing via the git
user.signingkey configuration option the first key from the keyring for
this subkey would be returned for use (master key). The code has been
changed to return the requested key from the keyring instead.

Bug: 552288
Change-Id: I1c1cdf64c1667316a274ff9d829fc2b563797f2a
Signed-off-by: Roan Hofland <roan.hofland@hotmail.com>
5 years agoSupport for core.hooksPath 12/149912/7
Thomas Wolf [Fri, 20 Sep 2019 14:41:39 +0000 (16:41 +0200)]
Support for core.hooksPath

Support the core.hooksPath git config. This can be an absolute or
relative path of a directory where to find git hooks; a relative
path is resolved relative to the directory the hook will run in.

Bug: 500266
Change-Id: I671999a6386a837e897c31718583c91d8035f3ba
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpgrade Tycho to 1.5.0 92/151392/1
Michael Keppler [Mon, 21 Oct 2019 14:18:01 +0000 (16:18 +0200)]
Upgrade Tycho to 1.5.0

Change-Id: Iff3efa87997b635d84efca5b916436cc06ed9717
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
5 years agoClose ObjectReaders in tests 70/151370/1
Thomas Wolf [Mon, 21 Oct 2019 09:38:00 +0000 (11:38 +0200)]
Close ObjectReaders in tests

Change-Id: Ic839af4f85861fb48091d45679e2a614f001d770
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoClose some Repository instances in tests 69/151369/1
Thomas Wolf [Mon, 21 Oct 2019 09:23:48 +0000 (11:23 +0200)]
Close some Repository instances in tests

This doesn't yet ensure that _all_ repositories are closed. It only
handles the obvious, local, and easy cases.

Change-Id: I0f9f8607791f0f03ed1f5ad71e9595e78b78892f
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoClose ObjectInserters in tests 68/151368/1
Thomas Wolf [Mon, 21 Oct 2019 09:16:38 +0000 (11:16 +0200)]
Close ObjectInserters in tests

Change-Id: I0048a9ae23aee79cfecafb15855c63cd92818c57
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpgrade jacoco-maven-plugin to 0.8.5 80/151080/4
David Pursehouse [Tue, 15 Oct 2019 00:08:48 +0000 (09:08 +0900)]
Upgrade jacoco-maven-plugin to 0.8.5

Change-Id: If1c3c661f9bcaf0ce806f6bd5e2a3919d6635d78
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years ago[pgm] Add --mirror option to clone command 53/151353/3
Matthias Sohn [Sun, 20 Oct 2019 16:08:59 +0000 (18:08 +0200)]
[pgm] Add --mirror option to clone command

Bug: 552173
Change-Id: Ic8a98b2e0f8f29afd599723f93e51b06b9f13314
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoRemove meaningless comment in CloneCommandTest 62/151362/1
Matthias Sohn [Mon, 21 Oct 2019 07:29:50 +0000 (09:29 +0200)]
Remove meaningless comment in CloneCommandTest

This comment was probably copied from testCloneRepositoryWithBranch() to
testBareCloneRepositoryOnlyOneBranch() where it doesn't make sense.
Hence remove it.

Change-Id: I846debd084dd77fd473c3602a799f195a8390f77
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoImplement mirror option in CloneCommand 52/151352/2
Matthias Sohn [Fri, 18 Oct 2019 23:52:51 +0000 (01:52 +0200)]
Implement mirror option in CloneCommand

Bug: 552173
Change-Id: If79adf578b303890314a3285d7a6d2c71f48d091
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAppServer: Stop using deprecated SslContextFactory constructor 05/151205/1
David Pursehouse [Thu, 17 Oct 2019 01:42:28 +0000 (10:42 +0900)]
AppServer: Stop using deprecated SslContextFactory constructor

Use SslContextFactory.Client instead, as suggested in the deprecation
javadoc.

Change-Id: I746c953d3ad549c23d0e43eb4a18fc587e924f93
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoEnable and fix "Statement unnecessarily nested within else clause" warnings 03/151203/2
David Pursehouse [Thu, 17 Oct 2019 00:01:25 +0000 (09:01 +0900)]
Enable and fix "Statement unnecessarily nested within else clause" warnings

Since [1] the gerrit project includes jgit as a submodule, and has this
warning enabled, resulting in 100s of warnings in the console.

Also enable the warning here, and fix them.

At the same time, add missing braces around adjacent and nearby one-line
blocks.

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

Change-Id: I81df3fc7ed6eedf6874ce1a3bedfa727a1897e4c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoClose RevWalks in tests 80/151180/2
Thomas Wolf [Wed, 16 Oct 2019 15:49:52 +0000 (17:49 +0200)]
Close RevWalks in tests

Change-Id: Id28804ace2572e8f659271660e78454a0d6ccc49
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge "reftable: split off generic code from DFS code"
Jonathan Tan [Wed, 16 Oct 2019 19:13:53 +0000 (15:13 -0400)]
Merge "reftable: split off generic code from DFS code"

5 years agoreftable: split off generic code from DFS code 01/147301/49
Han-Wen Nienhuys [Thu, 26 Sep 2019 11:40:26 +0000 (13:40 +0200)]
reftable: split off generic code from DFS code

This introduces ReftableBatchRefUpdate and ReftableDatabase, as
generic classes, with some code moved to DfsReftableBatchRefUpdate and
DfsReftableDatabase.

Clarify thread-safety requirements by asserting locked status in
accessors, and acquiring locks in callers. This does not fix threading
problems, because ReftableBatchRefUpdate already wraps the whole
transaction in a lock.

This also fixes a number of bugs in ReftableBatchRefUpdate:

* non-atomic updates should not bail on first failure

* isNameConflicting should also check for conflicts between names that
  are added and removed in the BatchRefUpdate.

Change-Id: I5ec91173ea9a0aa19da444c8c0b2e0f4e8f88798
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "reftable: fix lookup by ID in merged reftables"
Jonathan Tan [Wed, 16 Oct 2019 17:33:20 +0000 (13:33 -0400)]
Merge "reftable: fix lookup by ID in merged reftables"

5 years agoreftable: fix lookup by ID in merged reftables 62/151062/3
Han-Wen Nienhuys [Sun, 13 Oct 2019 17:21:06 +0000 (19:21 +0200)]
reftable: fix lookup by ID in merged reftables

On changing a ref, the old SHA1 is not updated in the object => ref
mapping. This means search by object ID may still turn up a ref from
deeper within the stack. To fix this, check all refs produced by the
merged iterator against the merged reftables.

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

5 years agoMerge changes I6e022e4a,If1b9d808
David Pursehouse [Wed, 16 Oct 2019 00:11:35 +0000 (20:11 -0400)]
Merge changes I6e022e4a,If1b9d808

* changes:
  Close TreeWalks in tests
  Close SubmoduleWalks in tests

5 years agoMerge "IndexDiff: close SubmoduleWalk and use already loaded DirCache"
Christian Halstrick [Tue, 15 Oct 2019 21:06:12 +0000 (17:06 -0400)]
Merge "IndexDiff: close SubmoduleWalk and use already loaded DirCache"