]> source.dussan.org Git - jgit.git/log
jgit.git
3 years agoTag message must not include the signature 05/174405/3
Thomas Wolf [Thu, 7 Jan 2021 16:10:45 +0000 (17:10 +0100)]
Tag message must not include the signature

Signatures on tags are just tacked onto the end of the message.
Getting the message must not return the signature. Compare [1]
and [2] in C git, which both drop a signature at the end of an
object body.

[1] https://github.com/git/git/blob/21bf933/builtin/tag.c#L173
[2] https://github.com/git/git/blob/21bf933/ref-filter.c#L1276

Change-Id: Ic8a1062b8bc77f2d7c138c3fe8a7fd13b1253f38
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoUpdate jetty to 9.4.35.v20201120 12/174212/2
Matthias Sohn [Mon, 4 Jan 2021 01:02:27 +0000 (02:02 +0100)]
Update jetty to 9.4.35.v20201120

Change-Id: I203778ea0536defffb720bcf7cdcbc6258540e65
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoProtocol V2: don't log spurious ACKs in UploadPack 18/174318/1
Thomas Wolf [Wed, 6 Jan 2021 11:13:48 +0000 (12:13 +0100)]
Protocol V2: don't log spurious ACKs in UploadPack

UploadPack may log ACKs in protocol V2 that it doesn't send (if it
got a "done" from the client), or may log ACKs twice. That makes
packet log analysis difficult.

Add a new constructor to PacketLineOut to omit all logging from an
instance, and use it in UploadPack.

Change-Id: Ic29ef5f9a05cbcf5f4858a4e1b206ef0e6421c65
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge "Protocol V2: respect MAX_HAVES only once we got at least one ACK"
Thomas Wolf [Tue, 5 Jan 2021 22:59:27 +0000 (17:59 -0500)]
Merge "Protocol V2: respect MAX_HAVES only once we got at least one ACK"

3 years agoMerge "FileSnapshot: don't try to read file attributes twice"
Christian Halstrick [Tue, 5 Jan 2021 07:11:48 +0000 (02:11 -0500)]
Merge "FileSnapshot: don't try to read file attributes twice"

3 years agoProtocol V2: respect MAX_HAVES only once we got at least one ACK 95/174195/3
Thomas Wolf [Sun, 3 Jan 2021 22:07:18 +0000 (23:07 +0100)]
Protocol V2: respect MAX_HAVES only once we got at least one ACK

The negotiation in the git protocol contains a cutoff: if the client
has sent more than MAX_HAVES "have" lines without getting an ACK, it
gives up and sends a "done". MAX_HAVES is 256.

However, this cutoff must kick in only if at least one ACK has been
received. Otherwise the client may give up way too early, which makes
the server send all its history. See [1].

This was missed when protocol V2 was implemented for fetching in JGit
in commit 0853a241.

Compare also C git commit 0b07eecf6ed.[2] C git had the same bug.[3][4]

[1] https://github.com/git/git/blob/6c430a647cb9/Documentation/technical/pack-protocol.txt#L385
[2] https://github.com/git/git/commit/0b07eecf6ed
[3] https://lore.kernel.org/git/b7f5bfb9-61fb-2552-4399-b744428728e4@suse.cz/
[4] https://lore.kernel.org/git/20200422084254.GA27502@furthur.local/

Bug: 553083
Change-Id: I1f4e2cc16b5eed6971d981d472329185abb9e4a9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoRepositoryCache: declare schedulerLock final 25/174125/2
Matthias Sohn [Mon, 28 Dec 2020 01:21:17 +0000 (02:21 +0100)]
RepositoryCache: declare schedulerLock final

This fixes errorprone error [SynchronizeOnNonFinalField]: Synchronizing
on non-final fields is not safe: if the field is ever updated, different
threads may end up locking on different objects.

Change-Id: I42fe5bde825151693e2da2d5b6cd6e1d34038dbc

3 years agoEnable git wire protocol version 2 on server side per default 16/163216/6
David Ostrovsky [Tue, 19 May 2020 05:17:24 +0000 (07:17 +0200)]
Enable git wire protocol version 2 on server side per default

Bug: 563145
Change-Id: Id5030c2b85466da0a8ccf3d78ae78df16d64ffc5
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
3 years agoFileSnapshot: don't try to read file attributes twice 88/174188/1
Matthias Sohn [Sun, 3 Jan 2021 14:33:36 +0000 (15:33 +0100)]
FileSnapshot: don't try to read file attributes twice

If file doesn't exist set state to MISSING_FILE immediately. Doing that
by calling File#lastModified and File#length effectively does the same
since they set the value to 0 if the file doesn't exist.

Log an error if a different exception than NoSuchFileException is
caught.

Change-Id: I0d4396b9f80446692a088d17522d64f735ce6708

3 years agoClient-side protocol V2 support for fetching 95/172595/9
Thomas Wolf [Sun, 2 Aug 2020 17:22:05 +0000 (19:22 +0200)]
Client-side protocol V2 support for fetching

Make all transports request protocol V2 when fetching. Depending on
the transport, set the GIT_PROTOCOL environment variable (file and
ssh), pass the Git-Protocol header (http), or set the hidden
"\0version=2\0" (git anon). We'll fall back to V0 if the server
doesn't reply with a version 2 answer.

