]> source.dussan.org Git - jgit.git/log
jgit.git
18 months agoRevert 'Use net.i2p.crypto:eddsa directly from Maven Central' 26/202026/1
Thomas Wolf [Tue, 23 May 2023 17:45:12 +0000 (19:45 +0200)]
Revert 'Use net.i2p.crypto:eddsa directly from Maven Central'

This reverts commit 7e094c6cf32d6b6c2e49c72d506149427e97c5ab.

Reason: the maven artifact has a broken MANIFEST.MF with a mandatory
dependency to sun.security.x509, which is an internal package in the
JDK and moreover not needed by the bundle except for one test class
that isn't in the bundle at all.

This extra dependency makes the JGit tycho packaging build fail when
Tycho 4 is used.

We must keep using the Orbit re-packaging of this artifact, which does
not have this unnecessary mandatory dependency.

Change-Id: Ica15a5ddcada09686de3055b2b3daf081e3c5ffc
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoUpdate dash license-tool-plugin to 1.0.2 59/201959/2
Matthias Sohn [Fri, 19 May 2023 22:10:54 +0000 (00:10 +0200)]
Update dash license-tool-plugin to 1.0.2

Change-Id: I9708d918f4610503d7a16f55cea3aa3931dcd2cc

18 months agoMerge "Also add suppressed exception if unchecked exception occurs in finally"
Matthias Sohn [Fri, 19 May 2023 17:49:42 +0000 (13:49 -0400)]
Merge "Also add suppressed exception if unchecked exception occurs in finally"

18 months agoAlso add suppressed exception if unchecked exception occurs in finally 49/201949/2
Matthias Sohn [Thu, 18 May 2023 10:02:48 +0000 (12:02 +0200)]
Also add suppressed exception if unchecked exception occurs in finally

If a method called in a finally block throws an exception we should add
exceptions caught earlier to the exception we throw in the finally block
not regarding if it's a checked or unchecked exception.

Change-Id: I4c6be9a3a08482b07659ca31d6987ce719d81ca5

18 months agoCandidate: use "Objects.equals" instead of "==" 36/191736/7
Fabio Ponciroli [Thu, 10 Mar 2022 17:32:53 +0000 (18:32 +0100)]
Candidate: use "Objects.equals" instead of "=="

Errorprone raises the following warning:
"[ReferenceEquality] Comparison using reference equality
instead of value equality".

Change-Id: Iacb207ef0625bb987a08406d4e7461e48fade97f

18 months agoUse hamcrest 2.2 directly from Maven Central 93/201893/3
Matthias Sohn [Tue, 16 May 2023 00:06:10 +0000 (02:06 +0200)]
Use hamcrest 2.2 directly from Maven Central

Change-Id: I4039b56b1cdc54ff1886c2a4973d857d785989c2

18 months agoUse commons-logging directly from Maven Central 92/201892/3
Matthias Sohn [Tue, 16 May 2023 00:01:14 +0000 (02:01 +0200)]
Use commons-logging directly from Maven Central

Change-Id: I08e51450f70f941761539d3f08dd65c5d706dcdc

18 months agoUpdate jna to 5.13.0 91/201891/3
Matthias Sohn [Mon, 15 May 2023 22:38:52 +0000 (00:38 +0200)]
Update jna to 5.13.0

Change-Id: I87d65e66e1cac64ccb744632ea45d06f8b8637fe

18 months agoUse bytebuddy directly from Maven Central 05/201905/1
Matthias Sohn [Wed, 17 May 2023 20:22:32 +0000 (22:22 +0200)]
Use bytebuddy directly from Maven Central

Change-Id: I5e24a31b78ef3758e1ce84e3b0eacaff1608fcd9

18 months agoUse jna directly from Maven Central 90/201890/3
Matthias Sohn [Mon, 15 May 2023 22:18:45 +0000 (00:18 +0200)]
Use jna directly from Maven Central

Change-Id: I3c2576648748a6c6020c13a604cf5fcd4864aeb8

18 months agoUse net.i2p.crypto:eddsa directly from Maven Central 89/201889/2
Matthias Sohn [Mon, 15 May 2023 22:07:10 +0000 (00:07 +0200)]
Use net.i2p.crypto:eddsa directly from Maven Central

Change-Id: I8e864380fa5eb3006943b78b19f6cbe7ae9f8111

18 months agoUse org.tukaani:xz directly from Maven Central 88/201888/2
Matthias Sohn [Mon, 15 May 2023 22:03:28 +0000 (00:03 +0200)]
Use org.tukaani:xz directly from Maven Central

Change-Id: I4ab835cee694778eedaa125cc372be8b6c876133

18 months agoUse args4j directly from Maven Central 87/201887/2
Matthias Sohn [Mon, 15 May 2023 21:58:25 +0000 (23:58 +0200)]
Use args4j directly from Maven Central

Change-Id: I91c7c42c1fc779278fe30294638edef182e88347

18 months agoUse gson directly from Maven Central 46/201846/2
Matthias Sohn [Mon, 15 May 2023 21:40:17 +0000 (23:40 +0200)]
Use gson directly from Maven Central

Change-Id: I4741f733aa7ca219296ed788d4dc93df77cc65ff

18 months agoRemove unused $NON-NLS-1$ 44/201844/2
Matthias Sohn [Mon, 15 May 2023 21:01:03 +0000 (23:01 +0200)]
Remove unused $NON-NLS-1$

Change-Id: I3314e5106d873c03903562f9798de6af2ae588a7

18 months agoRemove unused API filters 43/201843/2
Matthias Sohn [Mon, 15 May 2023 20:59:55 +0000 (22:59 +0200)]
Remove unused API filters

Change-Id: I1971b31753fd4c3568016e7db955cce8e391a1e0

18 months agoSwitch to Apache MINA sshd 2.10.0 79/201879/3
Thomas Wolf [Mon, 3 Apr 2023 17:33:24 +0000 (19:33 +0200)]
Switch to Apache MINA sshd 2.10.0