A user can control which protocol the client requests via the git
config protocol.version; if not set, JGit requests protocol V2 for
fetching. Pushing always uses protocol V0 still.

In the API, there is only a new Transport.openFetch() version that
takes a collection of RefSpecs plus additional patterns to construct
the Ref prefixes for the "ls-refs" command in protocol V2. If none
are given, the server will still advertise all refs, even in protocol
V2.

BasePackConnection.readAdvertisedRefs() handles falling back to
protocol V0. It newly returns true if V0 was used and the advertised
refs were read, and false if V2 is used and an explicit "ls-refs" is
needed. (This can't be done transparently inside readAdvertisedRefs()
because a "stateless RPC" transport like TransportHttp may need to
open a new connection for writing.)

BasePackFetchConnection implements the changes needed for the protocol
V2 "fetch" command (stateless protocol, simplified ACK handling,
delimiters, section headers).

In TransportHttp, change readSmartHeaders() to also recognize the
"version 2" packet line as a valid smart server indication.

Adapt tests, and run all the HTTP tests not only with both HTTP
connection factories (JDK and Apache HttpClient) but also with both
protocol V0 and V2. The SSH tests are much slower and much more
focused on the SSH protocol and SSH key handling. Factor out two
very simple cloning and pulling tests and make those run with
protocol V2.

Bug: 553083
Change-Id: I357c7f5daa7efb2872f1c64ee6f6d54229031ae1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoUse Map interface instead of ConcurrentHashMap class 51/174151/2
Thomas Wolf [Wed, 30 Dec 2020 16:17:44 +0000 (17:17 +0100)]
Use Map interface instead of ConcurrentHashMap class

On Android, the co-variant override of ConcurrentHashMap.keySet()
introduced in Java 8 was undone. [1] If compiled Java code calls that
co-variant override directly, one gets a NoSuchMethodError exception
at run-time on Android.

Making the code call that method via Map.keySet() side-steps this
problem.

This is similar to bug 496262, where the same problem cropped up when
compiling with Java 8 against a Java 7 target, but here we cannot use
bootclasspath. We build against Java 8, not against the Android version
of it.

Recent Android versions should have some bytecode "magic" that adds the
co-variant override in bytecode (see the commit referenced in [1]), but
on older Android version this problem may still occur. (Or perhaps the
"magic" is ineffective...) There are two pull requests on Github for
this problem, both from 2020, [2][3] while the Android commit [1] is
from March 2018. Apparently people still occasionally run into this
problem in the wild.

[1] https://android.googlesource.com/platform/libcore/+/0e8b937ded4de39f1d1cea5f04800d67dd2ec570/ojluni/src/main/java/java/util/concurrent/ConcurrentHashMap.java#1244
[2] https://github.com/eclipse/jgit/pull/104
[3] https://github.com/eclipse/jgit/pull/100

Change-Id: I7c07e0cc59871cb7fe60795e22867827fa9c2458
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoFix NPE in DirCacheCheckout 43/174143/3
Thomas Wolf [Wed, 30 Dec 2020 09:12:34 +0000 (10:12 +0100)]
Fix NPE in DirCacheCheckout

If a file exists in head, merge, and the working tree, but not in
the index, and we're doing a force checkout, the checkout must be
an "update", not a "keep".

This is a follow-up on If3a9b9e60064459d187c7db04eb4471a72c6cece.

Bug: 569962
Change-Id: I59a7ac41898ddc1dd90e86b09b621a41fdf45667
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge "Added check for null on DirCacheEntry in checkoutEntry method"
Christian Halstrick [Wed, 30 Dec 2020 08:05:00 +0000 (03:05 -0500)]
Merge "Added check for null on DirCacheEntry in checkoutEntry method"

3 years agoGPG user ID matching: use case-insensitive matching 35/174135/1
Thomas Wolf [Tue, 29 Dec 2020 09:15:20 +0000 (10:15 +0100)]
GPG user ID matching: use case-insensitive matching

Although not mentioned in the GPG documentation at [1], GPG uses
case-insensitive matching also for the '<' (exact e-mail) and '@'
(partial e-mail) operators. Matching for '=' (full exact match) is
case-sensitive. Compare [2].

[1] https://www.gnupg.org/documentation/manuals/gnupg/Specify-a-User-ID.html
[2] https://dev.gnupg.org/source/gnupg/browse/master/g10/keyring.c;22f7dddc34446a8c3e9eddf6cb281f16802351d7$890

Bug: 547789
Change-Id: I2f5ab65807d5dde3aa00ff032894701bbd8418c9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoDon't export package from test bundle 33/174133/1
Thomas Wolf [Mon, 28 Dec 2020 21:53:50 +0000 (22:53 +0100)]
Don't export package from test bundle

Do not export the test-only package org.eclipse.jgit.transport from
bundle org.eclipse.jgit.ssh.jsch.test. Doing so can confuse the build
in Eclipse: other bundles that import this package may then also pick
up this test package, leading to non-test sources depending on test
sources and to build cycles.

Change-Id: I9f73b7a8d13bc4a2fe58bd2f1d33068164a13991
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoUpdate eclipse-jarsigner-plugin to 1.1.7 09/174109/1
Matthias Sohn [Thu, 24 Dec 2020 15:09:40 +0000 (16:09 +0100)]
Update eclipse-jarsigner-plugin to 1.1.7

Change-Id: I6ac33e662aac68a01455113d8abbe0bcdd725ca2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate build-helper-maven-plugin to 3.2.0 08/174108/1
Matthias Sohn [Thu, 24 Dec 2020 15:08:20 +0000 (16:08 +0100)]
Update build-helper-maven-plugin to 3.2.0

Change-Id: I41e5645fe6eb9f477ec9e0653a75279d927a64f8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate maven-enforcer-plugin to 3.0.0-M3 07/174107/1
Matthias Sohn [Thu, 24 Dec 2020 14:35:18 +0000 (15:35 +0100)]
Update maven-enforcer-plugin to 3.0.0-M3

Change-Id: I5121415523b01994338c4097a8437a677d08b954
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate maven-shade-plugin to 3.2.4 06/174106/1
Matthias Sohn [Thu, 24 Dec 2020 14:27:02 +0000 (15:27 +0100)]
Update maven-shade-plugin to 3.2.4

Change-Id: Id3eb7c8ab5ce37b6079bbf9a4cb1974ba70ace8a

3 years agoRequire latest Maven version 3.6.3 05/174105/1
Matthias Sohn [Thu, 24 Dec 2020 14:40:12 +0000 (15:40 +0100)]
Require latest Maven version 3.6.3

Change-Id: Iab08ddcdb7edc3c9ac55343d3d40012e19792ea0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate spring-boot-maven-plugin to 2.4.1 04/174104/1
Matthias Sohn [Thu, 24 Dec 2020 14:10:01 +0000 (15:10 +0100)]
Update spring-boot-maven-plugin to 2.4.1

Change-Id: I68a6c04a5c7e674410736a45ef0031a2c369a321
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate maven-surefire plugins to 3.0.0-M5 03/174103/1
Matthias Sohn [Thu, 24 Dec 2020 14:05:42 +0000 (15:05 +0100)]
Update maven-surefire plugins to 3.0.0-M5

Change-Id: I0425029eac630f4e8fb47d112d086e74283b2ebd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate japicmp-maven-plugin to 0.14.4 02/174102/1
Matthias Sohn [Thu, 24 Dec 2020 14:02:25 +0000 (15:02 +0100)]
Update japicmp-maven-plugin to 0.14.4

Change-Id: I33ba5388153e6941713b9c9425cd917e9769a177
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate spotbugs-maven-plugin to 4.1.4 01/174101/1
Matthias Sohn [Thu, 24 Dec 2020 14:00:06 +0000 (15:00 +0100)]
Update spotbugs-maven-plugin to 4.1.4

Change-Id: Ie231dc03051f3c8d799f037eeeed8dcaad258fe0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpgrade ecj to 3.24.0 31/173931/2
Marco Miller [Thu, 17 Dec 2020 17:17:24 +0000 (12:17 -0500)]
Upgrade ecj to 3.24.0

Change-Id: I81c03c5f916e97f91cf06dbe3ce355e430b2981a
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
3 years agoUpgrade wagon-ssh to 3.4.2; align maven-site-plugin 15/173315/3
Marco Miller [Thu, 3 Dec 2020 14:12:01 +0000 (09:12 -0500)]
Upgrade wagon-ssh to 3.4.2; align maven-site-plugin

Upgrade wagon-ssh to 3.4.2 in all pom files, thus align
maven-site-plugin versions to 3.9.1 across as well, consistently.

Change-Id: I38f7a6ded3517d1b116169dee1c12deb86eed3a1
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
3 years ago[spotbugs] Fix incorrect lazy initialization in SystemReader 29/173429/6
Matthias Sohn [Sat, 5 Dec 2020 00:34:33 +0000 (01:34 +0100)]
[spotbugs] Fix incorrect lazy initialization in SystemReader

This fixes two warnings of type LI_LAZY_INIT_STATIC.

Change-Id: I26a7a48aed9d0a0547e908a56b7014a7620fadd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Don't use class from java.util.concurrent for locking 27/173427/6
Matthias Sohn [Fri, 4 Dec 2020 23:39:09 +0000 (00:39 +0100)]
[spotbugs] Don't use class from java.util.concurrent for locking

Use a dedicated Lock object to lock the scheduler in
RepositoryCache#configureEviction to fix spotbugs warning
JLM_JSR166_UTILCONCURRENT_MONITORENTER.

Change-Id: I003dcf0ed1a0a3f4eea5d8a2f51a07473d28a928
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in OpenSshServerKeyDatabase 26/173426/6
Matthias Sohn [Fri, 4 Dec 2020 23:23:15 +0000 (00:23 +0100)]
[spotbugs] Fix potential NPE in OpenSshServerKeyDatabase

If oldLine is null #updateModifiedServerKey shouldn't be called since it
would derefence it. Spotbugs raised this as problem
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE. Fix it by checking if
oldLine is null before calling #updateModifiedServerKey.

Change-Id: I8a2000492986e52ce7dbe25f48b321c05fd371e4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in FS.FileStoreAttributes#get 25/173425/6
Matthias Sohn [Fri, 4 Dec 2020 22:41:19 +0000 (23:41 +0100)]
[spotbugs] Fix potential NPE in FS.FileStoreAttributes#get

Path#getParent can return null, return fallback filestore attributes in
that case.