Bump the version numbers in pom.xml and in MANIFESTs, and in the bazel
WORKSPACE file. Update the target platforms. Remove work-arounds in
org.eclipse.jgit.ssh.apache that are no longer necessary.

The release notes for Apache MINA sshd are at [1].

[1] https://github.com/apache/mina-sshd/blob/master/docs/changes/2.10.0.md

Bug: 581770
Change-Id: Id27e73e9712b7865353c9b32b5b768f6e998b05e
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months ago[releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX 78/201878/1
Thomas Wolf [Mon, 15 May 2023 18:35:59 +0000 (20:35 +0200)]
[releng] API filter for PackIndex.DEFAULT_WRITE_REVERSE_INDEX

New static final constant is a (very minor) API break that needs to be
suppressed explicitly despite @since 6.6.

Remove a number of no longer needed API filters, and fix a broken
$NON-NLS-1$.

Change-Id: Ie4b0c45e8bd1f3067b6ff81c07d4b21b50bb8685
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoMerge "UploadPack: Record negotiation stats on fetchV2 call"
Ivan Frade [Thu, 11 May 2023 20:53:12 +0000 (16:53 -0400)]
Merge "UploadPack: Record negotiation stats on fetchV2 call"

18 months agoPackExt: add a #getTmpExtension method 07/201807/2
Anna Papitto [Tue, 9 May 2023 17:27:52 +0000 (10:27 -0700)]
PackExt: add a #getTmpExtension method

During garbage collection, extensions for temporary files for indices
are formatted manually.

Add a method to PackExt to generate the temporary file extensions for
each type of index file programmatically.

Change-Id: I210bc2702e750bf0aea643b1a9a8536adebef179
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoUploadPack: Record negotiation stats on fetchV2 call 55/201855/8
Ronald Bhuleskar [Wed, 10 May 2023 23:29:53 +0000 (16:29 -0700)]
UploadPack: Record negotiation stats on fetchV2 call

ServiceV2 is not collecting wants/have in PackStatistics. This records
the stats for fetch and push-negotiation.

Change-Id: Iefd79f36b3d7837195e8bd9fc7007de352089e66

18 months agoRewriteGeneratorTest: Introduce test cases for the RewriteGenerator 87/201587/7
Simon Sohrt [Fri, 28 Apr 2023 11:45:15 +0000 (13:45 +0200)]
RewriteGeneratorTest: Introduce test cases for the RewriteGenerator

Bug: 577948
Signed-off-by: Simon Sohrt <sohrt@his.de>
Change-Id: I5af1a43d49379e2417611eaacdd5f06be8147bc4

18 months agoMerge "PackWriter: write the PackReverseIndex file"
Ivan Frade [Mon, 8 May 2023 19:00:46 +0000 (15:00 -0400)]
Merge "PackWriter: write the PackReverseIndex file"

18 months agoPackWriter: write the PackReverseIndex file 83/197583/33
Anna Papitto [Tue, 2 May 2023 20:45:05 +0000 (13:45 -0700)]
PackWriter: write the PackReverseIndex file

PackWriter offers the ability to write out the pack file and its various
index files, except for the newly introduced file-based reverse index.

Now that PackReverseIndexWriter can write reverse index files,
PackWriter#writeReverseIndex will write one for a pack if the
corresponding config flag PackConfig#writeReverseIndex is on.

Change-Id: Ib75dd2bbfb9ee9366d5aacb46700d8cf8af4823a
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoMerge "Fix inProcessPackedRefsLock not shared with copies of the instance"
Matthias Sohn [Wed, 3 May 2023 15:10:14 +0000 (11:10 -0400)]
Merge "Fix inProcessPackedRefsLock not shared with copies of the instance"

18 months agoUpdate Maven plugins 84/201684/3
Matthias Sohn [Wed, 3 May 2023 01:01:03 +0000 (03:01 +0200)]
Update Maven plugins

- com.github.siom79.japicmp:japicmp-maven-plugin to 0.17.2
- com.github.spotbugs:spotbugs-maven-plugin to 4.7.3.4
- maven-clean-plugin to 3.2.0
- maven-compiler-plugin to 3.11.0
- maven-deploy-plugin to 3.1.1
- maven-enforcer-plugin to 3.3.0
- maven-javadoc-plugin to 3.5.0
- maven-project-info-reports-plugin to 3.4.3
- maven-resources-plugin to 3.3.1
- maven-surefire-plugin to 3.0.0
- maven-surefire-report-plugin to 3.0.0
- org.codehaus.mojo:build-helper-maven-plugin to 3.3.0
- org.jacoco:jacoco-maven-plugin to 0.8.10
- org.springframework.boot:spring-boot-maven-plugin to 2.7.11

Change-Id: I42f3a09362a3b1afef65981cd3a862780f592af2

18 months agoAdd TransportHttp#getAdditionalHeaders 56/201656/2
Matthias Sohn [Tue, 2 May 2023 11:31:30 +0000 (13:31 +0200)]
Add TransportHttp#getAdditionalHeaders

to enable inspecting which additional HTTP headers have been set on the
transport.

Change-Id: I0771be9cb7c837de7c203b7f044109b9b2a7d7ad

18 months agoAdd 4.27 (2023-03) and 4.28 (2023-06) target platforms 44/201644/3
Matthias Sohn [Mon, 1 May 2023 21:55:38 +0000 (23:55 +0200)]
Add 4.27 (2023-03) and 4.28 (2023-06) target platforms

Change-Id: I81cfba607e000a107348006785ff374db960ea6d

18 months agoFix inProcessPackedRefsLock not shared with copies of the instance 82/201682/2
Nasser Grainawi [Tue, 2 May 2023 22:30:44 +0000 (16:30 -0600)]
Fix inProcessPackedRefsLock not shared with copies of the instance

The in process lock is intended to manage contention on locking the
packed-refs file within a single process without acquiring the file
system lock. Not sharing it across RefDirectory instances of the same
repository undermines that intent and results in more contention at the
file system level.

Change-Id: I68f11856aa0b4b1524f43554d7391a322a0a6897
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
18 months agoUpdate slf4j to 1.7.36 and consume it directly from Maven Central 43/201643/2
Matthias Sohn [Mon, 1 May 2023 21:33:00 +0000 (23:33 +0200)]
Update slf4j to 1.7.36 and consume it directly from Maven Central

BundleSymbolicNames changed to the names used upstream:
- slf4j.api
- slf4j.simple

Change-Id: Ibcaafae282d3a6fa013bc39d879def1b66073bca

18 months agoUpdate assertj-core to 3.24.2 42/201642/1
Matthias Sohn [Mon, 1 May 2023 15:32:28 +0000 (17:32 +0200)]
Update assertj-core to 3.24.2

and consume it directly from Maven Central.

Add the bundle to the jgit p2 repository.

Change-Id: I95f07a6d3ea645c4f56350d4b0facbaa84988440

18 months agoUpdate plexus-compiler to 2.13.0 38/201638/1
Matthias Sohn [Mon, 1 May 2023 15:01:35 +0000 (17:01 +0200)]
Update plexus-compiler to 2.13.0

Change-Id: I2e0665a5b5b41f501ab617220678d3a93fa43718

18 months agoUpdate Apache commons-codec to 1.15 41/201641/1
Matthias Sohn [Mon, 1 May 2023 14:27:28 +0000 (16:27 +0200)]
Update Apache commons-codec to 1.15

and consume it directly from Maven Central.

Its BundleSymbolicName changes to "org.apache.commons.commons-codec"
which is defined upstream.

Change-Id: Id9c366b3be0b97f4b191ba78f02001306f0e5035

18 months agoUpdate org.apache.commons:commons-compress to 1.23.0 40/201640/1
Matthias Sohn [Mon, 1 May 2023 12:58:23 +0000 (14:58 +0200)]
Update org.apache.commons:commons-compress to 1.23.0

and consume it directly from Maven Central.

Its BundleSymbolicName changes to "org.apache.commons.commons-compress"
which is defined upstream.

Change-Id: I691f5f49491dd2c9ba577ebe0c6f7cdd462c047a

18 months agoUpdate javaEWAH to 1.2.3 and use it directly from Maven central 39/201639/1
Matthias Sohn [Mon, 1 May 2023 09:38:36 +0000 (11:38 +0200)]
Update javaEWAH to 1.2.3 and use it directly from Maven central

This changes its BundleSymbolicName from "javaewah" (name in Orbit) to
com.googlecode.javaewah.JavaEWAH (name in upstream artefact from Maven
Central).

Change-Id: I8dee6909d496e3d05b2de938515dde831518be24

18 months agoUpdate org.eclipse.jdt:ecj to 3.33.0 37/201637/1
Matthias Sohn [Mon, 1 May 2023 08:14:18 +0000 (10:14 +0200)]
Update org.eclipse.jdt:ecj to 3.33.0

Change-Id: I0f310762313d6ccafe3ea410bf9d4c03731f0866

18 months agoAdd missing @since tag to IntComparator 36/201636/1
Matthias Sohn [Mon, 1 May 2023 13:00:37 +0000 (15:00 +0200)]
Add missing @since tag to IntComparator

Change-Id: Ic190ab404ccb3af675cdd90cac231ce6e856ea68

18 months agoUpdate to jakarta.servlet:jakarta.servlet-api:4.0.4 17/201617/2
Matthias Sohn [Sun, 30 Apr 2023 21:32:50 +0000 (23:32 +0200)]
Update to jakarta.servlet:jakarta.servlet-api:4.0.4

Change-Id: I892b44e7886f5c30be7b2003ca048e3e22aa75f6

18 months agoSupport rebasing independent branches 08/201608/1
Thomas Wolf [Sun, 23 Apr 2023 19:34:37 +0000 (21:34 +0200)]
Support rebasing independent branches

With completely independent branches, there is no merge base. In this
case, the list of commits must include the root commit of the branch to
be rebased.

Bug: 581832
Change-Id: I0f5bdf179d5b07ff09f1a274d61c7a0b1c0011c6
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoSupport cherry-picking a root commit 07/201607/1
Thomas Wolf [Sun, 23 Apr 2023 19:31:40 +0000 (21:31 +0200)]
Support cherry-picking a root commit

Handle the case of the commit to be picked not having any parents.

Since JGit implements cherry-pick as a 3-way-merge between the commit
to be picked and the target commit, using the parent of the picked
commit as merge base, this is super simple: just don't set a base tree.
The merger will not find any merge base and will supply an empty tree
iterator for the base.

Bug: 581832
Change-Id: I88985f1b1723db5b35ce58bf228bc48d23d6fca3
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoAddCommand: ability to switch off renormalization 49/201449/7
Thomas Wolf [Thu, 20 Apr 2023 19:13:59 +0000 (21:13 +0200)]
AddCommand: ability to switch off renormalization

JGit's AddCommand always renormalizes tracked files. C git does so only
on git add --renormalize. Especially for git add . and the JGit
equivalent git.add().addFilepattern(".").call() this can make a big
difference if there are many files, or large files.

Add a "renormalize" option to AddCommand. To maintain compatibility with
existing uses, this option is "true" by default, and the behavior of
AddCommand is as it has always been in JGit.

If set to "false", use an IndexDiffFilter (in addition to a path filter,
if any). This skips any unchanged files (that are not racily clean) from
content checks. Note that changes in CRLF settings or in filters will be
ignored for such files if renormalize == false.

Add the "--renormalize" option to the Add command in the JGit command
line program. For the command-line program, the default is as in C git:
renormalize is off by default and enabled only if the option is given.
Note that --renormalize implies --update in the command line program, as
in C git. In AddCommand, the two settings are independent.

Additionally, avoid opening input streams unnecessarily in
WorkingTreeIterator.getEntryContentLength() and fix some bogus
indentation.

Add a simple test that adds 1000 files of 10kB in 10 directories twice
and that fails if the second invocation (without any changes) with
renormalize=false is not significantly faster.

Locally, I observe for that second invocation

* git.add().addFilepattern(".").call()                        ~660ms
* git.add().addFilepattern(".").setRenormalize(false).call()   ~16ms

Bug: 494323
Change-Id: I30f9d518563fa55d7058a48c27c425f3b60aeb4c
Signed-off-by: Thomas Wolf <twolf@apache.org>
18 months agoUpdate jetty to 10.0.15 and use it from Maven central directly 47/201447/3
Matthias Sohn [Fri, 21 Apr 2023 22:03:56 +0000 (00:03 +0200)]
Update jetty to 10.0.15 and use it from Maven central directly

and update servlet-api to 4.0.1

Change-Id: Id17aad56fc6f10dd64ce088c4b5a0532f5f0c588

18 months agoUpdate bouncycastle to 1.73 54/201354/3
Matthias Sohn [Sun, 16 Apr 2023 22:46:03 +0000 (00:46 +0200)]
Update bouncycastle to 1.73

Review requests were created for
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7892
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7893
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.73
https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/7894

Change-Id: I389cdd7500d7d9292d7ea5eee142492dd1db7112

18 months ago[errorprone] Fix MissingOverride error 05/201605/1
Matthias Sohn [Fri, 28 Apr 2023 19:46:04 +0000 (21:46 +0200)]
[errorprone] Fix MissingOverride error

see https://errorprone.info/bugpattern/MissingOverride
Change-Id: Iec8833eb52d91a4ef117160407b9151f25617cb5

18 months agoMerge "Merge branch 'stable-6.5'"
Matthias Sohn [Fri, 28 Apr 2023 19:22:52 +0000 (15:22 -0400)]
Merge "Merge branch 'stable-6.5'"

18 months agoMerge "PackReverseIndexWriter: write out version 1 reverse index file"
Ivan Frade [Fri, 28 Apr 2023 18:16:25 +0000 (14:16 -0400)]
Merge "PackReverseIndexWriter: write out version 1 reverse index file"

18 months agoMerge branch 'stable-6.5' 03/201603/1
Matthias Sohn [Fri, 28 Apr 2023 17:51:01 +0000 (19:51 +0200)]
Merge branch 'stable-6.5'

* stable-6.5:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  Parse pull.rebase=preserve as alias for pull.rebase=merges
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I16e8553d187a8ef541f578291f47fc39c3da4ac0

18 months agoMerge "IntList: add #sort using quick sort for O(n log n) runtime."
Ivan Frade [Fri, 28 Apr 2023 17:49:51 +0000 (13:49 -0400)]
Merge "IntList: add #sort using quick sort for O(n log n) runtime."

18 months agoPackReverseIndexWriter: write out version 1 reverse index file 81/197581/28
Anna Papitto [Thu, 27 Apr 2023 18:01:30 +0000 (11:01 -0700)]
PackReverseIndexWriter: write out version 1 reverse index file

The reverse index for a pack is used to quickly find an object's
position in the pack's forward index based on that object's pack offset.
It is currently computed from the forward index by sorting the index
entries by the corresponding pack offset. This computation uses
bucket sort with insertion sort, which has an average runtime of
O(n log n) and worst case runtime of O(n^2); and memory usage of
3*size(int)*n because it maintains 3 int arrays, even after sorting is
completed. The computation must be performed every time that the reverse
index object is created in memory.

In contrast, Cgit persists a pack reverse index file to avoid
recomputing the reverse index ordering every time that it is needed.
Instead they write a file with format
https://git-scm.com/docs/pack-format#_pack_rev_files_have_the_format
which can later be read and parsed into an in-memory reverse index each
time it is needed.

Introduce these reverse index files to JGit. PackReverseIndexWriter
writes out a reverse index file to be read later when needed. Subclass
PackReverseIndexWriterV1 writes a file with the official version 1
format.

To avoid temporarily allocating an Integer collection while sorting and
writing out the contents, using memory 4*size(Integer)*n, use an
IntList and its #sort method, which uses quicksort.

Change-Id: I6437745777a16f723e2f1cfcce4e0d94e599dcee
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoIntList: add #sort using quick sort for O(n log n) runtime. 59/201559/3
Anna Papitto [Thu, 27 Apr 2023 18:01:29 +0000 (11:01 -0700)]
IntList: add #sort using quick sort for O(n log n) runtime.

IntList is a class for working with lists of primitive ints without
boxing them into Integers. For writing the reverse index file format,
sorting ints will be needed but IntList doesn't provide a sorting
method yet.

Add the #sort method to sort an IntList by an IntComparator, using
quicksort, which has a average runtime of O(n log n) and sorts in-place
by using O(log n) stack frames for recursive calls.

Change-Id: Id69a687c8a16d46b13b28783b194a880f3f4c437
Signed-off-by: Anna Papitto <annapapitto@google.com>
18 months agoMerge branch 'stable-6.4' into stable-6.5 30/201530/1
Matthias Sohn [Thu, 27 Apr 2023 00:30:20 +0000 (02:30 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I6d20fea3a417e4361b61e81756253343668eb5de

18 months agoMerge branch 'stable-6.3' into stable-6.4 81/201481/2
Matthias Sohn [Thu, 27 Apr 2023 00:20:10 +0000 (02:20 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I463f8528e623316add204848d551c44d44d04858

18 months agoMerge branch 'stable-6.2' into stable-6.3 80/201480/3
Matthias Sohn [Thu, 27 Apr 2023 00:07:23 +0000 (02:07 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  [bazel] Move ToolTestCase to src folder (6.2)
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I736c7d0ed9c6e9718fa98976c3dc5a25ab8cda85

18 months ago[bazel] Move ToolTestCase to src folder (6.2) 25/201525/2
Matthias Sohn [Mon, 24 Apr 2023 16:50:10 +0000 (18:50 +0200)]
[bazel] Move ToolTestCase to src folder (6.2)

Bazel barks at the abstract ToolTestCase not containing any test. Move
it from the tst/ source folder to the src/ source folder so that bazel
knows this is a helper class which doesn't contain tests.

Change-Id: Ie353c27526644ea9b47437b9bd9cd730a432ab29

18 months agoMerge branch 'stable-6.1' into stable-6.2 79/201479/3
Matthias Sohn [Wed, 26 Apr 2023 23:48:07 +0000 (01:48 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest
  Fix after_open config and Snapshotting RefDir tests to work with bazel
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I9863cbce95d845efc891724898954b0b2f8dbf7b

18 months agoMerge branch 'stable-6.0' into stable-6.1 29/201529/1
Matthias Sohn [Wed, 26 Apr 2023 23:37:29 +0000 (01:37 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest

Change-Id: I9c622de39200c6ee248d600736dc5db477f6bf9f

18 months agoMerge branch 'stable-5.13' into stable-6.0 28/201528/1
Matthias Sohn [Wed, 26 Apr 2023 23:07:47 +0000 (01:07 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  GcConcurrentTest: @Ignore flaky testInterruptGc
  Fix CommitTemplateConfigTest

Adapt GcConcurrentTest to changed FileRepositoryBuilder API.

Change-Id: I8906662a6391ceed20ab29cfbe238daf13e1be63

18 months agoGcConcurrentTest: @Ignore flaky testInterruptGc 27/201527/1
Jonathan Tan [Wed, 5 Apr 2023 20:44:59 +0000 (13:44 -0700)]
GcConcurrentTest: @Ignore flaky testInterruptGc

During my development of Id7721cc5b7ea650e77c2db47042715487983cae6, I
have found this test to be flaky when run by CI. As a speculative fix,
mark this test as @Ignore so it won't be run.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Change-Id: Idfe04d7f1fb72a772d4c8d249ca86a9c2eec0b1a

18 months agoFix CommitTemplateConfigTest 26/201526/1
Matthias Sohn [Wed, 26 Apr 2023 23:00:44 +0000 (01:00 +0200)]
Fix CommitTemplateConfigTest

The cherry-picked 61d4e313 doesn't match 5.13 APIs which changed in
newer versions.

Change-Id: I61ed0242472ed822028d86d3038f956f6bd5735c

18 months agoFix after_open config and Snapshotting RefDir tests to work with bazel 63/201463/3
Prudhvi Akhil Alahari [Mon, 24 Apr 2023 09:15:17 +0000 (14:45 +0530)]
Fix after_open config and Snapshotting RefDir tests to work with bazel

The changes I1db6fcf414b and I634b92877f added tests which were failing
with errors [1] and [2] with "bazel test //...". This was not caught
because we don't have CI running with bazel. Fix bazel build file so
that these errors are no longer thrown when run with bazel.

[1] error: cannot find symbol FileRepositoryBuilderTest
[2] error: cannot find symbol RefDirectoryTest

Bug: 581816
Signed-off-by: Prudhvi Akhil Alahari <quic_prudhvi@quicinc.com>
Change-Id: I1e57111662825f5f14f373bc4f8d24cce1fec0b8

18 months agoMerge branch 'stable-6.0' into stable-6.1 78/201478/2
Matthias Sohn [Wed, 26 Apr 2023 19:55:16 +0000 (21:55 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I5e13d5b5414aef97e518898166bfa166c692e60f

18 months agoMerge branch 'stable-5.13' into stable-6.0 21/201521/1
Matthias Sohn [Wed, 26 Apr 2023 19:40:22 +0000 (21:40 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings

Change-Id: I63b9adc22e1e1d9a9c754fe070ddfe21a52446c7

18 months ago[bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory 20/201520/1
Matthias Sohn [Wed, 12 Jan 2022 22:45:34 +0000 (23:45 +0100)]
[bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory

Move this test to another class and skip it when running tests with
bazel since the bazel test runner does not allow to create files in the
home directory.

FS#userHome retrieves the home directory on the first call and caches it
for subsequent calls to avoid overhead in case path translation is
required (currently on cygwin). This prevents that the test can mock the
home directory using MockSystemReader like SshTestHarness does.

Change-Id: I6a22f37f4a19eb4b4935509eae508a23e56db7aa

18 months agoDemote severity of some error prone bug patterns to warnings 19/201519/1
David Ostrovsky [Wed, 26 Apr 2023 08:08:25 +0000 (10:08 +0200)]
Demote severity of some error prone bug patterns to warnings

The code is not violation free, so demote the severity of these bug
patterns to warning:

o DefaultCharset
o FutureReturnValueIgnored
o UnusedException

Change-Id: Ie886a4a247770a74953385f018498ac2515ed209

18 months ago[bazel] Fix version number of bcpg-jdk18on 64/201464/1
Matthias Sohn [Mon, 24 Apr 2023 11:28:32 +0000 (13:28 +0200)]
[bazel] Fix version number of bcpg-jdk18on

Add the missing quotes around the version number.

Change-Id: Ia24484f50a4e771e046aa65621ae4779fff64d86

19 months agoParse pull.rebase=preserve as alias for pull.rebase=merges 31/201431/3
Matthias Sohn [Fri, 21 Apr 2023 06:51:08 +0000 (08:51 +0200)]
Parse pull.rebase=preserve as alias for pull.rebase=merges

This ensures backwards compatibility to the old config value which was
removed in git 2.34 which JGit followed in Ic07ff954e2.

Change-Id: I2b4e27fd71898b6e0e227e406c40682bd9786cd4

19 months agoUse bouncycastle libraries directly from Maven Central 48/201348/4
Matthias Sohn [Fri, 14 Apr 2023 16:12:42 +0000 (18:12 +0200)]
Use bouncycastle libraries directly from Maven Central

and update
- org.bouncycastle:bcpg-jdk18on to 1.72.2

Bug: 581767
Change-Id: Id213e84d56c171c98b1919a7044e2779a3d777df

19 months agoUploadPack: Fix NPE when traversing a tag chain 08/201108/6
Kaushik Lingarkar [Wed, 5 Apr 2023 01:05:53 +0000 (18:05 -0700)]
UploadPack: Fix NPE when traversing a tag chain

Always parse RevTags including their body before getting their object
to ensure that non-cached objects are handled correctly when traversing
a tag chain. An NPE in UploadPack#addTagChain will occur on a depth=1
fetch of a branch containing a tag chain and the ref to one of the
middle tags in the chain is deleted.

Change-Id: Ifd8fe868869070b365df926fec5dcd8e64d4f521
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
19 months agoAdd missing @since tag for BatchRefUpdate#getRefDatabase 30/201430/1
Matthias Sohn [Thu, 20 Apr 2023 22:59:07 +0000 (00:59 +0200)]
Add missing @since tag for BatchRefUpdate#getRefDatabase

Change-Id: I5d37cbbd6c338e6e6bb8b95ae13a5ed9b5178a8b

19 months agoMerge branch 'stable-6.5' 29/201429/1
Matthias Sohn [Thu, 20 Apr 2023 22:52:18 +0000 (00:52 +0200)]
Merge branch 'stable-6.5'

* stable-6.5:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: I0b03ca566053a158c6c8e75ccec8360a2f368ed9

19 months agoMerge branch 'stable-6.4' into stable-6.5 28/201428/1
Matthias Sohn [Thu, 20 Apr 2023 22:40:02 +0000 (00:40 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on
PackMismatchException
  Remove blank in maven.config

Change-Id: I89af76946014fb44bd64c20e2b01a53397768d90

19 months agoMerge branch 'stable-6.3' into stable-6.4 27/201427/1
Matthias Sohn [Thu, 20 Apr 2023 22:33:26 +0000 (00:33 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: I18b46be0f09535c61efabe24ab1579faa3d06ba8

19 months agoMerge branch 'stable-6.2' into stable-6.3 26/201426/1
Matthias Sohn [Thu, 20 Apr 2023 22:25:51 +0000 (00:25 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: I8006068f16ae442a2246e043a680053f2af34e9f

19 months agoMerge branch 'stable-6.1' into stable-6.2 25/201425/1
Matthias Sohn [Thu, 20 Apr 2023 22:19:38 +0000 (00:19 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: I4c5b000b09287cc32f0e4d6a24a766ef4e17ddbe

19 months agoMerge branch 'stable-6.0' into stable-6.1 24/201424/1
Matthias Sohn [Thu, 20 Apr 2023 22:11:40 +0000 (00:11 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: Ia01c5ac5259b8820afb823d97bee247b5a5fb14a

19 months agoMerge branch 'stable-5.13' into stable-6.0 23/201423/1
Matthias Sohn [Thu, 20 Apr 2023 14:01:33 +0000 (16:01 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on
PackMismatchException
  Remove blank in maven.config

Change-Id: Id37bee59ca3c7947604c54b6d4e7c02628a657fe

19 months agoMerge branch 'stable-5.12' into stable-5.13 16/201416/1
Matthias Sohn [Thu, 20 Apr 2023 13:40:36 +0000 (15:40 +0200)]
Merge branch 'stable-5.12' into stable-5.13

* stable-5.12:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on
PackMismatchException
  Remove blank in maven.config

Change-Id: Ibe6652374ab5971105e62b05279f218c8c130fee

19 months agoMerge branch 'stable-5.11' into stable-5.12 15/201415/1 stable-5.12
Matthias Sohn [Thu, 20 Apr 2023 13:12:01 +0000 (15:12 +0200)]
Merge branch 'stable-5.11' into stable-5.12

* stable-5.11:
  Add missing since tag for SshBasicTestBase
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on PackMismatchException
  Remove blank in maven.config

Change-Id: I25bb99687b969f9915a7cbda8d1332bec778096a

19 months agoAdd missing since tag for SshBasicTestBase 14/201414/2 stable-5.11
Matthias Sohn [Thu, 20 Apr 2023 12:46:05 +0000 (14:46 +0200)]
Add missing since tag for SshBasicTestBase

Change-Id: Iad8ae9bb526418b279dc54a5e9d0c877c1eca475

19 months agoMerge branch 'stable-5.10' into stable-5.11 13/201413/2
Matthias Sohn [Thu, 20 Apr 2023 12:42:56 +0000 (14:42 +0200)]
Merge branch 'stable-5.10' into stable-5.11

* stable-5.10:
  Add missing since tag for SshTestHarness#publicKey2
  Silence API errors
  Prevent infinite loop rescanning the pack list on
PackMismatchException
  Remove blank in maven.config

Migrated "Prevent infinite loop rescanning the pack list on
PackMismatchException" to refactoring done in
https://git.eclipse.org/r/q/topic:restore-preserved-packs

Change-Id: I0fb77bb9b498d48d5da88a93486b99bf8121e3bd

19 months agoAdd missing since tag for SshTestHarness#publicKey2 12/201412/1 stable-5.10
Matthias Sohn [Thu, 20 Apr 2023 12:35:58 +0000 (14:35 +0200)]
Add missing since tag for SshTestHarness#publicKey2

Change-Id: Ib6e4945340d2e1761dc0e787bdbe72286cdc95bc

19 months agoSilence API errors 11/201411/1
Matthias Sohn [Thu, 20 Apr 2023 12:37:46 +0000 (14:37 +0200)]
Silence API errors

Change-Id: I367c05c43df3385c33ce76bc10b2dc3bd330665c

19 months agoMerge branch 'stable-5.9' into stable-5.10 10/201410/2
Matthias Sohn [Thu, 20 Apr 2023 07:52:30 +0000 (09:52 +0200)]
Merge branch 'stable-5.9' into stable-5.10

* stable-5.9:
  Prevent infinite loop rescanning the pack list on
PackMismatchException
  Remove blank in maven.config

Change-Id: I15ff2d7716ecaceb0eb87b8823d85670f5db709d

19 months agoPrevent infinite loop rescanning the pack list on PackMismatchException 78/200978/6 stable-5.9
Matthias Sohn [Thu, 30 Mar 2023 11:43:17 +0000 (13:43 +0200)]
Prevent infinite loop rescanning the pack list on PackMismatchException

We found, when analysing an incident where Gerrit's gc runner thread got
stuck, that we can end up in an infinite loop in
ObjectDirectory#openPackedObject which tries to rescan the pack
list and starts over trying to open a packed object in an unconfined
loop if it catches a PackMismatchException.

Here the relevant part of a thread dump we created while the gc runner
was stuck:

"WorkQueue-2[java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@350812a3[Not
completed,
task = java.util.concurrent.Executors$RunnableAdapter@5425d7ee]]" #72
tid=0x00007f73cee1c800 nid=0x584
runnable  [0x00007f7392d57000]
   java.lang.Thread.State: RUNNABLE
at org.eclipse.jgit.internal.storage.file.WindowCache.removeAll(WindowCache.java:716)
at org.eclipse.jgit.internal.storage.file.WindowCache.purge(WindowCache.java:399)
at org.eclipse.jgit.internal.storage.file.PackFile.close(PackFile.java:296)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.reuseMap(ObjectDirectory.java:973)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.scanPacksImpl(ObjectDirectory.java:904)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.scanPacks(ObjectDirectory.java:895)
- locked <0x000000050a498f60> (a
java.util.concurrent.atomic.AtomicReference)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.searchPacksAgain(ObjectDirectory.java:794)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedObject(ObjectDirectory.java:465)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedFromSelfOrAlternate(ObjectDirectory.java:417)
at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:408)
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:132)
at org.eclipse.jgit.lib.ObjectReader$1.open(ObjectReader.java:279)
at org.eclipse.jgit.revwalk.RevWalk$2.next(RevWalk.java:1031)
at org.eclipse.jgit.internal.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1911)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:960)
at org.eclipse.jgit.internal.storage.pack.PackWriter.preparePack(PackWriter.java:876)
at org.eclipse.jgit.internal.storage.file.GC.writePack(GC.java:1168)
at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:852)
at org.eclipse.jgit.internal.storage.file.GC.doGc(GC.java:269)
at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:220)
at org.eclipse.jgit.api.GarbageCollectCommand.call(GarbageCollectCommand.java:179)
at com.google.gerrit.server.git.GarbageCollection.run(GarbageCollection.java:112)
at com.google.gerrit.server.git.GarbageCollection.run(GarbageCollection.java:75)
at com.google.gerrit.server.git.GarbageCollection.run(GarbageCollection.java:71)
at com.google.gerrit.server.git.GarbageCollectionRunner.run(GarbageCollectionRunner.java:76)
at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:103)
at java.util.concurrent.Executors$RunnableAdapter.call(java.base@11.0.18/Executors.java:515)
at java.util.concurrent.FutureTask.runAndReset(java.base@11.0.18/FutureTask.java:305)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(java.base@11.0.18/ScheduledThreadPoolExecutor.java:305)
at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:612)
at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@11.0.18/ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@11.0.18/ThreadPoolExecutor.java:628)
at java.lang.Thread.run(java.base@11.0.18/Thread.java:829)

The code in ObjectDirectory#openPackedObject [1] apparently assumes that
this is caused by a transient problem which it can resume from by
retrying. We use `core.trustFolderStat = false` on this server since it
uses NFS. The incident we had showed that we can enter into an infinite
loop here if there is a permanent mismatch between a pack file and its
corresponding pack index. I am not yet sure how this can happen.

Break the infinite loop by limiting the number of attempts rescanning
the pack list to 5 retries.  When we exceed this threshold set the type
of the PackMismatchException to permanent and rethrow it which breaks
the infinite loop.

Also apply the same limit in #getPackedObjectSize
and #selectObjectRepresentation where we use similar retry loops.

[1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/011c26ff36b9e76c84fc2459e337f159c0f55a9a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java#465

Change-Id: I20fb63bcc1fdc3a03d39b963f06a90e6f0ba73dc

19 months agoRemove blank in maven.config 03/201403/1
Matthias Sohn [Fri, 14 Apr 2023 16:13:18 +0000 (18:13 +0200)]
Remove blank in maven.config

Maven 3.9.1 doesn't accept this whitespace.

Change-Id: I0f6e3652b1e581615c370d35bc782184712ac922

19 months agoPackedBatchRefUpdate#execute: reduce nesting of try-catch blocks 81/201381/1
Matthias Sohn [Tue, 18 Apr 2023 09:00:54 +0000 (11:00 +0200)]
PackedBatchRefUpdate#execute: reduce nesting of try-catch blocks

Change-Id: I7ddf20fcbf4971ee908b20d8df9d6328ce9f9f1b

19 months agoPackedBatchRefUpdate: Handle the case where loose refs fail to pack 17/201317/2
Kaushik Lingarkar [Thu, 13 Apr 2023 21:41:37 +0000 (14:41 -0700)]
PackedBatchRefUpdate: Handle the case where loose refs fail to pack

If packing loose refs fails due to a lock failure, reject update with
a LOCK_FAILURE.

Change-Id: I100e81efd528d963231a1b87bacd9d68f9245a1b
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
19 months agoMerge branch 'stable-6.5' 47/201347/2
Matthias Sohn [Sat, 15 Apr 2023 20:50:11 +0000 (22:50 +0200)]
Merge branch 'stable-6.5'

* stable-6.5:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: I5bfff523b3174c7b741ab0eaf53937c3ab501252

19 months agoMerge branch 'stable-6.4' into stable-6.5 46/201346/1
Matthias Sohn [Sat, 15 Apr 2023 19:39:03 +0000 (21:39 +0200)]
Merge branch 'stable-6.4' into stable-6.5

* stable-6.4:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: I7f822e8a751516a32afccd180cbf6afb389f3a28

19 months agoMerge branch 'stable-6.3' into stable-6.4 45/201345/1
Matthias Sohn [Sat, 15 Apr 2023 19:38:27 +0000 (21:38 +0200)]
Merge branch 'stable-6.3' into stable-6.4

* stable-6.3:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: I18cf0da3a5dcc74865c44d82e7c328329814acae

19 months agoMerge branch 'stable-6.2' into stable-6.3 44/201344/1
Matthias Sohn [Sat, 15 Apr 2023 19:35:16 +0000 (21:35 +0200)]
Merge branch 'stable-6.2' into stable-6.3

* stable-6.2:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: If0bb5f1a317ab981e6bbf5671851f124b18ab8ca

19 months agoMerge branch 'stable-6.1' into stable-6.2 43/201343/1
Matthias Sohn [Sat, 15 Apr 2023 19:34:41 +0000 (21:34 +0200)]
Merge branch 'stable-6.1' into stable-6.2

* stable-6.1:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: Ief50a2ca8e5a8630627506f4d2142d62c0554615

19 months agoMerge branch 'stable-6.0' into stable-6.1 42/201342/1
Matthias Sohn [Fri, 14 Apr 2023 22:49:59 +0000 (00:49 +0200)]
Merge branch 'stable-6.0' into stable-6.1

* stable-6.0:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: Idf757bcab0d7a65ea63504674a681170c6db2f94

19 months agoMerge branch 'stable-5.13' into stable-6.0 36/201336/1
Matthias Sohn [Fri, 14 Apr 2023 22:49:08 +0000 (00:49 +0200)]
Merge branch 'stable-5.13' into stable-6.0

* stable-5.13:
  Remove blank in maven.config
  DirCache: support option index.skipHash

Change-Id: I0cc3033b1876c8c691c2a6876206cd71fa07d2e0

19 months agoRemove blank in maven.config 35/201335/1
Matthias Sohn [Fri, 14 Apr 2023 16:13:18 +0000 (18:13 +0200)]
Remove blank in maven.config

Maven 3.9.1 doesn't accept this whitespace.

Change-Id: I0f6e3652b1e581615c370d35bc782184712ac922

19 months agoAdd protocol configuration to Amazon S3 transport 17/201117/3
Pat Patterson [Thu, 6 Apr 2023 15:05:56 +0000 (08:05 -0700)]
Add protocol configuration to Amazon S3 transport

Before this change, attempting to use the jgit Amazon S3 transport with an S3-compatible service that requires https (for example, Backblaze B2) results in an error:

$ jgit push b2
fatal: amazon-s3://metadaddy-jgit/repos/test/objects: error in packed-refs

This change adds a "protocol" property to the Amazon S3 transport configuration, defaulting to http, and uses that value when constructing the URL for the S3 service.

Example configuration for Backblaze B2:

accesskey: <Your B2 Application Key>
secretkey: <Your B2 Application Key Id>
acl: private
protocol: https
domain: s3.us-west-004.backblazeb2.com
region: us-west-004
aws.api.signature.version: 4

Behavior after this change:

$ jgit push b2
Counting objects:       3
Finding sources:        100% (3/3)
Getting sizes:          100% (2/2)
Compressing objects:    100% (37/37)
Writing objects:        100% (3/3)
Put pack-673f9bb.idx:   100% (1/1)
To amazon-s3://.jgit_b2@metadaddy-jgit/repos/test
 * [new branch]      main -> main

Change-Id: I03bdbb3510fb81a416c225a720178f42eec41b21

19 months ago[pgm] Implement git tag --contains option 78/201178/4
Matthias Sohn [Sun, 9 Apr 2023 20:49:58 +0000 (22:49 +0200)]
[pgm] Implement git tag --contains option

Change-Id: I390bcd2c2c563d4b27e1369f09548be59ba7c111

19 months agoListTagCommand: implement git tag --contains 77/201177/4
Matthias Sohn [Sun, 9 Apr 2023 18:51:15 +0000 (20:51 +0200)]
ListTagCommand: implement git tag --contains

Change-Id: I07e57ba098eace9656393837fad4cb3590f31b22

19 months agoRevWalk: use generation number to optimize getMergedInto() 41/187541/40
kylezhao [Tue, 9 Nov 2021 12:03:27 +0000 (20:03 +0800)]
RevWalk: use generation number to optimize getMergedInto()

A commit A can reach a commit B only if the generation number of A is
strictly larger than the generation number of B. This condition allows
significantly short-circuiting commit-graph walks.

On a copy of the Linux repository where HEAD is contained in v6.3-rc4
but no earlier tag, the command 'git tag --contains HEAD' of
ListTagCommand#call() had the following peformance improvement:
(excluded the startup time of the repo)

Before: 2649ms    (core.commitgraph=true)
        11909ms   (core.commitgraph=false)
After:  91ms     (core.commitgraph=true)
        11934ms   (core.commitgraph=false)

Bug: 574368
Change-Id: Ia2efaa4e9ae598266f72e70eb7e3b27655cbf85b
Signed-off-by: kylezhao <kylezhao@tencent.com>
19 months agoDfsPackFile: Extract block aligment code 74/201174/2
Ivan Frade [Tue, 11 Apr 2023 19:50:52 +0000 (12:50 -0700)]
DfsPackFile: Extract block aligment code

Loading of pack, bitmap and commit-graph copy the same code to adjust
the input stream buffering.

Extract to a common function. Besides reusing the code, the name hints
what it is doing.

This block aligment seems unnecessary as the reading is from storage
not dfs cache. The channel probably knows better. Left a TODO because
I don't know the original intention.

Change-Id: I18b77ae8189830fcd4d5932b6b5823b693ed6090