Change-Id: Ic09484d527bc87b27964b625e07373b82412f2da
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Silence CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE in jgit tests 79/173379/7
Matthias Sohn [Fri, 4 Dec 2020 10:38:44 +0000 (11:38 +0100)]
[spotbugs] Silence CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE in jgit tests

We want complete control over clone behavior and don't want to use
Object's clone implementation.

Change-Id: I34a4e967f8aa3879c69a4978768bd35712c4105c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in FakeUserAuthGSS#doAuth 78/173378/7
Matthias Sohn [Fri, 4 Dec 2020 10:27:47 +0000 (11:27 +0100)]
[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in FakeUserAuthGSS#doAuth

Also mark the return value @Nullable to enable null analysis in Eclipse.

Change-Id: Ib954b231d743da6ea122adb2cc4880b5f99824cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix FileReftableStack#equals to check for null 77/173377/7
Matthias Sohn [Fri, 4 Dec 2020 10:21:08 +0000 (11:21 +0100)]
[spotbugs] Fix FileReftableStack#equals to check for null

This fixes spotbugs warning NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT.

This implementation violated the contract defined by
java.lang.Object.equals() because it did not check for null being passed
as the argument. All equals() methods should return false if passed a
null value.

Change-Id: I607f6979613d390aae2f3546b587f63133d6d73c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] FileReftableDatabase: extract lock to local variable 76/173376/7
Matthias Sohn [Fri, 4 Dec 2020 10:15:35 +0000 (11:15 +0100)]
[spotbugs] FileReftableDatabase: extract lock to local variable

This fixes UL_UNRELEASED_LOCK_EXCEPTION_PATH raised by spotbugs in
#compactFully.

Change-Id: I370578ad9a027c5c9709d60a1dfafdac0cfca908
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] DfsReftableDatabase: extract lock to local variable 75/173375/7
Matthias Sohn [Fri, 4 Dec 2020 10:12:27 +0000 (11:12 +0100)]
[spotbugs] DfsReftableDatabase: extract lock to local variable

This fixes UL_UNRELEASED_LOCK_EXCEPTION_PATH raised by spotbugs in
#DfsReftableDatabase and #clearCache.

Change-Id: Ifd3189288d2a8e64139c02cd105eb335fa2f68cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in IgnoreNode#checkIgnored 74/173374/7
Matthias Sohn [Fri, 4 Dec 2020 10:01:06 +0000 (11:01 +0100)]
[spotbugs] Silence NP_BOOLEAN_RETURN_NULL in IgnoreNode#checkIgnored

Also mark the return value @Nullable to enable null analysis in Eclipse.

Change-Id: I5b286d657d432f4b32afd4dd370f76892b115422
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Silence warning DLS_DEAD_LOCAL_STORE in generated classes 73/173373/7
Matthias Sohn [Fri, 4 Dec 2020 09:42:11 +0000 (10:42 +0100)]
[spotbugs] Silence warning DLS_DEAD_LOCAL_STORE in generated classes

Change-Id: I714f5fa48a2443d1a8e2c640b204d3e32438910e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Silence warning about unwritten field written by gson 72/173372/7
Matthias Sohn [Fri, 4 Dec 2020 09:33:59 +0000 (10:33 +0100)]
[spotbugs] Silence warning about unwritten field written by gson

It seems spotbugs does not recognize that this data is written by gson.

Change-Id: I0704d489971c0ab6ec398083f211c409061e7661
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.10' 50/174050/1
Matthias Sohn [Tue, 22 Dec 2020 09:52:24 +0000 (10:52 +0100)]
Merge branch 'stable-5.10'

* stable-5.10:
  Update jgit-4.18 target platform to use release repository

Change-Id: I1bc7b6d38085ba31fa65ad882a4f991da27bbf72
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRevert "Remove unused API problem filters" 49/174049/1
Matthias Sohn [Tue, 22 Dec 2020 09:50:59 +0000 (10:50 +0100)]
Revert "Remove unused API problem filters"

This reverts commit 022b02dea10612cb01f9694212b72bd1bbd69cb9.

Removing this API warning filter was wrong since we intentionally
removed the config constant CONFIG_REFSTORAGE_REFTREE.

Change-Id: Ie068e539157cc2312efc8a07feabeb0dd2f75096
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpdate jgit-4.18 target platform to use release repository 45/173945/1
Matthias Sohn [Thu, 17 Dec 2020 21:26:46 +0000 (22:26 +0100)]
Update jgit-4.18 target platform to use release repository

Change-Id: I62aaf1cb823e05f277b16b156d0f9a4928efe213

3 years agoRemove unused API problem filters 71/173371/5
Matthias Sohn [Fri, 4 Dec 2020 08:42:32 +0000 (09:42 +0100)]
Remove unused API problem filters

Change-Id: Id533cf598cd37c277b4de06fdd8ae74cfeede4d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in FS#write 70/173370/5
Matthias Sohn [Fri, 4 Dec 2020 08:40:47 +0000 (09:40 +0100)]
[spotbugs] Fix potential NPE in FS#write

Path#getParent can return null.

Change-Id: I01f13ac426dda4c007cc5caab546a0c9be62ce76
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in PackFileSnapshotTest 69/173369/5
Matthias Sohn [Fri, 4 Dec 2020 00:51:37 +0000 (01:51 +0100)]
[spotbugs] Fix potential NPE in PackFileSnapshotTest

Path#getFileName can return null. Fix the warning by asserting the file
name isn't null.

Change-Id: I7f2fe75b46113d8be1d14e3f18dd77da27df25ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPEs in FileReftableStackTest 68/173368/5
Matthias Sohn [Fri, 4 Dec 2020 00:26:23 +0000 (01:26 +0100)]
[spotbugs] Fix potential NPEs in FileReftableStackTest

File#listFiles can return null. Use Files#list instead to fix the
problem.

Change-Id: I74e0b49aa6dae370219507c64aa43be4d8aa7b82
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in WorkingTreeIterator#isModified 67/173367/4
Matthias Sohn [Thu, 3 Dec 2020 01:04:36 +0000 (02:04 +0100)]
[spotbugs] Fix potential NPE in WorkingTreeIterator#isModified

File#list can return null. Fix the potential NPE by using Files#list
which is also faster since it retrieves directory entries lazily while
File#list retrieves them eagerly.

Change-Id: Idf4bda398861c647587e357326b8bc8b587a2584
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in FileBasedConfigTest 66/173366/4
Matthias Sohn [Thu, 3 Dec 2020 00:54:25 +0000 (01:54 +0100)]
[spotbugs] Fix potential NPE in FileBasedConfigTest

Path#getParent can return null. Fix the warning by implementing a helper
method which asserts the parent is not null.

Change-Id: Ib4f8dff0674b74bc891f15f08bd9755c5ea728dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in GcPruneNonReferencedTest 65/173365/4
Matthias Sohn [Thu, 3 Dec 2020 00:49:18 +0000 (01:49 +0100)]
[spotbugs] Fix potential NPE in GcPruneNonReferencedTest

File#listFiles can return null, assert it is not null to fix the
warning.

Change-Id: I28fc668fee760d39965e6e039003ac9f85fd461b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] Fix potential NPE in FileRepository#convertToReftable 64/173364/3
Matthias Sohn [Thu, 3 Dec 2020 00:44:58 +0000 (01:44 +0100)]
[spotbugs] Fix potential NPE in FileRepository#convertToReftable

File#listFiles can return null. Use Files#list which does not return
null and should be faster since it's returning directory entries lazily
while File#listFiles fetches them eagerly.

Change-Id: I3bfe2a52278244fc469143692c06b05d9af0d0d4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] silence warnings for intended use of == to compare strings 87/172987/4
Matthias Sohn [Sun, 29 Nov 2020 21:03:42 +0000 (22:03 +0100)]
[spotbugs] silence warnings for intended use of == to compare strings

Change-Id: Ib6967ad4deb5cf233d1f1d714cd094da5fad48e3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] silence short-circuit warning in PackOutputStream#write 86/172986/4
Matthias Sohn [Sun, 29 Nov 2020 20:46:09 +0000 (21:46 +0100)]
[spotbugs] silence short-circuit warning in PackOutputStream#write

Change-Id: I47b7a7991afae0dd1e678bd5e1f8e81599791e5f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[spotbugs] parse time using thread-safe DateTimeFormatter 85/172985/4
Matthias Sohn [Sun, 29 Nov 2020 20:43:51 +0000 (21:43 +0100)]
[spotbugs]  parse time using thread-safe DateTimeFormatter

LfsConnectionFactory used a static SimpleDateFormat which isn't
thread-safe. Use DateTimeFormatter instead to fix this.

Change-Id: Id580251c999e1e412c269f37b29860d310124c89
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFetchProcess#execute: fix formatting 71/172971/5
Matthias Sohn [Sun, 29 Nov 2020 00:24:08 +0000 (01:24 +0100)]
FetchProcess#execute: fix formatting

Change-Id: I133af64e6b165bdc58b8d7c805f0c68b6919baf2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[errorprone] FetchProcess: ensure exception isn't suppressed 70/172970/5
Matthias Sohn [Sat, 28 Nov 2020 23:34:41 +0000 (00:34 +0100)]
[errorprone] FetchProcess: ensure exception isn't suppressed

If TransportException is thrown in the finally block of execute()
ensure that the exception handled in the previous catch block isn't
suppressed.

Change-Id: I670acdfb4d36e7a419a9a79ae9faab2e085a43ee
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years ago[errorprone] WalkFetchConnection: ensure exception isn't suppressed 69/172969/5
Matthias Sohn [Sat, 28 Nov 2020 23:29:08 +0000 (00:29 +0100)]
[errorprone] WalkFetchConnection: ensure exception isn't suppressed

If TransportException is thrown in the finally block of
downloadPackedObject() ensure that the exception handled in the previous
catch block isn't suppressed.

Change-Id: I23982a2b215e38f681cc1719788985e60232699a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove unused API problem filters 95/173795/1
Matthias Sohn [Tue, 15 Dec 2020 00:47:23 +0000 (01:47 +0100)]
Remove unused API problem filters

Change-Id: I982f21dfaec4e35818eca7a4793e24a2cec4e467
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoRemove reftree and ketch 41/152841/2
Han-Wen Nienhuys [Sun, 17 Nov 2019 17:51:14 +0000 (09:51 -0800)]
Remove reftree and ketch

This was experimental code and never used in production.

Change-Id: Ia3da7f2b82d9e365cec2ccf9397cbc47439cd150
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoLsRemote: suppress warning for non-externalized string 94/173794/1
Matthias Sohn [Tue, 15 Dec 2020 00:53:01 +0000 (01:53 +0100)]
LsRemote: suppress warning for non-externalized string

Change-Id: Ic1d8f2eef4a8de0a75d5b523b584b1ac275a8811
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoLooseObjects: fix formatting 93/173793/1
Matthias Sohn [Tue, 15 Dec 2020 01:00:17 +0000 (02:00 +0100)]
LooseObjects: fix formatting

Change-Id: I992e5066d1dc4603e5bae991b26605d319f5cdc2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoSplit out loose object handling from ObjectDirectory 60/122060/6
Martin Fick [Thu, 26 Apr 2018 16:53:57 +0000 (10:53 -0600)]
Split out loose object handling from ObjectDirectory

The ObjectDirectory class manages the interactions for the entire object
database, this includes loose objects, packfiles, alternates, and
shallow commits. To help reduce the complexity of this class, abstract
some of the loose object specific details into a class which understands
just this, leaving the ObjectDirectory to focus more on the interactions
between the different mechanisms.

Change-Id: I39f3a74d6308f042a2a2baa57769f4acde5ba5e0
Signed-off-by: Martin Fick <mfick@codeaurora.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.9' 56/173756/1
Matthias Sohn [Mon, 14 Dec 2020 15:03:00 +0000 (16:03 +0100)]
Merge branch 'stable-5.9'

* stable-5.9:
  Fix stamping to produce stable file timestamps

Change-Id: Icd092cd9b883556fcbd115c17346a9d88dc172ce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoFix stamping to produce stable file timestamps 23/173523/3
David Ostrovsky [Sat, 5 Dec 2020 13:48:23 +0000 (14:48 +0100)]
Fix stamping to produce stable file timestamps

Change-Id: I628ab5feb4a70f81ec832f1b81d1ad3a9caca615

3 years agoPackDirectory: fix formatting 27/173727/1
Matthias Sohn [Sat, 12 Dec 2020 22:32:09 +0000 (23:32 +0100)]
PackDirectory: fix formatting

Change-Id: I10586981323529c7e9041110ebb58033e7180194
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoSplit out packfile handling from ObjectDirectory 59/122059/6
Martin Fick [Wed, 25 Apr 2018 17:59:21 +0000 (11:59 -0600)]
Split out packfile handling from ObjectDirectory

The ObjectDirectory class manages the interactions for the entire object
database, this includes loose objects, packfiles, alternates, and
shallow commits. To help reduce the complexity of this class, abstract
some of the packfile specific details into a class which understands
just this, leaving the ObjectDirectory to focus more on the interactions
between the different mechanisms.

Change-Id: I5cc87b964434b0afa860b3fe23867a77b3c3a4f2
Signed-off-by: Martin Fick <mfick@codeaurora.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoTagCommand: propagate NO_CHANGE information 38/173538/2
Thomas Wolf [Tue, 8 Dec 2020 14:45:35 +0000 (15:45 +0100)]
TagCommand: propagate NO_CHANGE information

Some clients may wish to allow NO_CHANGE lightweight tag updates
without setting the force flag. (For instance EGit does so.)
Command-line git does not allow this.

Propagate the RefUpdate result via the RefAlreadyExistsException.
That way a client has the possibility to catch it and check the
failure reason without having to parse the exception message, and
take appropriate action, like ignoring the exception on NO_CHANGE.

Change-Id: I60e7a15a3c309db4106cab87847a19b6d24866f6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoTagCommand: make -f work with lightweight tags for NO_CHANGE 33/173533/3
Thomas Wolf [Tue, 8 Dec 2020 13:52:00 +0000 (14:52 +0100)]
TagCommand: make -f work with lightweight tags for NO_CHANGE

JGit treated a NO_CHANGE RefUpdate as an error in all cases. But when
updating a lightweight tag, this is a successful result if -f was
specified.

Change-Id: Iddfa6d6a6dc8bf8fed81138a008ebc32d5f960bd
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoMerge branch 'stable-5.10' 58/173558/1
Matthias Sohn [Tue, 8 Dec 2020 20:00:16 +0000 (21:00 +0100)]
Merge branch 'stable-5.10'

* stable-5.10:
  Prepare 5.10.1-SNAPSHOT builds
  JGit v5.10.0.202012080955-r

Change-Id: I751f55944d2aebbd622dda8acd8c113208a972eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.10.1-SNAPSHOT builds 56/173556/1
Matthias Sohn [Tue, 8 Dec 2020 16:35:15 +0000 (17:35 +0100)]
Prepare 5.10.1-SNAPSHOT builds

Change-Id: If1e44edfa0a80a29c00ed5112291d1338baf56f1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.10.0.202012080955-r 42/173542/1 v5.10.0.202012080955-r
Matthias Sohn [Tue, 8 Dec 2020 14:56:08 +0000 (15:56 +0100)]
JGit v5.10.0.202012080955-r

Change-Id: I7ca88bcc54992625a6fafd84172adee58d487dc3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoTagCommand: support signing annotated tags 39/173439/3
Thomas Wolf [Sat, 5 Dec 2020 21:01:25 +0000 (22:01 +0100)]
TagCommand: support signing annotated tags

Add the two config constants from C git that can switch on signing
of annotated tags. Add them to the GpgConfig, and implement actually
signing a tag in TagCommand.

The interactions between command line options for "git tag" and config
options is a bit murky in C git. There are two config settings for it:

* tag.gpgSign is the main option, if set to true, it kicks in if
  neither -s nor -u are given on the command line.
* tag.forceSignAnnotated signs only tags created via "git tag -m",
  but only if command-line option "-a" is not present. It applies
  even if tag.gpgSign is set explicitly to false.

Giving -s or -u on the command line also forces an annotated tag
since lightweight tags cannot be signed.

Bug: 386908
Change-Id: Ic8a1a44b5f12f47d5cdf3aae2456c1f6ca9ef057
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoEnable GpgSigner to also sign tags 38/173438/3
Thomas Wolf [Sat, 5 Dec 2020 20:55:29 +0000 (21:55 +0100)]
Enable GpgSigner to also sign tags

Factor out a common ObjectBuilder as super class of CommitBuilder
and TagBuilder, and make the GpgSigner work on ObjectBuilder.

In order not to break API, add the new method for signing an
ObjectBuilder in a new interface GpgObjectSigner.

The signature for a tag is just tacked onto the end of the tag
message. The message of a signed tag must end in LF.

Bug: 386908
Change-Id: I5e021e3c927f4051825cd7355b129113b949455e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoAdded check for null on DirCacheEntry in checkoutEntry method 24/170224/10
Tudor Matrescu [Wed, 21 Oct 2020 09:41:40 +0000 (12:41 +0300)]
Added check for null on DirCacheEntry in checkoutEntry method

Observed the error when trying to force checkout from a branch
that had no changes on it. When the 'keep()' method from 'DirCacheCheckout'
method was called the 'DirCacheEntry e' was null and was passed like
this to the 'checkoutEntry()' method where the 'getObjectId()' is
being called on the 'e' object

Change-Id: If3a9b9e60064459d187c7db04eb4471a72c6cece

3 years agoMerge branch 'stable-5.10' 78/173278/1
Matthias Sohn [Wed, 2 Dec 2020 23:51:23 +0000 (00:51 +0100)]
Merge branch 'stable-5.10'

* stable-5.10:
  Prepare 5.10.0-SNAPSHOT builds
  JGit v5.10.0.202012021225-rc1
  Don't install 3rd party dependency bundles via features

Change-Id: Ia901830d1057667dc8e78d235c63f84373f8887b

3 years agoPrepare 5.10.0-SNAPSHOT builds 63/173263/1
Matthias Sohn [Wed, 2 Dec 2020 20:01:52 +0000 (21:01 +0100)]
Prepare 5.10.0-SNAPSHOT builds

Change-Id: I9cc9fa32a737b4916cdb5b52bac8f724ebee09bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoJGit v5.10.0.202012021225-rc1 61/173261/1 v5.10.0.202012021225-rc1
Matthias Sohn [Wed, 2 Dec 2020 17:25:20 +0000 (18:25 +0100)]
JGit v5.10.0.202012021225-rc1

Change-Id: Ic774356e09bb9d24e5d99334bd4ea173bd4071ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoDon't install 3rd party dependency bundles via features 55/173255/1
Matthias Sohn [Fri, 2 Oct 2020 19:54:53 +0000 (21:54 +0200)]
Don't install 3rd party dependency bundles via features

Instead provide them only in the p2 repository. This way they are
available when installing from the jgit p2 repository but we are not
enforcing the version we bring but can also use the version available in
Eclipse if it matches our requirements.

Bug: 514326
Bug: 566475
Change-Id: I3e8d0bad12cfb0c1003ade3e6f13e9af35626f14
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPrepare 5.11.0-SNAPSHOT builds 43/173243/1
Matthias Sohn [Wed, 2 Dec 2020 14:57:16 +0000 (15:57 +0100)]
Prepare 5.11.0-SNAPSHOT builds

Change-Id: I91e5532526775191fbd34f81e2ef777cba605e3b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'master' into stable-5.10 38/173238/1
Matthias Sohn [Wed, 2 Dec 2020 14:49:35 +0000 (15:49 +0100)]
Merge branch 'master' into stable-5.10

* master:
  Prepare 5.3.10-SNAPSHOT builds
  JGit v5.3.9.202012012026-r
  Prepare 5.1.16-SNAPSHOT builds
  JGit v5.1.15.202012011955-r
  Fix PackInvalidException when fetch and repack run concurrently
  Upgrade maven-pmd-plugin to 3.14.0
  Update Orbit to R20201130205003 for 2020-12
  Use new protocol version constants
  PacketLineInTest: test for END and DELIM being distinguishable
  Add constants for parsing git wire protocol version
  Ignore missing javadoc tags in test bundles
  Bazel: Allow to build and run the tests with JDK 15
  [releng] japicmp: update last release version
  Add support for reading symrefs from pack capabilities

Change-Id: I5afbbb912f502991f0cf9c2501b024f5f00144ba
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.9' 37/173237/1
Matthias Sohn [Wed, 2 Dec 2020 14:33:52 +0000 (15:33 +0100)]
Merge branch 'stable-5.9'

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

Change-Id: I3cf6c71e8310c1d7ef333d4a9c23fa41f45118c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.8' into stable-5.9 34/173234/1
Matthias Sohn [Wed, 2 Dec 2020 14:31:00 +0000 (15:31 +0100)]
Merge branch 'stable-5.8' into stable-5.9

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

Change-Id: I08caea979ac4c1298b453e6e5558bccb86fb0181
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.7' into stable-5.8 33/173233/1
Matthias Sohn [Wed, 2 Dec 2020 14:28:33 +0000 (15:28 +0100)]
Merge branch 'stable-5.7' into stable-5.8

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

Change-Id: I638ee6409f25ac8bcb2e365b1c37939b520b289f

3 years agoMerge branch 'stable-5.6' into stable-5.7 32/173232/1
Matthias Sohn [Wed, 2 Dec 2020 14:25:44 +0000 (15:25 +0100)]
Merge branch 'stable-5.6' into stable-5.7

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

Change-Id: If5f001c414e677bb2bac59714421f0191b23ea1f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.5' into stable-5.6 31/173231/1
Matthias Sohn [Wed, 2 Dec 2020 14:21:10 +0000 (15:21 +0100)]
Merge branch 'stable-5.5' into stable-5.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bug: 569349
Change-Id: I9dbf8801c8d3131955ad7124f42b62095d96da54
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUpgrade maven-pmd-plugin to 3.14.0 82/172682/4
Marco Miller [Mon, 23 Nov 2020 14:16:11 +0000 (09:16 -0500)]
Upgrade maven-pmd-plugin to 3.14.0

Change-Id: I45b49e1262db50e74b43c6273d3b3df692765330
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
3 years agoUpdate Orbit to R20201130205003 for 2020-12 77/173177/1
Matthias Sohn [Tue, 1 Dec 2020 20:32:35 +0000 (21:32 +0100)]
Update Orbit to R20201130205003 for 2020-12

Change-Id: I9a563d6f125e9a3983990b8a111d3288c9100162
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoUse new protocol version constants 25/173025/2
Matthias Sohn [Mon, 30 Nov 2020 15:44:05 +0000 (16:44 +0100)]
Use new protocol version constants

Change-Id: Icd6b876e392c55a7322a990ac7f618250b732b4b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoMerge branch 'stable-5.9' 19/173019/3
Matthias Sohn [Mon, 30 Nov 2020 14:29:01 +0000 (15:29 +0100)]
Merge branch 'stable-5.9'

* stable-5.9:
  Add constants for parsing git wire protocol version

Change-Id: I1e4174ae8bbefcb71a191dcbf32027d4b35c2b37
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoPacketLineInTest: test for END and DELIM being distinguishable 12/173012/1
Thomas Wolf [Mon, 30 Nov 2020 12:02:18 +0000 (13:02 +0100)]
PacketLineInTest: test for END and DELIM being distinguishable

Explicitly test that END and DELIM can be distinguished. If not, the
wire protocol V2 breaks down.

Bug: 568950
Change-Id: I5f3496168244303c68893f1c756831dd27440aeb
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
3 years agoAdd constants for parsing git wire protocol version 79/172979/3
David Ostrovsky [Sun, 29 Nov 2020 12:06:00 +0000 (13:06 +0100)]
Add constants for parsing git wire protocol version

This would allow other JGit users to access and reuse the constants.

Change-Id: I1608802f45586af5f8582afa592e26679e9cebe3
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoIgnore missing javadoc tags in test bundles 68/172968/3
Matthias Sohn [Thu, 19 Nov 2020 00:55:35 +0000 (01:55 +0100)]
Ignore missing javadoc tags in test bundles

It seems Eclipse 4.18 reports them as error whereas earlier versions
ignored this maybe since we don't require javadoc comments for all the
test bundles.

Change-Id: I3f4d42ce681ea5c2b4b302991d2641290ac8561d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
3 years agoBazel: Allow to build and run the tests with JDK 15 99/172699/2
David Ostrovsky [Mon, 23 Nov 2020 19:04:07 +0000 (20:04 +0100)]
Bazel: Allow to build and run the tests with JDK 15

To avoid JDK specific bugs in future, like Bug: 568950, and given that
upcoming Bazel release 4.0.0 added support to JDK 15 java toolchain,
add definition for remote JDK 15 to WORKSPACE file and add build and
test instructions.

To build and execute the tests with JDK 15 on Linux run:

  $ bazelisk test \
    --java_toolchain=@remote_java_tools_linux//:toolchain_jdk_15 \
    --host_java_toolchain=@remote_java_tools_linux//:toolchain_jdk_15 \
    --javabase=@openjdk15_linux_archive//:runtime \
    --host_javabase=@openjdk15_linux_archive//:runtime \
    //...

To build and execute the tests with JDK 15 on Mac Os X run:

  $ bazelisk test \
    --java_toolchain=@remote_java_tools_darwin//:toolchain_jdk_15 \
    --host_java_toolchain=@remote_java_tools_darwin//:toolchain_jdk_15 \
    --javabase=@openjdk15_darwin_archive//:runtime \
    --host_javabase=@openjdk15_darwin_archive//:runtime \
    //...

To skip the options on the command line, put them in ~/.bazelrc file:

  build --java_toolchain=@remote_java_tools_linux//:toolchain_jdk_15
  build --host_java_toolchain=@remote_java_tools_linux//:toolchain_jdk_15
  build --javabase=@openjdk15_linux_archive//:runtime
  build --host_javabase=@openjdk15_linux_archive//:runtime

Change-Id: I79d5e99f0c731847a82ce7d4c410855434d85f8d
Signed-off-by: David Ostrovsky <david@ostrovsky.org>